Rong-En Fan [Mon, 26 Oct 2009 13:03:52 +0000 (13:03 +0000)]
Merge r198489 from vendor/ncurses/dist:
Pull upstream patch to fix ee(1) crash when received SIGWINCH:
modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a
SIGWINCH, and discard that value, to avoid confusing application
(patch by Eygene Ryabinkin, FreeBSD bin/136223).
Rong-En Fan [Mon, 26 Oct 2009 13:01:29 +0000 (13:01 +0000)]
Pull upstream patch to fix ee(1) crash when received SIGWINCH:
modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a
SIGWINCH, and discard that value, to avoid confusing application
(patch by Eygene Ryabinkin, FreeBSD bin/136223).
Alexander Kabaev [Sun, 25 Oct 2009 15:52:31 +0000 (15:52 +0000)]
Compile libgcov without stack protection. It can be linked into
both static and dynamic binaries compiled with or without stack
protection and should not depend on libssp_nonshared.a symbols.
Rui Paulo [Sun, 25 Oct 2009 10:23:11 +0000 (10:23 +0000)]
Update firmware images according to the latest iwn updated.
"device iwnfw" includes all firmware images, but you can pick just one
by using the model number, e.g.: "device iwn4965fw".
Bjoern A. Zeeb [Sun, 25 Oct 2009 09:58:56 +0000 (09:58 +0000)]
Unconditionally call the setsockopt for IPV6_V6ONLY for v6 linux sockets
no matter whether we are compiled as module or if our default of the
net.inet6.ip6.v6only sysctl already matches what we would set.
This avoids unnecessary complications with modules, VIMAGES, INET6 and
the sysctl value, especially considering that most users will use
linux compat as a module.
Jilles Tjoelker [Sat, 24 Oct 2009 21:20:04 +0000 (21:20 +0000)]
sh: Exempt $@ and $* from set -u
This seems more useful and will likely be in the next POSIX standard.
Also document more precisely in the man page what set -u does (note that
$@, $* and $! are the only special parameters that can ever be unset, all
the others are always set, although they may be empty).
Marcel Moolenaar [Sat, 24 Oct 2009 20:28:42 +0000 (20:28 +0000)]
A 32KB kernel stack is not quite enough. The new USB stack is a bit
more stack hungry as compared to the old one that my RX2660 gets
a machine check and spontaneously reboots at the time the USB DVD
drive is found and attached to CAM as a mass storage device. This
doesn't happen always, but definitely varies per kernel build.
Likewise when using a 128-byte printf buffer. The additional 128
bytes that printf needs seems to be enough to have the memory stack
and register stack collide and causing a machine check.
Nathan Whitehorn [Sat, 24 Oct 2009 18:33:01 +0000 (18:33 +0000)]
Turn on NAP mode on G5 systems, and refactor the HID0 setup code a little.
This makes my G5 Xserve sound slightly less like it is filled with
howling banshees.
Rui Paulo [Sat, 24 Oct 2009 09:55:11 +0000 (09:55 +0000)]
Updates to the iwn driver:
* iwnfw has now been split into individual modules so autoloading of
firmware module(s) does work again.
* Changes have been made to RUN -> AUTH transition, this should fix the
issue reported by Glen and others.
* Brandon reported issues in iwn_cmd() with large commands, those have
been fixed to.
* DEAUTH is now handled correctly.
Submitted by: Bernhard Schmidt <bschmidt at techwires.net>
Joseph Koshy [Sat, 24 Oct 2009 04:11:40 +0000 (04:11 +0000)]
Not all Intel Core (TM) CPUs implement PMC_CLASS_IAF fixed-function
counters. For such CPUs, use an alternate mapping of convenience
names to events supported by PMC_CLASS_IAP programmable counters.
Marcel Moolenaar [Fri, 23 Oct 2009 22:53:01 +0000 (22:53 +0000)]
BIOSes, buggy or otherwise, are i386 or amd64 specific.
Have the early USB takeover enabled for i386 and amd64
by default.
This also avoids a panic on PowerPC where the resource
isn't released properly and we find a busy resource
when the USB host controller wants to allocate it...
Nathan Whitehorn [Fri, 23 Oct 2009 21:36:33 +0000 (21:36 +0000)]
Add some more paranoia to setting HID registers, and update the AIM
clock routines to work better with SMP. This makes SMP work fully and
stably on an Xserve G5.
Robert Noland [Fri, 23 Oct 2009 18:44:53 +0000 (18:44 +0000)]
Correct some issues with zfs boot.
- Teach it to read gang blocks. (essentially untested)
If you see "ZFS: gang block detected!", please let
me know, so we can either remove the printf if it
works, or fix it if it doesn't.
- If multiple partitions exist on a disk, probe them all.
We also need to reset dsk->start to 0 to read the right
sector here.
- With GPT, we can have 128 partitions.
- If the bootfs property has ever been set on a pool
it seems that it never goes away. zpool won't allow
you to add to the pool with the bootfs property set.
However, if you clear the property back to default
we end up getting 0 for the object number and read
a bogus block pointer and fail to boot.
- Fix some error printfs. The printf in the loader is
only capable of c,s and u formats.
Jung-uk Kim [Fri, 23 Oct 2009 18:41:00 +0000 (18:41 +0000)]
- When we restore VESA state, try BIOS POST earlier. VESA restore state
function may not work properly if we don't. Turn off hardware cursor as
vesa_set_mode() does.
- Add VBE 3.0 specific fields in VESA mode structure and pack it. Note
the padding is 190 bytes although VBE 3.0 says 189 bytes. It must be wrong
because the size of structure becomes 255 bytes and the specification says
it must be 256 bytes in total. In fact, an example code in the spec. does
it right, though. While we are at it, fix some i386-isms.
- Remove state buffer size limitation. It is no longer necessary since
sys/compat/x86bios/x86bios.c r198251.
- Move int 0x10 vector test into vesa_bios_post() as we always do it anyway.
John Baldwin [Fri, 23 Oct 2009 15:14:54 +0000 (15:14 +0000)]
- Fix several off-by-one errors when using MAXCOMLEN. The p_comm[] and
td_name[] arrays are actually MAXCOMLEN + 1 in size and a few places that
created shadow copies of these arrays were just using MAXCOMLEN.
- Prefer using sizeof() of an array type to explicit constants for the
array length in a few places.
- Ensure that all of p_comm[] and td_name[] is always zero'd during
execve() to guard against any possible information leaks. Previously
trailing garbage in p_comm[] could be leaked to userland in ktrace
record headers via td_name[].
John Baldwin [Fri, 23 Oct 2009 15:09:51 +0000 (15:09 +0000)]
Don't bother copying the name of a kproc or kthread out into a temporary
array just to pass that array to printf(). kproc and kthread names are
NUL-terminated and can be printed using printf() directly.
Jilles Tjoelker [Fri, 23 Oct 2009 14:50:11 +0000 (14:50 +0000)]
wordexp(3): fix some bugs with signals and long outputs
* retry various system calls on EINTR
* retry the rest after a short read (common if there is more than about 1K
of output)
* block SIGCHLD like system(3) does (note that this does not and cannot
work fully in threaded programs, they will need to be careful with wait
functions)
Nathan Whitehorn [Fri, 23 Oct 2009 14:27:40 +0000 (14:27 +0000)]
Do not map the trap vectors into the kernel's address space. They are
only used in real mode and keeping them mapped only serves to make NULL
a valid address, which results in silent NULL pointer deferences.
Suggested by: Patrick Kerharo
Obtained from: projects/ppc64
Nathan Whitehorn [Fri, 23 Oct 2009 03:17:02 +0000 (03:17 +0000)]
Add SMP support on U3-based G5 systems. This does not yet work perfectly:
at least on my Xserve, getting the decrementer and timebase on APs to tick
requires setting up a clock chip over I2C, which is not yet done.
While here, correct the 64-bit tlbie function to set the CPU to 64-bit
mode correctly.
John Baldwin [Thu, 22 Oct 2009 14:53:44 +0000 (14:53 +0000)]
Set the devclass_t pointer specified in the DRIVER_MODULE() macro
sooner so it is always valid when a driver's identify routine is
called. Previously, new-bus would attempt to create the devclass for
a newly loaded driver in two separate places, once in
devclass_add_driver(), and again after devclass_add_driver() returned
in driver_module_handler(). Only the second lookup attempted to set a
device class' parent and set the devclass_t pointer specified in the
DRIVER_MODULE() macro. However, by the time it was executed, the
driver was already added to existing instances of the parent driver at
which point in time the new driver's identify routine would have been
invoked. The fix is to merge the two attempts and only create the
devclass once in devclass_add_driver() including setting the
devclass_t pointer passed to DRIVER_MODULE() before the driver is
added to any existing bus devices.
Philip Paeps [Wed, 21 Oct 2009 23:50:35 +0000 (23:50 +0000)]
Make dhclient use bootpc (68) as the source port for unicast DHCPREQUEST
packets instead of allowing the protocol stack to pick a random source port.
This fixes the behaviour where dhclient would never transition from RENEWING
to BOUND without going through REBINDING in networks which are paranoid about
DHCP spoofing, such as most mainstream cable-broadband ISP networks.
Reviewed by: brooks
Obtained from: OpenBSD (partly - I'm not convinced their solution can work)
MFC after: 1 week (pending re approval)
John Baldwin [Wed, 21 Oct 2009 19:26:12 +0000 (19:26 +0000)]
Change gcc to assume a default machine architecture of 486 instead of 386
on "i386". Doing it in the compiler is deemed to be less fragile then
attempting to provide a default -march setting via bsd.cpu.mk. FreeBSD
itself has not supported plain 386 CPUs since 5.x.
Suggested by: kan
Requested by: rdivacky
MFC after: 1 month
Marcel Moolenaar [Wed, 21 Oct 2009 18:38:02 +0000 (18:38 +0000)]
o Introduce vm_sync_icache() for making the I-cache coherent with
the memory or D-cache, depending on the semantics of the platform.
vm_sync_icache() is basically a wrapper around pmap_sync_icache(),
that translates the vm_map_t argumument to pmap_t.
o Introduce pmap_sync_icache() to all PMAP implementation. For powerpc
it replaces the pmap_page_executable() function, added to solve
the I-cache problem in uiomove_fromphys().
o In proc_rwmem() call vm_sync_icache() when writing to a page that
has execute permissions. This assures that when breakpoints are
written, the I-cache will be coherent and the process will actually
hit the breakpoint.
o This also fixes the Book-E PMAP implementation that was missing
necessary locking while trying to deal with the I-cache coherency
in pmap_enter() (read: mmu_booke_enter_locked).
The key property of this change is that the I-cache is made coherent
*after* writes have been done. Doing it in the PMAP layer when adding
or changing a mapping means that the I-cache is made coherent *before*
any writes happen. The difference is key when the I-cache prefetches.
Ed Schouten [Wed, 21 Oct 2009 18:31:54 +0000 (18:31 +0000)]
Make input parsing in Farhenheit actually work.
Don't clobber *p with '\0' when testing whether it has the value of 'F'.
Just use the semantics of strtof() properly. If it returns p, we know
that it parsed the string until it reached 'C' or 'F'.
The code has not changed since it has been imported (r161951, Sep 3,
2006).
Marcel Moolenaar [Wed, 21 Oct 2009 18:09:48 +0000 (18:09 +0000)]
o Align function on a 32-byte boundary so that the core's front-end
can deliver 2 bundles per cycle to the back-end.
o Mark syscall stubs with a special unwind ABI tag so that unwind
libraries know how to unwind.
Alexander Motin [Wed, 21 Oct 2009 15:27:48 +0000 (15:27 +0000)]
MFp4:
Separate CAM_DEV_IDENTIFY_DATA_VALID flag from CAM_DEV_INQUIRY_DATA_VALID.
Add workaround for very old devices without support for mode setting.
Add some PATA bus scanning support.
Remove some SCSIsms.