rwatson [Sun, 29 Feb 2004 15:32:33 +0000 (15:32 +0000)]
Grab Giant after MAC processing on outgoing packets being sent via
BPF. Grab the BPF descriptor lock before entering MAC since the MAC
Framework references BPF descriptor fields, including the BPF
descriptor label.
scottl [Sun, 29 Feb 2004 09:26:01 +0000 (09:26 +0000)]
All three of these drivers abused cv_waitq_empty in the same way by spinning
on it in hopes of making sure that the waitq was empty before going on.
This wasn't needed and probably never would have worked as intended. Now
that cv_waitq_empty() and friends are gone, the code in these drivers that
spins on it can go away too. This should unbreak LINT.
grehan [Sun, 29 Feb 2004 06:01:16 +0000 (06:01 +0000)]
Bring to working PIO state.
- use correct rid when allocating PCI mem resource
- ATA taskfile registers are indeed spaced 0x10 apart just like
the Macio ATA cell. Adjust offsets in ATA channel struct.
mlaier [Sat, 28 Feb 2004 21:50:50 +0000 (21:50 +0000)]
Add skeleton build dirs for pf userland:
libexec/ftp-proxy - ftp proxy for pf
sbin/pfctl - equivalent to sbin/ipf
sbin/pflogd - deamon logging packets via if_pflog in pcap format
usr.sbin/authpf - authentification shell to modify pf rulesets
Bring along some altq headers used to satisfy pfctl/authpf compile. This
helps to keep the diff down and will make it easy to have a altq-patchset
use the full powers of pf.
Also make sure that the pf headers are installed.
This does not link anything to the build. There will be a NO_PF switch for
make.conf once pf userland is linked.
njl [Sat, 28 Feb 2004 20:40:24 +0000 (20:40 +0000)]
Local change: emulate a ReturnOp if the AML expects one but it isn't
present. Some buggy BIOSs do not have a ReturnOp even though it is
required for a function to return a value.
njl [Sat, 28 Feb 2004 20:39:09 +0000 (20:39 +0000)]
Local change: Allow access to the field if it is within the region
size rounded up to a multiple of the access byte width. This overcomes
"off-by-one" programming errors in the AML often found in Toshiba
laptops.
truckman [Sat, 28 Feb 2004 19:47:02 +0000 (19:47 +0000)]
Create a new mutex type for virtual channels. This allows us to get
rid of the MTX_DUPOK flag on channel mutexes, which allows witness to
do a better job of lock order checking. Nuke snd_chnmtxcreate() since
it is no longer needed.
truckman [Sat, 28 Feb 2004 19:42:48 +0000 (19:42 +0000)]
Lock channels only as necessary in dsp_ioctl(), and only lock one
channel at a time unless it is actually necessary to lock both.
This avoids problems with lock order reversal and malloc() calls
with a mutex held when lower level code unlocks a channel, calls malloc(),
and relocks the channel. This also avoids the cost of some unnecessary
locking and unlocking.
scottl [Sat, 28 Feb 2004 19:14:41 +0000 (19:14 +0000)]
Switch from using mutexes to using semaphores to protect against early
completion of synchronous commands. Also switch to a per-array bioq as it
appears to improve performance.
mlaier [Sat, 28 Feb 2004 17:32:53 +0000 (17:32 +0000)]
Apply diff from the port.
Rather small diff for the userland (in contrast to the kernel):
- Some header file location/differences
- Clean compilation on 64bit arch (identified by bento a long time ago)
- ALTQ not (yet) available. Leave a switch for patchsets and future ...
- most files can be used from the vendor branch
kensmith [Sat, 28 Feb 2004 16:36:14 +0000 (16:36 +0000)]
Previous commit mistakenly delayed cnadd() as well as make_dev().
Testing on cluster ref machine with just delaying make_dev() seems
to work, and results in printf() output appearing sooner in boot
cycle instead of going to /dev/null.
trhodes [Fri, 27 Feb 2004 20:04:38 +0000 (20:04 +0000)]
Update the find manual page:
1: Document -follow under COMPATIBILITY.
2: Update an example to be a little more 'safe'.
3: Use '/' in place of '.' for an example; similar to other manual pages.
PR: 40196 (1), 39532 (2, 3)
Submitted by: Marc Silver <marcs@draenor.org> (2 and 3)
Discussed with: des (1)
rees [Fri, 27 Feb 2004 19:37:43 +0000 (19:37 +0000)]
NFSv4 fixes from Connectathon 2004:
remove unused pid field of file context struct
map nfs4 error codes to errnos
eliminate redundant code from nfs4_request
use zero stateid on setattr that doesn't set file size
use same clientid on all mounts until reboot
invalidate dirty bufs in nfs4_close, to play it safe
open file for writing if truncating and it's not already open
kensmith [Fri, 27 Feb 2004 19:30:46 +0000 (19:30 +0000)]
Fix -current builds on alpha. Recent changes in device handling caused
subtle problems with how alpha was handling the promcons device. This
moves the call to make_dev() for the promcons device to a later point of
the boot-up sequence than where promcons initially gets attached, make_dev()
called during the first attach crashes due to kernel stack issues.
jhb [Fri, 27 Feb 2004 18:52:44 +0000 (18:52 +0000)]
Switch the sleep/wakeup and condition variable implementations to use the
sleep queue interface:
- Sleep queues attempt to merge some of the benefits of both sleep queues
and condition variables. Having sleep qeueus in a hash table avoids
having to allocate a queue head for each wait channel. Thus, struct cv
has shrunk down to just a single char * pointer now. However, the
hash table does not hold threads directly, but queue heads. This means
that once you have located a queue in the hash bucket, you no longer have
to walk the rest of the hash chain looking for threads. Instead, you have
a list of all the threads sleeping on that wait channel.
- Outside of the sleepq code and the sleep/cv code the kernel no longer
differentiates between cv's and sleep/wakeup. For example, calls to
abortsleep() and cv_abort() are replaced with a call to sleepq_abort().
Thus, the TDF_CVWAITQ flag is removed. Also, calls to unsleep() and
cv_waitq_remove() have been replaced with calls to sleepq_remove().
- The sched_sleep() function no longer accepts a priority argument as
sleep's no longer inherently bump the priority. Instead, this is soley
a propery of msleep() which explicitly calls sched_prio() before
blocking.
- The TDF_ONSLEEPQ flag has been dropped as it was never used. The
associated TDF_SET_ONSLEEPQ and TDF_CLR_ON_SLEEPQ macros have also been
dropped and replaced with a single explicit clearing of td_wchan.
TD_SET_ONSLEEPQ() would really have only made sense if it had taken
the wait channel and message as arguments anyway. Now that that only
happens in one place, a macro would be overkill.
jhb [Fri, 27 Feb 2004 18:39:09 +0000 (18:39 +0000)]
Drop sched_lock around the wakeup of the parent process after setting
the process state to zombie when a process exits to avoid a lock order
reversal with the sleepqueue locks. This appears to be the only place
that we call wakeup() with sched_lock held.
jhb [Fri, 27 Feb 2004 18:33:09 +0000 (18:33 +0000)]
Add an implementation of a generic sleep queue abstraction that is used
to queue threads sleeping on a wait channel similar to how turnstiles are
used to queue threads waiting for a lock. This subsystem will be used as
the backend for sleep/wakeup and condition variables initially. Eventually
it will also be used to replace the ithread-specific iwait thread
inhibitor.
Sleep queues are also not locked by sched_lock, so this splits sched_lock
up a bit further increasing concurrency within the scheduler. Sleep queues
also natively support timeouts on sleeps and interruptible sleeps allowing
for the reduction of a lot of duplicated code between the sleep/wakeup and
condition variable implementations. For more details on the sleep queue
implementation, check the comments in sys/sleepqueue.h and
kern/subr_sleepqueue.c.
jhb [Fri, 27 Feb 2004 16:25:05 +0000 (16:25 +0000)]
Fix a few style nits. do { } while(0) are only used for compound
statements and nowhere else in the kernel seems to use them for single
statements. Also, all other users of do { } while(0) use multiple lines
rather than cramming it all onto one line.
pjd [Fri, 27 Feb 2004 15:34:21 +0000 (15:34 +0000)]
Even if we're sure that we can't be orphaned here, we have to define
orphan field - we're enforcing it in GEOM. This will reach KASSERT
in INVARIANTS case.
dds [Fri, 27 Feb 2004 15:03:22 +0000 (15:03 +0000)]
Make consistent with the better written wcsrtombs function:
- Fix syntax
- Remove the (slightly wrong) duplicate explanation of the error condition
- Change reference to invalid multibyte character into invalid wide character
ru [Fri, 27 Feb 2004 14:10:09 +0000 (14:10 +0000)]
For some reason crt0.o needs to be linked first for pxeboot(8) to
work. This is odd because loader(8) doesn't suffer from this problem.
Perhaps pxeboot bootstrap can be fixed to handle this better.
Anyway, PXE booting should work again.
mtm [Fri, 27 Feb 2004 10:44:33 +0000 (10:44 +0000)]
o Add support for detecting a jailed environment. If a script
cannot or does not want to be executed in a jail the
KEYWORDS line should contain the nojail keyword.
o Update Copyright
# I suggest people who use jails more extensively than I do
# make commits to the appropriate files.
mtm [Fri, 27 Feb 2004 10:20:22 +0000 (10:20 +0000)]
NetBSD rev. 1.10
successful [is spelled] with only one l
NetBSD rev. 1.12
Implement ``one'' prefix to allow a "one shot" operation as if
${rcvar}=yes yet all the other prerequisite tests are still performed.
The existing ``force'' prefix is a sledgehammer that ignores all the
prerequisite checks and always returns a zero exit status; this is a
more gentle approach to the problem of "manipulate this disabled
service without editing rc.conf(5)".
mtm [Fri, 27 Feb 2004 09:58:50 +0000 (09:58 +0000)]
NetBSD rev. 1.61
Implement ``one'' prefix to allow a "one shot" operation as if
${rcvar}=yes yet all the other prerequisite tests are still performed.
The existing ``force'' prefix is a sledgehammer that ignores all the
prerequisite checks and always returns a zero exit status; this is a
more gentle approach to the problem of "manipulate this disabled
service without editing rc.conf(5)".
Obtained From: NetBSD
# We have a work-around in our version of rc.subr that
# makes force* return a non-zero exit status if the
# command/service could not be acted upon. The work-around
# is no longer necessary and should be removed.
des [Fri, 27 Feb 2004 08:39:16 +0000 (08:39 +0000)]
Cut through the bikeshed and remove login(1)'s setuid bit. It has no
business trying to impersonate su(1), and it does not need to be setuid
to function properly when invoked by getty(8) or telnetd(8).
kan [Fri, 27 Feb 2004 06:43:14 +0000 (06:43 +0000)]
Look for both name and if_<name> strings in module metadata. Pseudo-devices
like tun are naming their modules using the 'if_; prefix and previous version of
the code failed to detect their presence in the kernel, resulting in the same
module being loaded twice.
kientzle [Thu, 26 Feb 2004 22:41:47 +0000 (22:41 +0000)]
Add a clean_environment call to libutil.
This function removes all environment variables except
the ones listed on a "whitelist."
The function accepts two whitelist arguments.
If the first is NULL, a built-in default list will be
used. This allows callers to get a variety of behaviors:
* Default screening: provide NULL for both lists
* Custom screening: provide a custom list for the first argument
* Modified default screening: provide NULL for first arg,
list of additional variables to preserve in the second arg