Bruce Evans [Thu, 4 Mar 2004 11:20:02 +0000 (11:20 +0000)]
Don't manually optimize for 20 year old compilers by casting to u_int
to get a free check for negative ints. Rev.1.35 got my request to
remove the cast mostly backwards.
Bruce Evans [Thu, 4 Mar 2004 10:56:29 +0000 (10:56 +0000)]
Fixed insertion sort errors in includes and prototypes. This was more
than a style bug for the includes -- queue.h is a prerequisite for
_lock.h and _mutex.h but was included after them.
Removed bogus prototype for fget_locked(). The prototype was originally
needed to support K&R but was bogotified by converting the function header
to new-style.
Mike Makonnen [Thu, 4 Mar 2004 08:25:53 +0000 (08:25 +0000)]
Document the virecover_enable knob.
From the PR:
Certain MTA configurations mean that the notifications from
virecover keep bouncing; so here's a patch to allow administrators
to turn them off.
Nate Lawson [Thu, 4 Mar 2004 05:58:50 +0000 (05:58 +0000)]
Fix an off-by-one error and rework our EC space handler. Writing to address
0xFF would fail previously as AE_BAD_PARAMETER. It's unknown if this caused
any actual problems.
Nate Lawson [Thu, 4 Mar 2004 05:57:41 +0000 (05:57 +0000)]
Part 2 of Project Evil: Pretend to be Windows 2000 for buggy ASL that
always expects to be running on some MS OS. A survey of ASL shows that
this is the 2nd most common expected OS value. (1st is Win98 and we don't
emulate its buggy ACPI support.) Our ACPI support is similar to Win2k,
also. Put this behavior under ACPICA_PEDANTIC so we can get back to our
previous behavior for OSV testing.
Nate Lawson [Thu, 4 Mar 2004 05:17:52 +0000 (05:17 +0000)]
Don't disable Cx support and throttling on machines with a P_BLK_LEN != 6
even though the spec mandates this. Some have a value of 5 to indicate
throttling + C2 and some have 7 to indicate an extra C3 state. Support
throttling if the value is >= 4, C2 for >= 5, and C3 for >= 6.
Nate Lawson [Thu, 4 Mar 2004 04:42:59 +0000 (04:42 +0000)]
Add a "quirks" value to disable quirks handling for a given boot.
Also, disable quirks if booting with a custom DSDT. Add a quirk
to disable loading ACPI so known bad systems can be completely
blacklisted.
Bruce M Simpson [Thu, 4 Mar 2004 04:42:52 +0000 (04:42 +0000)]
Add a new option to mountd(8), -p <port>. This allows the user to specify
a known port for use in firewall rulesets; otherwise the port is chosen
at run-time by bindresvport().
Bill Paul [Thu, 4 Mar 2004 00:17:14 +0000 (00:17 +0000)]
Add sanity checks to the ndis_packet and ndis_buffer pool handling
routines to guard against problems caused by (possibly) buggy drivers.
The RealTek 8180 wireless driver calls NdisFreeBuffer() to release
some of its buffers _after_ it's already called NdisFreeBufferPool()
to destroy the pool to which the buffers belong. In our implementation,
this error causes NdisFreeBuffer() to touch stale heap memory.
If you are running a release kernel, and hence have INVARIANTS et al
turned off, it turns out nothing happens. But if you're using a
development kernel config with INVARIANTS on, the malloc()/free()
sanity checks will scribble over the pool memory with 0xdeadc0de
once it's released so that any attempts to touch it will cause a
trap, and indeed this is what happens. It happens that I run 5.2-RELEASE
on my laptop, so when I tested the rtl8180.sys driver, it worked fine
for me, but people trying to run it with development systems checked
out or cvsupped from -current would get a page fault on driver load.
I can't find any reason why the NDISulator would cause the RealTek
driver to do the NdisFreeBufferPool() prematurely, and the same driver
obviously works with Windows -- or at least, it doesn't cause a crash:
the Microsoft documentation for NdisFreeBufferPool() says that failing
to return all buffers to the pool before calling NdisFreeBufferPool()
causes a memory leak.
I've written to my contacts at RealTek asking them to check if this
is indeed a bug in their driver. In the meantime, these new sanity checks
will catch this problem and issue a warning rather than causing a trap.
The trick is to keep a count of outstanding buffers for each buffer pool,
and if the driver tries to call NdisFreeBufferPool() while there are still
buffers outstanding, we mark the pool for deletion and then defer
destroying it until after the last buffer has been reclaimed.
[this is just a forced commit to say:] The time_t-specific safety measure
added by the sparc64_installcheck target is mostly from Marcel, although
it includes some adjustments of my own...
(that should be: "assuming NO major problems are found", of course...)
Also note that these three files are intended to be short-term aids for
making this specific transition. They will probably disappear after
5.3-release (although the installworld_*k scripts do include some
general-purpose ideas that we might want to consider at a later date).
Commit the first set of files for changing time_t on freebsd/sparc64
from a 32-bit value to a 64-bit value. This commit does not actually
change anything. It merely provides instructions, scripts, and a safety
measure in Makefile.inc1 for people who want to make the change.
The real change to 64-bit time_t's on sparc64 is scheduled to happen
on March 10th, assuming that so major problems are found between now
and then by early-adopters.
Mike Makonnen [Wed, 3 Mar 2004 15:28:44 +0000 (15:28 +0000)]
Some (most?) processes don't cleanup their pid files when
they exit. Sometimes they simply can't (core-dump, for example).
So, when searching for a running program send standard error
output from ps(1) to never-never land.
# This should quite those
# ps: kvm_getprocs: No such user
# errors. Since ports use a duplicate rc.subr(8) you might
# still see this error from ports startup scripts.
Mike Makonnen [Wed, 3 Mar 2004 15:21:01 +0000 (15:21 +0000)]
From the PR:
Certain MTA configurations mean that the notifications from
virecover keep bouncing; so here's a patch to allow administrators
to turn them off.
PR: conf/54910
Submitted by: bms (with a minor cleanup)
mga_state & r128_state need an inline-limit larger than amd64's default
in order to compile. AMD64's default could be reduced below 8k, if
dev/aic7xxx/aic79xx.c got this same treatment.
Peter prefers it this way, bde might also[*]. I just want to have a chance
of working on amd64 for vmware use.
[*] bde will probably not like either version...
Nate Lawson [Wed, 3 Mar 2004 03:02:17 +0000 (03:02 +0000)]
Add support for quirks for acpi tables. Key off OEM vendor and revision.
Sort acpi debug values. Change "disable" to "disabled" to match rest of
the kernel. Remove debugging from acpi_toshiba since it was only used for
probe/attach.
Fix a couple of camcontrol issues that popped up on sparc64:
- bzero the CCB header in getdevtree() and set the path properly, to
avoid having random garbage in the CCB header.
- if the lun isn't specified in a device specifier, it should default to
0, not whatever random data happens to be in the lun variable.
- move the prototype for getdevtree() out from under #ifndef MINIMALISTIC,
since it is used in both cases.
Submitted by: Marius Strobl <marius@alchemy.franken.de> (mostly)
MFC After: 2 weeks
Colin Percival [Wed, 3 Mar 2004 00:45:30 +0000 (00:45 +0000)]
Forced commit to note that files have been repocopied from
src/sbin/nologin to src/usr.sbin/nologin in preparation for
moving nologin(8) from /sbin to /usr/sbin.
If handed a file pointer we can't write to, set errno properly to EBADF
in order to get SUSv2 conformant behavior in higher level calls like
fputs() and puts().
Roman Kurakin [Tue, 2 Mar 2004 16:39:40 +0000 (16:39 +0000)]
1. Renames NCT constant to NCTAU. This will help while MFC to 4 branch.
2. Fix compilation and panic while system boot problem after makedev
was changed to unde2dev.
John Baldwin [Tue, 2 Mar 2004 14:58:33 +0000 (14:58 +0000)]
Correct handling of PDROP in msleep() to just skip the mtx_lock() rather
than clear the lock pointer so that sleepq_add() still gets the correct
lock pointer and doesn't bogusly trip an assertion.
Max Laier [Tue, 2 Mar 2004 14:37:23 +0000 (14:37 +0000)]
Two minor follow-ups on the MT_TAG removal:
ifp is now passed explicitly to ether_demux; no need to look it up again.
Make mtag a global var in ip_input.
Alan Cox [Tue, 2 Mar 2004 08:25:58 +0000 (08:25 +0000)]
Modify contigmalloc1() so that the free page queues lock is not held when
vm_page_free() is called. The problem with holding this lock is that it is
a spin lock and vm_page_free() may attempt the acquisition of a different
default-type lock.
Peter Grehan [Tue, 2 Mar 2004 06:49:21 +0000 (06:49 +0000)]
Increase kernel VA from 256Mb to 512Mb by shifting the segment used
for user copyinout down to 12, and keeping segments 13/14 for
kernel VA.
It would be nice to have more available, but segments lower than
this are reserved for either memory or 1:1 mapped device i/o,
and seg 15 is OpenFirmware ROM. Also, the effort to keep OpenFirmware
available for callbacks limits the use of VA-mapped segments.
Fortunately UMA_MD_SMALL_ALLOC takes away a lot of VM pressure.