Commit Graph

140901 Commits

Author SHA1 Message Date
Marius Strobl
9888af9c4e Remove clkbrd(4) as a separate device and compile it solely based
on the presence of fhc(4) instead; we by far don't support all of
the functionality provide by the clock board but in general it's
an integral part of FireHose-based systems which shouldn't be
possible to omit.
2008-08-23 14:28:44 +00:00
Bjoern A. Zeeb
c06f087ccb Cache the cred locally in _syncache_add() while holding the locks, so
we can be sure that it's valid.
In case we abort early free it again else put it into the syncache.

We need the cred in the syncache to be able to restrict what will be
exportet by the sysctl helper function syncache_pcblist() (to netstat)
within jails.

PR:		kern/126493
Reviewed by:	rwatson (earlier versions)
MFC after:	3 days
2008-08-23 14:22:12 +00:00
Marius Strobl
3b7c344be4 - Add kbdmux(4); since sunkbd(4) was tought to emulate atkbd(4) like
ukbd(4) does and that emulation was enabled by default, all three of
  them work together with kbdmux(4) out of the box just fine.
- Fix some whitespace bugs.

MFC after:	3 days
2008-08-23 14:17:00 +00:00
Ed Schouten
ce570f82cc Remove unused tty_gone() checks inside ttyoutq_read_uio().
When my earlier MPSAFE TTY prototypes still implemented line
disciplines, we needed a mechanism to abort read()'s on PTY master
devices when inside the line discipline. Because this is no longer the
case, these checks have become unneeded.
2008-08-23 13:32:21 +00:00
Ed Schouten
f8f8c9f0d6 Make stty(1) use tab0 and tab3 to handle tab completion.
After the MPSAFE TTY import, we have support for the TAB0 and TAB3 flags
to handle tab expansion, while we only used to support OXTABS. Switch
stty(1) to use tab0 and tab3 to print whether tab expansion is turned on
or off. Implement the oxtabs and tabs switches by setting the
appropriate TABx value.

Even though POSIX only lists this as being XSI, we'd better follow it.
2008-08-23 13:28:55 +00:00
John Baldwin
aa22af9438 If we are unable to obtain a frequency list from either ACPI or the static
tables, then attempt to build a simple list containing just the high and
low frequencies based on the current CPU frequency calculated during boot
and the contents of the MSR.

MFC after:	1 month
2008-08-23 12:53:42 +00:00
Antoine Brodin
2f2ea10a07 Remove unused variable nosleepwithlocks.
PR:		126609
Submitted by:	Mateusz Guzik
MFC after:	1 month
X-MFC:		to stable/7 only, this variable is still used in stable/6
2008-08-23 12:40:07 +00:00
John Baldwin
ad86a65e32 Adjust the handling the various timer frequencies when using the lapic
timer.  Previously, the various divisors were fixed which meant that while
it gave somewhat reasonable stathz, etc. at hz=1000, it went off the rails
with any other hz value.  With these changes, we now pick a lapic timer hz
based on the value of hz.  If hz is >= 1500, then the lapic timer runs at
hz.  If 1500 hz >= 750, we run the lapic timer at hz * 2.  If hz < 750, we
run at hz * 4.  We compute a divider at runtime to make stathz run as close
to 128 as we can since stathz really wants to be run at something close to
that frequency.  Profiling just runs on every clock tick.  So some examples:

With hz = 100, the lapic timer now runs at 400 instead of 2000.  stathz
will be 133, and profhz = 400.  With hz = 1000 (default), the lapic timer
is still at 2000 (as it is now), stathz is at 133 (as it is now), and
profhz will be 2000 (previously 666).

MFC after:	2 weeks
2008-08-23 12:35:43 +00:00
Bjoern A. Zeeb
bb580846dc Add an explicit comment why we NULLify the two variables.
Reviewed by:	rwatson
MFC after:	3 days
2008-08-23 12:27:18 +00:00
Warner Losh
632ed478b0 Document that devlistp and devcountp are only updated when there's no
error.
Bump date.
2008-08-23 07:50:20 +00:00
Warner Losh
195c96b714 Revert bogusly committed file. 2008-08-23 07:46:58 +00:00
Warner Losh
e1bd4ee68b Set devs to 0 in case device_get_children return an error. The right thing
to do here is nothing in that case...
2008-08-23 07:46:20 +00:00
Warner Losh
83bda63e3e Actually revert last... Upon closer inspection the code works in the
face of errors already...  A bit unorthodox, but none-the-less valid.
2008-08-23 07:43:03 +00:00
Warner Losh
b52943f026 Handle errors in device_get_children gracefully. 2008-08-23 07:41:21 +00:00
Warner Losh
da02572e7f Handle errors from device_get_chidlren.
Free child list when there's more children than we expected.
2008-08-23 07:38:00 +00:00
Warner Losh
696771ee0a Cope with errors from device_get_children(). These errors can happen
only in low memory situations, so the error fork of these fixes is
lightly tested, but they should do the least-wrong thing...

Submitted by:	Hans Petter Selasky
2008-08-23 07:23:52 +00:00
Warner Losh
de5d443f0f Cosmetic nit. 2008-08-23 07:18:30 +00:00
Warner Losh
e6b3a7a9c1 Add MIPS support.
Reviewed by:	jb@
2008-08-23 04:58:11 +00:00
Nathan Whitehorn
f620b5bf45 Allow the MD UMA allocator to use VM routines like kmem_*(). Existing code requires MD allocator to be available early in the boot process, before the VM is fully available. This defines a new VM define (UMA_MD_SMALL_ALLOC_NEEDS_VM) that allows an MD UMA small allocator to become available at the same time as the default UMA allocator.
Approved by:	marcel (mentor)
2008-08-23 01:35:36 +00:00
Craig Rodrigues
6910e995d9 Instead of passing MNT_UPDATE, MNT_SNAPSHOT, MNT_RELOAD from
userspace to kernel via nmount(), pass in the strings
"update", "snapshot", "reload".

We want to move away from passing MNT_ flags from userspace -> kernel
via nmount(), and instead favor passing the string options.
2008-08-23 01:21:10 +00:00
Warner Losh
1353dc1da5 Minor style nits. 2008-08-23 01:20:36 +00:00
Craig Rodrigues
d5bdb2f68d In nmount(), when we see the "force" option,
set the MNT_FORCE flag, but do not persist "force"
in the options list, since it is a command, not a persistent property
of a mount.

Similarly, when we see "reload", set MNT_RELOAD,
but delete "reload" from the options list.

MFC after:	1 week
2008-08-23 01:16:09 +00:00
Kip Macy
6205924afd Submit a band-aid for interrupt set up race.
MFC after:	1 month
2008-08-22 23:24:53 +00:00
Ed Schouten
0f0a7c27c5 Fix two small bugs in tcsetattr().
- According to POSIX, tcsetattr() must not fail when any of the bits in
  the structure are unsupported, but it must leave the unsupported flags
  alone.

- The CIGNORE flag (set by TCSASOFT, extension) was not cleared from
  c_cflag, which means using it would cause it to be applied during its
  entire lifespan. Eventually make sure we clear the flag.

I don't really like CIGNORE, but I think we must keep it alive right
now. With our new TTY layer, we don't actually need this mechanism,
because if you leave c_cflag, c_ispeed and c_ospeed alone, we won't make
a call into the device driver anyway.

Reported by:	naddy
Tested by:	naddy
2008-08-22 21:27:37 +00:00
Ollivier Robert
b9b2ce9a36 Hook back ntp to the build now that I fixed it.
Pointy hat to:	me
2008-08-22 21:20:23 +00:00
Kip Macy
2d28c06b42 Don't try enumerating APICs when running on top of xen
(fixes boot on 64-bit dom0s)

MFC after:	1 month
2008-08-22 20:38:25 +00:00
Marius Strobl
898112a7dc cosmetic changes and style fixes 2008-08-22 20:28:19 +00:00
Ollivier Robert
718daf0805 Add forgotten libopts subdir.
MFC after:	2 weeks
2008-08-22 20:04:35 +00:00
Marius Strobl
44e1fdfdcf Avoid misaligned access of struct frame.
MFC after:	3 days
2008-08-22 19:05:47 +00:00
John Baldwin
bbb8e141e3 Add a label for myself. 2008-08-22 18:52:27 +00:00
John Baldwin
8fd40d8a9e Use bus_foo() rather than bus_space_foo() and remove bus handle and tag
from softc.
2008-08-22 18:43:19 +00:00
John Baldwin
19ab530d2a Use ppc_detach() for device_detach instead of ppc_attach().
MFC after:	1 week
2008-08-22 18:42:45 +00:00
John Baldwin
8aef71dd4f Whitespace fix. 2008-08-22 18:42:18 +00:00
John Baldwin
b43e2a6b83 Remove unused UNITOSOFTC() macro. 2008-08-22 18:42:05 +00:00
Bjoern A. Zeeb
4cb3914f29 Temporary unhook ntp from the build until the missing net/libopts/Makefile
is in place. The TB is too busy sending mails.
2008-08-22 18:36:58 +00:00
John Baldwin
7847a9daec A suspended thread can, in fact, be swapped out. Thus,
thread_unsuspend_one() needs to optionally wakeup the swapper.  Since we
hold the thread lock for that entire function, however, we have to push
that requirement up into the caller.

Found by:	rwatson
2008-08-22 16:15:58 +00:00
John Baldwin
814f26da8a Use |= rather than += when aggregrating requests to wakeup the swapper.
What we really want is an inclusive or of all the requests, and += can
in theory roll over to 0.
2008-08-22 16:14:23 +00:00
Ollivier Robert
4b3963629c Add myself there. 2008-08-22 16:06:35 +00:00
Ollivier Robert
271c3a9060 Update the various files to sync with vendor import of 4.2.4p5.
sntp includes a copy of libopts in itself in vendor code, rewrite the
Makefile to compile and use only one copy.  It is an internal library, not
installed.

MFC after:	2 weeks
2008-08-22 16:00:48 +00:00
Ollivier Robert
ea906c4152 Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit
will update usr.sbin/ntp to match this.

MFC after:	2 weeks
2008-08-22 15:58:00 +00:00
Edward Tomasz Napierala
65cf8f0691 Add myself.
Approved by:	rwatson
2008-08-22 13:29:30 +00:00
Yoshihiro Takahashi
ab61396de4 Back FreeBSD(98)'s copyright to 2003. 2008-08-22 12:31:21 +00:00
Ed Schouten
6137be4386 Fix pts(4) error codes when slave device is closed.
Unlike pre-MPSAFE TTY, the pts(4) driver always returned ENXIO when a
read() or write() was performed on a pseudo-terminal master device when
the slave device was not opened. The old implementation had different
semantics:

- When the slave device had not been opened yet, read() and write() just
  blocked.
- When the slave device had been closed, a read() call would return 0
  bytes length.
- When the slave device had been closed, a write() call would return
  EIO.

Change the new implementation to return 0 and EIO as well. We don't
implement the first rule, but I suspect this is not needed, because
routines like openpty() also open the slave device node. posix_openpt()
users also do similar things.

Reported by:	rink
Tested by:	rink
2008-08-22 10:40:21 +00:00
Konstantin Belousov
af8d325c77 Add -fno-omit-frame-pointer to CFLAGS used to compile crt1.c on amd64.
For gcc' __builtin_frame_address() to work, all call frames need to save
frame pointer. In particular, this is important for the upper frame that
should terminate the chain.

No objections from:	jhb
PR:	amd64/126543
MFC after:	1 week
2008-08-22 09:23:39 +00:00
Pyun YongHyeon
861cf54c59 Add a new sysctl node 'dev.bfe.N.stats' that shows various MAC
counters for Rx/Tx statistics. Various counters in ifnet is also
updated with these hardware counters.

Tested by:	kib, Gleb Kurtsou gleb.kurtsou at gmail dot com
		Ulrich Spoerlein uspoerlein at gmail dot com
2008-08-22 06:46:55 +00:00
Ed Schouten
7dc843ca92 Prevent VSTART flooding when turning on software flow control.
It turned out we transmitted VSTART after each successful read on a TTY
when software flow control was turned on. This was because of a very
evil bug where we tested the TF_HIWAT_IN flag the other way around.

Reported by:	Christian Weisgerber <naddy mips inka de>
2008-08-22 05:15:52 +00:00
Pyun YongHyeon
2be30c0d91 Because bfe(4) knows interrupt mask value there is no need to read
interrupt mask register again. This saves one register access per
each interrupt.
Also don't try to process frames when driver is not running.

Tested by:	kib, Gleb Kurtsou gleb.kurtsou at gmail dot com
		Ulrich Spoerlein uspoerlein at gmail dot com
2008-08-22 04:52:21 +00:00
Tim Kientzle
5d5624c080 Comment a couple of places where bsdcpio and gcpio 2.9 disagree.
The number of blocks read from ustar archives is just an implementation
difference.  The failure of bsdcpio to emit a block count to stderr
in -p mode is a real bug in bsdcpio.
2008-08-22 02:27:06 +00:00
John Baldwin
d320e05ca5 Extend the support for PCI-e memory mapped configuration space access:
- Rename pciereg_cfgopen() to pcie_cfgregopen() and expose it to the
  rest of the kernel.  It now also accepts parameters via function
  arguments rather than global variables.
- Add a notion of minimum and maximum bus numbers and reject requests for
  an out of range bus.
- Add more range checks on slot/func/reg/bytes parameters to the cfg reg
  read/write routines.  Don't panic on any invalid parameters, just fail
  the request (writes do nothing, reads return -1).  This matches the
  behavior of the other cfg mechanisms.
- Port the memory mapped configuration space access to amd64.  On amd64
  we simply use the direct map (via pmap_mapdev()) for the memory mapped
  window.
- During acpi_attach() just after loading the ACPI tables, check for a
  MCFG table.  If it exists, call pciereg_cfgopen() on each subtable
  (memory mapped window).  For now we only support windows for domain 0
  that start with bus 0.  This removes the need for more chipset-specific
  quirks in the MD code.
- Remove the chipset-specific quirks for the Intel 5000P/V/Z chipsets
  since these machines should all have MCFG tables via ACPI.
- Updated pci_cfgregopen() to DTRT if ACPI had invoked pcie_cfgregopen()
  earlier.

MFC after:	2 weeks
2008-08-22 02:14:23 +00:00
Tim Kientzle
643cd4ffe7 The newc-format verification is now a little smarter about
following the archive structure.  In particular, it no longer
crashes if you run it against GNU cpio 2.9 (although it does
still complain a lot more than it should).
2008-08-22 02:09:10 +00:00