Doug Barton [Wed, 4 Jan 2006 19:18:43 +0000 (19:18 +0000)]
After some discussion with the folks at ISC, it turns out that the _ai_pad
part of the structure was a hack to maintain binary compatibility with
Sun binaries, and my understanding is that it's not needed generally
on sparc systems running other operating systems. Therefore, hide this
code behind the same set of tests as in lib/bind/include/netdb.h.
This file is being imported on the vendor branch because a similar change
(or change with similar effect) will be in the next version of BIND 9.
This change will not affect other platforms in any way.
Hartmut Brandt [Wed, 4 Jan 2006 12:57:09 +0000 (12:57 +0000)]
Add a new leaf to the net.link.generic.ifdata.%d sysctl to retrieve
the name and unit number assigned by the driver. This is needed by
SNMP to find interfaces after they have been renamed.
- Make sure the cpu_exthigh variable is initialized (page coloring case). [1]
- Remove a conditional in the AMD cache detection, it's always false. [2]
- Don't try to detect a cache if only compiled for i386.
Analyzed by: Antoine Brodin <antoine.brodin@laposte.net> [1]
Submitted by: Antoine Brodin <antoine.brodin@laposte.net> [2]
Replace tv_usec normalization with the return of EINVAL.
This addresses two objections to the previous behavior,
and unbreaks the alpha tinderbox build.
Normalize the tv_usec part of the utimes(2) arguments to ensure
that a file's atime and mtime are only set to correct fractional
second values (0-999999000ns with the current interface).
Prior to this change users could create files with values outside
that range. Moreover, on 32-bit machines tv_usec offsets larger than
4.3s would result in an unnormalized AND wrong timestamp value,
due to overflow.
John Baldwin [Tue, 3 Jan 2006 20:39:38 +0000 (20:39 +0000)]
Fix a couple of issues with the ibcs2 module event handler. First, return
success instead of EOPNOTSUPP when being loaded. Secondly, if there are no
ibcs2 processes running when a MOD_UNLOAD request is made, break out to
return success instead of falling through into the default case which
returns EOPNOTSUPP. With these fixes, I can now kldload and subsequently
kldunload the ibcs2 module.
PR: kern/82026 (and several duplicates)
Reported by: lots of folks
MFC after: 1 week
Brian Somers [Tue, 3 Jan 2006 17:01:43 +0000 (17:01 +0000)]
This signal handling code is worse than a no-op. If a
signal is received during the msleep, the msleep is retried
indefinitely as it just keeps returning ERESTART because of
the pending signal.
John Baldwin [Tue, 3 Jan 2006 17:00:38 +0000 (17:00 +0000)]
- Don't list sleep() in the NAME section as we haven't had a sleep()
function in years.
- Change the 'ident' paramters to 'wchan' to match <sys/systm.h>.
- Use 'otherwise' in place of 'else' in one place so that this reads like
English rather than C.
- Document the new msleep_spin() function.
- Add history notes for msleep() and msleep_spin().
Brian Somers [Tue, 3 Jan 2006 15:34:27 +0000 (15:34 +0000)]
For the ``#ifdef NOTYET'' code that allows calling non-async-safe
functions in the child after a fork() from a threaded process,
use __sys_setprocmask() rather than setprocmask() to keep our
signal handling sane. Without this fix, signals are essentially
ignored in said child and things such as protection violations
result in an endless busy loop.
Robert Watson [Tue, 3 Jan 2006 14:00:22 +0000 (14:00 +0000)]
Back out VFS_LOCK_GIANT.9:1.4, due to losing a race in change/update
against revision 1.3. No need to include mount.h twice, once will be
quite enough.
Brian Somers [Tue, 3 Jan 2006 09:17:04 +0000 (09:17 +0000)]
Fix the other su bug reintroduced two commits ago, namely
$ su
% kill -STOP $$
where su is executing (t)csh. csh's job handling is a little more
special than that of (a)sh, bash and even zsh and blows up a little
more spectacularly. This modification restores the original mucking
about with the tty pgrp, but is careful to only do it when su (or
su's child) is the foreground process.
While I'm here, fix a STDERR_FILENO spelling as suggested by bde.
Pyun YongHyeon [Tue, 3 Jan 2006 06:14:07 +0000 (06:14 +0000)]
- Tx side bus_dmamap_load_mbuf_sg(9) support. This reduces bookkeeping
requiried to keep consistent softc state before/after callback function
invocation and supposed to be sligntly faster than previous one as it
wouldn't incur callback overhead. With this change callback function
was gone.
- Decrease TI_MAXTXSEGS to 32 from 128. It seems that most mbuf chain
length is less than 32 and it would be re-packed with m_defrag(9) if
its chain length is larger than TI_MAXTXSEGS. This would protect ti(4)
against possible kernel stack overflow when txsegs[] is put on stack.
Alternatively, we can embed the txsegs[] into softc. However, that
would waste memory and make Tx/Rx speration hard when we want to
sperate Tx/Rx handlers to optimize locking.
- Fix dma map tracking used in Tx path. Previously it used the dma map
of the last mbuf chain in ti_txeof() which was incorrect as ti(4)
used dma map of the first mbuf chain when it loads a mbuf chain with
bus_dmamap_load_mbuf(9). Correct the bug by introducing queues that
keep track of active/inactive dma maps/mbuf chain.
- Use ti_txcnt to check whether driver need to set watchdog timer instead
of blidnly clearing the timer in ti_txeof().
- Remove the 3rd arg. of ti_encap(). Since ti(4) now caches the last
descriptor index(ti_tx_saved_prodidx) used in Tx there is no need to
pass it as a fuction arg.
- Change data type of producer/consumer index to int from u_int16_t in
order to remove implicit type conversions in Tx/Rx handlers.
- Check interface queue before getting a mbuf chain to reduce locking
overhead.
- Check number of available Tx descriptores to be 16 or higher in
ti_start(). This wouldn't protect Tx descriptor shortage but it would
reduce number of bus_dmamap_unload(9) calls in ti_encap() when we are
about to running out of Tx descriptors.
- Command NIC to send packets ony when the driver really has packets
enqueued. Previously it always set TI_MB_SENDPROD_IDX which would
command NIC to DMA Tx descriptors into NIC local memory regardless
of Tx descriptor changes.
Sam Leffler [Mon, 2 Jan 2006 17:16:27 +0000 (17:16 +0000)]
enable "aggressive mode" only when operating in ap or station mode; in
particular this fixes use of wme in adhoc demo mode, it wasn't possible
to set the txop limit because the aggressive mode logic would override
Doug Rabson [Mon, 2 Jan 2006 11:28:42 +0000 (11:28 +0000)]
Fix the amd64 (and presumably ia64) lib32 build by ensuring that the
heimdal GSS-API mechanism uses its own version of gssapi.h, including all
the implementation-dependant pollution contained therein.
Brian Somers [Mon, 2 Jan 2006 08:51:21 +0000 (08:51 +0000)]
Remove broken code that mucks about with tcsetpgrp() -- even if
su isn't the foreground process. Hopefully this won't break PAM,
but I couldn't find any useful information about ache's theory
that it will.
Specifically, this change fixes the following:
# sh
# echo $$
# su - root -c id &
# echo $$
The PID output changes as su seems to be kill -STOP'ing itself
and catching the parent shell in the process. This is especially
bad if you add a ``su - user -c command &'' to an rc script!
Sponsored by: Sophos/Activestate
Not objected to by: des
Brian Somers [Mon, 2 Jan 2006 08:36:25 +0000 (08:36 +0000)]
Add a -s flag for the same functionality as strace. Introduce a Name
type which is a String type that has no -s limitations applied to it.
Change most Strings in the code to Names and add a few extra syscalls,
namely munmap, read, rename and symlink. This was enough to facilitate
following file descriptor allocations in the code more easily and
getting a hint at what's being read/written from/to files. More
syscalls should really be added.
While here, fix an off-by-one bug in the buffer truncation code and
add a fflush so that truss's output reflects the syscall that the
program is stuck in.
Dima Dorfman [Mon, 2 Jan 2006 01:50:30 +0000 (01:50 +0000)]
Add a -P option to allow skipping newfs when using a vnode-backed
disk. Apparently some people want to use mdmfs as mount_* as a
shortcut for mounting existing file-based file systems.
Note that unlike in the patches from the submitters, this option is
not available in compat mode. Compat mode was supposed to support only
things that mount_mfs used to support. To use this option from fstab,
mdmfs should be called mount_md, not mount_mfs. This distinction has
not always upkept for new options, and those can't be fixed now
without breaking people's systems, but new options should not usually
be allowed in compat mode. (Not sure why -F is allowed there at all.)
PR: 57641
Submitted by: Ruben de Groot
Submitted independently by: Wojciech A. Koszek, for Urzad Miasta Czestochowa
Warner Losh [Sun, 1 Jan 2006 20:59:28 +0000 (20:59 +0000)]
Define __HAVE_ACPI and/or __PCI_REROUTE_INTERRUPT, as appropriate for
each platform. These will be used in the pci code in preference to
the complicated #ifdefs we have there now.
Warner Losh [Sun, 1 Jan 2006 20:40:08 +0000 (20:40 +0000)]
Remove left-over #ifdef alpha routines. They aren't used by any of
our drivers, and don't appear to be necessary for GENERIC and LINT on
the alpha. They don't belong in a MI header anyway...
Ariff Abdullah [Sun, 1 Jan 2006 20:19:49 +0000 (20:19 +0000)]
- Fix possible memory leak due to repetetive strdup(3) without matching
free(3).
- print_recsrc() should honor shortflag and give appropriate output for
later consumption by /etc/rc.d/mixer. This will ensure that recording
device selections survived across reboot. Output everything to stdout
instead if stderr.
Doug Rabson [Sun, 1 Jan 2006 11:01:01 +0000 (11:01 +0000)]
Use the correct shared-library version number (the same as the one used
by the standalone version of heimdal GSS-API). If any compat issues
arise, I may increment the version number once more.
Warner Losh [Sat, 31 Dec 2005 17:58:28 +0000 (17:58 +0000)]
It is next year in Asia already, so jump the gun a little and commit
the year bump.
# If we behaved like book publishers, we'd do this in July. I can't find
# a good reference for why they do it then, but it has been explained to
# me that copyrights in the last 1/2 of the year expire as if they were
# published in the following year. I can't confirm this info, but if you
# have a pointer, please send it to me.
MI changes:
- provide an interface (macros) to the page coloring part of the VM system,
this allows to try different coloring algorithms without the need to
touch every file [1]
- make the page queue tuning values readable: sysctl vm.stats.pagequeue
- autotuning of the page coloring values based upon the cache size instead
of options in the kernel config (disabling of the page coloring as a
kernel option is still possible)
MD changes:
- detection of the cache size: only IA32 and AMD64 (untested) contains
cache size detection code, every other arch just comes with a dummy
function (this results in the use of default values like it was the
case without the autotuning of the page coloring)
- print some more info on Intel CPU's (like we do on AMD and Transmeta
CPU's)
Note to AMD owners (IA32 and AMD64): please run "sysctl vm.stats.pagequeue"
and report if the cache* values are zero (= bug in the cache detection code)
or not.
Based upon work by: Chad David <davidc@acns.ab.ca> [1]
Reviewed by: alc, arch (in 2004)
Discussed with: alc, Chad David, arch (in 2004)
Juli Mallett [Sat, 31 Dec 2005 09:06:45 +0000 (09:06 +0000)]
Check the entire length of the current argument for the EOF string with -E,
but don't expect a proper ASCII string to exist right here right now, don't
use strcmp(3) which checks for a NUL. As we're still building the argument
up, the next character might be garbage. It would probably be just as safe to
temporarily write a NUL there, but if we've reached the end of argument memory
that might not be the best idea, I think. It's unclear.
Doing it this way seems to meet the most with the original intent.
If non-zero, all network interfaces be created with the label:
biba/equal(equal-equal)
This is useful where programs which initialize network interfaces
do not have any labeling support. This includes dhclient and ppp. A
long term solution is to add labeling support into dhclient(8)
and ppp(8), and remove this variable.
It should be noted that this behavior is different then setting the:
security.mac.biba.trust_all_interfaces
sysctl variable, as this will create interfaces with a biba/high label.
Lower integrity processes are not able to write to the interface in this
event. The security.mac.biba.interfaces_equal will override
trust_all_interfaces.
The security.mac.biba.interfaces_equal variable will be set to zero
or disabled by default.
Maxime Henrion [Sat, 31 Dec 2005 04:41:17 +0000 (04:41 +0000)]
Add a new vendor ID for Personal Cummunication Systems. They make a nice
USB HID device that allows to plug two PS2 controllers. This specific
device doesn't work yet but will as soon as we support devices with
multiple report IDs.
Maxime Henrion [Sat, 31 Dec 2005 04:38:50 +0000 (04:38 +0000)]
Add support for the Wacom Graphire 3 4x5. Like the Graphire 3, it has a
broken report descriptor. While I'm here, make all the other report
descriptors const to match the newly added one.
Maxime Henrion [Sat, 31 Dec 2005 04:22:34 +0000 (04:22 +0000)]
Add support for Xbox 360 gamepads. They are HID-capable devices, but
lack a report descriptor and don't use the standard interface class.
This patch works around these deficiencies so that the uhid(4) driver
can recognize and use those broken devices.
PR: usb/90141
Submitted by: Ed Schouten <ed@fxq.nl> (with minor mods from me)
MFC after: 1 week
Ian Dowse [Sat, 31 Dec 2005 03:53:02 +0000 (03:53 +0000)]
Add basic documentation for many of the kernel USB functions that
USB device drivers use to talk to USB devices. This is probably
still a bit rough and it does not yet include the functions specific
to HID, ethernet, hubs, host controller drivers, task threads or
debugging.
Ceri Davies [Fri, 30 Dec 2005 21:45:10 +0000 (21:45 +0000)]
On i386, 7.0 requires 106MB on /usr. 6.0 requires 101MB.
Bump USR_MIN_SIZE to 128MB, so that an auto-layout install won't fail
due to /usr being too small.
mkstemp(3) and friends use a combination of base 10 digits, along
with upper and lower case letters from the English alphabet. Change
the number of possible file names mktemp will return from 26**6
to (10+26+26)**6 instead. This keeps things consistent with mkstemp(3)
Warner Losh [Fri, 30 Dec 2005 19:28:26 +0000 (19:28 +0000)]
Expose pci_add_resources to the outside world, add a 'force' flag to
force allocation of unallocated BARs (cardbus uses this to preallocate
everything). Add a prefetchmask to allow for busses that get prefetch
hints to set them. Addjust pci_add_map and pci_ata_maps to take a new
force flag which pci_add_resources will pass in. Implement 'force' in
pci_add_map. Write new value of allocated resource into the bar, if
the allocation succeeded (we should have done this before, but with
the new force the bug was very obvious).