]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
20 years agoooops. I disabled pci_enable_io_modes not pci_do_powerstate in the last
Warner Losh [Fri, 16 Apr 2004 15:01:54 +0000 (15:01 +0000)]
ooops.  I disabled pci_enable_io_modes not pci_do_powerstate in the last
commit.  That was in error.

Noticed by: sos

20 years agoAt some point during the history of m_getcl(), MAC support began to
Robert Watson [Fri, 16 Apr 2004 14:35:11 +0000 (14:35 +0000)]
At some point during the history of m_getcl(), MAC support began to
unconditionally initialize the mbuf header even if cluster allocation
failed, which could result in a NULL pointer dereference in low-memory
conditions.

PR: kern/65548
Submitted by: Stephan Uphoff <ups@tree.com>

20 years agoUse if_link instead of the alias if_list, and change a for() into
Luigi Rizzo [Fri, 16 Apr 2004 10:32:13 +0000 (10:32 +0000)]
Use if_link instead of the alias if_list, and change a for() into
the TAILQ_FOREACH() form.

Comment the need to store the same info (mac address for ethernet-type
devices) in two different places.

No functional changes. Even the compiler output should be unmodified
by this change.

20 years agoDocumented the intended usage of if_addrhead and ifaddr_byindex()
Luigi Rizzo [Fri, 16 Apr 2004 10:28:54 +0000 (10:28 +0000)]
Documented the intended usage of if_addrhead and ifaddr_byindex()
This commit only changes comments. Nothing to recompile.

20 years agoo split a sentence to make it more understandable
Christian Brueffer [Fri, 16 Apr 2004 09:31:17 +0000 (09:31 +0000)]
o split a sentence to make it more understandable
o mention that the acctfile has to exist for accton to work [1]
o add reference to acct.5

PR:             65071 [1] (slightly modified)
Submitted by:   Marc Silver <marcs@draenor.org>
X-MFC after: re approval

20 years agoImprove comment (SMB bus -> System Management Bus)
Eivind Eklund [Fri, 16 Apr 2004 09:29:45 +0000 (09:29 +0000)]
Improve comment (SMB bus -> System Management Bus)

20 years agoConsistently use ifaddr_byindex() to access the link-level address
Luigi Rizzo [Fri, 16 Apr 2004 08:15:37 +0000 (08:15 +0000)]
Consistently use ifaddr_byindex() to access the link-level address
of an interface. No functional change.

On passing, comment an useless invocation of TAILQ_INIT(&ifp->if_addrhead)
which could probably be removed in the interest of clarity.

20 years agoConsistently use ifaddr_byindex() to access the link-level address
Luigi Rizzo [Fri, 16 Apr 2004 08:14:34 +0000 (08:14 +0000)]
Consistently use ifaddr_byindex() to access the link-level address
of an interface. No functional change.

On passing, comment a likely bug in net/rtsock.c:sysctl_ifmalist()
which, if confirmed, would deserve to be fixed and MFC'ed

20 years agoRemoved local bits that are now part of the standard mdoc(7) package.
Ruslan Ermilov [Fri, 16 Apr 2004 07:19:13 +0000 (07:19 +0000)]
Removed local bits that are now part of the standard mdoc(7) package.

20 years agoPull up latest mdoc(7) changes:
Ruslan Ermilov [Fri, 16 Apr 2004 07:08:33 +0000 (07:08 +0000)]
Pull up latest mdoc(7) changes:

: 2004-04-14  Thomas Klausner <wiz@netbsd.org>
:
:  * tmac/doc-common (doc-volume-as-*): Use lowercase names.
:  (doc-operating-system-*): Updated.
:  * tmac/doc-syms (doc-str-St-*): Various small fixes.
:  (doc-str-Lb-*): Add more library names.

20 years agoRemove two variables that became unused because of last commit.
Luigi Rizzo [Fri, 16 Apr 2004 06:58:39 +0000 (06:58 +0000)]
Remove two variables that became unused because of last commit.

Reported by: tinderbox

20 years agoMake whatis(1) happy.
Ruslan Ermilov [Fri, 16 Apr 2004 06:26:09 +0000 (06:26 +0000)]
Make whatis(1) happy.

20 years agoMove ENABLE_ALART to proper place.
David E. O'Brien [Fri, 16 Apr 2004 05:59:08 +0000 (05:59 +0000)]
Move ENABLE_ALART to proper place.

Submitted by: bde

20 years agoFix building on L64 machines.
David E. O'Brien [Fri, 16 Apr 2004 05:34:14 +0000 (05:34 +0000)]
Fix building on L64 machines.

20 years agoAdd support for the ADMtek AN8513 USB Ethernet adapter.
David E. O'Brien [Fri, 16 Apr 2004 05:24:45 +0000 (05:24 +0000)]
Add support for the ADMtek AN8513 USB Ethernet adapter.

Submitted by: taxman <taxman@freedombi.com>

20 years agoCorrect $FreeBSD$ style.
David E. O'Brien [Fri, 16 Apr 2004 05:22:11 +0000 (05:22 +0000)]
Correct $FreeBSD$ style.

20 years agomake the bad bar warning less scary, and toss it behind a bootverbose.
Warner Losh [Fri, 16 Apr 2004 04:53:19 +0000 (04:53 +0000)]
make the bad bar warning less scary, and toss it behind a bootverbose.
It is harmless, but freaking people out.

20 years agoTurn off the power stuff for a little while longer. There appears to be
Warner Losh [Fri, 16 Apr 2004 04:50:54 +0000 (04:50 +0000)]
Turn off the power stuff for a little while longer.  There appears to be
something subtle wrong with it.

20 years agoForced commit to acknowledge Julian Elischer as the source of the previous fix.
Tim Kientzle [Fri, 16 Apr 2004 03:51:37 +0000 (03:51 +0000)]
Forced commit to acknowledge Julian Elischer as the source of the previous fix.

20 years ago--help is only supported if you have getopt_long().
Tim Kientzle [Fri, 16 Apr 2004 03:50:04 +0000 (03:50 +0000)]
--help is only supported if you have getopt_long().
This allows bsdtar to compile on FreeBSD 4.x.

20 years agoSet the "global" attribute on the page table entries for the kernel and
Alan Cox [Fri, 16 Apr 2004 03:45:28 +0000 (03:45 +0000)]
Set the "global" attribute on the page table entries for the kernel and
direct mappings.  This shaves a few seconds off of my buildworld times.

Discussed with: peter@

20 years agoOnly enable the ACL restore logic on FreeBSD versions >= 5.0.
Tim Kientzle [Fri, 16 Apr 2004 01:20:58 +0000 (01:20 +0000)]
Only enable the ACL restore logic on FreeBSD versions >= 5.0.
Earlier versions of FreeBSD don't support ACLs.

Note that the ACL support code in archive_entry is standalone code and
unaffected by this.  (In particular, it should be possible to
manipulate archives containing ACLs even if the ACLs cannot be
restored on the current system.)

20 years ago- Use memory barrier with atomic operations in ntoskrnl_lock_dpc() and
Bill Paul [Fri, 16 Apr 2004 00:04:28 +0000 (00:04 +0000)]
- Use memory barrier with atomic operations in ntoskrnl_lock_dpc() and
  ntoskrnl_unlocl_dpc().
- hal_raise_irql(), hal_lower_irql() and hal_irql() didn't work right
  on SMP (priority inheritance makes things... interesting). For now,
  use only two states: DISPATCH_LEVEL (PI_REALTIME) and PASSIVE_LEVEL
  (everything else). Tested on a dual PIII box.
- Use ndis_thsuspend() in ndis_sleep() instead of tsleep(). (I added
  ndis_thsuspend() and ndis_thresume() to replace kthread_suspend()
  and kthread_resume(); the former will preserve a thread's priority
  when it wakes up, the latter will not.)
- Change use of tsleep() in ndis_stop_thread() to prevent priority
  change on wakeup.

20 years agoAs suggested by Julian Elischer, use a self-sizing hash
Tim Kientzle [Thu, 15 Apr 2004 22:37:54 +0000 (22:37 +0000)]
As suggested by Julian Elischer, use a self-sizing hash
table for the hardlink cache.  This dramatically improves
performance when archiving millions of hardlinked files.

While I'm here, clean up some style bugs (per Bruce Evans)
and clarify some comments.

20 years agoRemove improper use of if_addrhead in device drivers to check
Luigi Rizzo [Thu, 15 Apr 2004 20:31:10 +0000 (20:31 +0000)]
Remove improper use of if_addrhead in device drivers to check
if the link-level address has been initialized already.

The majority of modern drivers never does this and works fine, which
makes me think that the check is totally unnecessary and a residue
of cut&paste from other drivers.

This change is done to simplify locking because now almost none of the
drivers uses this field. The exceptions are "ct" "ctau" and "cx"
where i am not sure if i can remove that part.

20 years agoDocument the way if_addrhead and struct ifaddr are used.
Luigi Rizzo [Thu, 15 Apr 2004 19:45:59 +0000 (19:45 +0000)]
Document the way if_addrhead and struct ifaddr are used.
Remove a member from 'struct ifaddr' which has been in an
#ifdef notdef block since rev 1.1

No ABI changes -- no need to recompile anything.

20 years agoWhitespace nit in previous revision.
Ruslan Ermilov [Thu, 15 Apr 2004 19:13:27 +0000 (19:13 +0000)]
Whitespace nit in previous revision.

20 years agoIf IF_HANDOFF() or netisr_queue() fail, they will free the mbuf. When
Robert Watson [Thu, 15 Apr 2004 19:11:34 +0000 (19:11 +0000)]
If IF_HANDOFF() or netisr_queue() fail, they will free the mbuf.  When
this happens, set (m) to NULL or we'll try to free it a second time on
return.

Submitted by: Pavel Gulchouck <gul@gul.kiev.ua>

20 years agoRemove bogus checks on the value of ${entropy_file} and hardcode out
Brooks Davis [Thu, 15 Apr 2004 18:23:14 +0000 (18:23 +0000)]
Remove bogus checks on the value of ${entropy_file} and hardcode out
entropy source to /entropy.  We have to assume there is no rc.conf at
this stage of the boot process.

Reported by: njl

20 years agoBand-aid diskless booting by running a new preseedrandom script before
Brooks Davis [Thu, 15 Apr 2004 17:52:53 +0000 (17:52 +0000)]
Band-aid diskless booting by running a new preseedrandom script before
initdiskless.  The output of several commands and if available the
contents of /entropy are feed into /dev/random to kickstart the PRNG.
/etc/rc.d/initrandom is left alone to maintain the previous behavior as
much as possiable.

Further work in this area is probably needed.

Discussed with: markm

20 years agouse %zu instead of %zd
Jim Rees [Thu, 15 Apr 2004 16:12:12 +0000 (16:12 +0000)]
use %zu instead of %zd

Requested by: Bruce Evans

20 years agoAdd note that npx depends on isa.
Josef El-Rayes [Thu, 15 Apr 2004 15:11:04 +0000 (15:11 +0000)]
Add note that npx depends on isa.

Approved by: green

20 years agos/atspeaker/speaker/
Colin Percival [Thu, 15 Apr 2004 12:12:15 +0000 (12:12 +0000)]
s/atspeaker/speaker/
cf. revision 1.2 of src/sys/modules/speaker/Makefile

PR: conf/65195
Submitted by: daichi

20 years agoInstall the MIBs and the definition file to the new location under
Hartmut Brandt [Thu, 15 Apr 2004 08:56:06 +0000 (08:56 +0000)]
Install the MIBs and the definition file to the new location under
/usr/share/snmp.

Noted by: bmah

20 years agoEnsure that the poll_burst <= poll_burst_max constraint really holds.
Ruslan Ermilov [Thu, 15 Apr 2004 07:38:44 +0000 (07:38 +0000)]
Ensure that the poll_burst <= poll_burst_max constraint really holds.

Reviewed by: luigi

20 years agoDo a style fixup on the example function.
Mark Murray [Thu, 15 Apr 2004 07:24:10 +0000 (07:24 +0000)]
Do a style fixup on the example function.

20 years agoUpdate bmake glue for cvs-1.11.15, with apologies to Jacques for messing
Peter Wemm [Thu, 15 Apr 2004 01:54:28 +0000 (01:54 +0000)]
Update bmake glue for cvs-1.11.15, with apologies to Jacques for messing
up his day.  The *.patch files are still fine for MFC'ing.

20 years agoChange WriteTemplate to take const char * args.
Peter Wemm [Thu, 15 Apr 2004 01:41:05 +0000 (01:41 +0000)]
Change WriteTemplate to take const char * args.
The Name_Root() call seems to be defunct, remove it because it was
causing compile problems.  The real magic seems to be in the Parse_Info()
callback (which was also updated for const char * args).

20 years agoFix merge typo. Add missing ",".
Peter Wemm [Thu, 15 Apr 2004 01:31:28 +0000 (01:31 +0000)]
Fix merge typo. Add missing ",".

20 years agoThis commit was generated by cvs2svn to compensate for changes in r128270,
Peter Wemm [Thu, 15 Apr 2004 01:19:11 +0000 (01:19 +0000)]
This commit was generated by cvs2svn to compensate for changes in r128270,
which included commits to RCS files with non-trunk default branches.

20 years agoInitial merge of cvs-1.11.5 -> 1.11.15 changes onto mainline
Peter Wemm [Thu, 15 Apr 2004 01:17:28 +0000 (01:17 +0000)]
Initial merge of cvs-1.11.5 -> 1.11.15 changes onto mainline

20 years agoThis commit was generated by cvs2svn to compensate for changes in r128266,
Peter Wemm [Thu, 15 Apr 2004 01:01:56 +0000 (01:01 +0000)]
This commit was generated by cvs2svn to compensate for changes in r128266,
which included commits to RCS files with non-trunk default branches.

20 years agoImport cvs-1.11.15
Peter Wemm [Thu, 15 Apr 2004 01:01:56 +0000 (01:01 +0000)]
Import cvs-1.11.15

20 years agoTurn off cvs build for a few hours while importing.
Peter Wemm [Thu, 15 Apr 2004 01:01:07 +0000 (01:01 +0000)]
Turn off cvs build for a few hours while importing.

20 years agoTurn on the amd64-specific bignum code in openssl. This is actually
Peter Wemm [Wed, 14 Apr 2004 23:26:26 +0000 (23:26 +0000)]
Turn on the amd64-specific bignum code in openssl.  This is actually
a variant of the C code but with some scattered asm and things laid out
more optimally for the platform.  This means that we need to the asm
directory to the search path for the amd64 case so that make can find
the source.

20 years agoLet the NFS client notice a file's size changing as a modification.
Peter Edwards [Wed, 14 Apr 2004 23:23:55 +0000 (23:23 +0000)]
Let the NFS client notice a file's size changing as a modification.
This avoids presenting invalid data to the client's applications
when the file is modified, and then extended within the window of
the resolution of the modifcation timestamp.

Reviewed By: iedowse
PR: kern/64091

20 years agoCheck in structure definitions for the FreeBSD-3.x signal syscall stuff.
Peter Wemm [Wed, 14 Apr 2004 23:20:14 +0000 (23:20 +0000)]
Check in structure definitions for the FreeBSD-3.x signal syscall stuff.
Nothing uses these yet, but I dont want to lose them.

20 years agoRegen
Peter Wemm [Wed, 14 Apr 2004 23:17:57 +0000 (23:17 +0000)]
Regen

20 years agoCatch up to the not-so-recent statfs(2) changes.
Peter Wemm [Wed, 14 Apr 2004 23:17:37 +0000 (23:17 +0000)]
Catch up to the not-so-recent statfs(2) changes.

20 years agoDon't allow the driver to be unloaded if the device node is open.
Paul Saab [Wed, 14 Apr 2004 19:45:07 +0000 (19:45 +0000)]
Don't allow the driver to be unloaded if the device node is open.

20 years agoRemove the 'timeout' argument from aac_wait_command() as it isn't used and
Scott Long [Wed, 14 Apr 2004 19:11:29 +0000 (19:11 +0000)]
Remove the 'timeout' argument from aac_wait_command() as it isn't used and
never will be.  Update the XXX comment for this function to accurately reflect
why things are the way they are.

20 years agoDo not catch signals when waiting for a request. This fixes a nasty
Paul Saab [Wed, 14 Apr 2004 18:55:28 +0000 (18:55 +0000)]
Do not catch signals when waiting for a request.  This fixes a nasty
race when issuing commands from userland.

20 years agoRemove nowerror lines now that acpica is warns clean.
Nate Lawson [Wed, 14 Apr 2004 18:13:16 +0000 (18:13 +0000)]
Remove nowerror lines now that acpica is warns clean.

20 years agoRemove warnings from vendor files. This takes some files off the vendor
Nate Lawson [Wed, 14 Apr 2004 18:12:29 +0000 (18:12 +0000)]
Remove warnings from vendor files.  This takes some files off the vendor
branch but they have indicated they will not fix these warnings.

20 years agoAdded an entry for twa.4.
Vinod Kashyap [Wed, 14 Apr 2004 18:03:30 +0000 (18:03 +0000)]
Added an entry for twa.4.

Reviewed by: ru

20 years agoReturn an error immediately if asked to switch a non-existent consumer.
Nate Lawson [Wed, 14 Apr 2004 17:58:19 +0000 (17:58 +0000)]
Return an error immediately if asked to switch a non-existent consumer.

20 years agoAdd notes about the pci stuff that's currently working its way through
Warner Losh [Wed, 14 Apr 2004 17:54:18 +0000 (17:54 +0000)]
Add notes about the pci stuff that's currently working its way through
current.

20 years agoNow that the dust has settled on the resource issues, turn on the
Warner Losh [Wed, 14 Apr 2004 17:52:08 +0000 (17:52 +0000)]
Now that the dust has settled on the resource issues, turn on the
power parts of my patches and see what breaks.  Don't (yet) throw
the chatty messages behind a if (bootverbose).

20 years agoRemove a non-variable static and move other static variables to the same
Nate Lawson [Wed, 14 Apr 2004 17:48:33 +0000 (17:48 +0000)]
Remove a non-variable static and move other static variables to the same
location.

20 years agoFix some warnings by commenting out unused code.
Nate Lawson [Wed, 14 Apr 2004 17:47:42 +0000 (17:47 +0000)]
Fix some warnings by commenting out unused code.

20 years agoOnly try to set the ACPI power state if the handle is valid. There was
Nate Lawson [Wed, 14 Apr 2004 17:46:21 +0000 (17:46 +0000)]
Only try to set the ACPI power state if the handle is valid.  There was
probably no problem with this except it may have had the side effect of
registering a NULL consumer.

20 years agoEven though the patch has been submitted to the vendor, this file is off
Nate Lawson [Wed, 14 Apr 2004 16:52:19 +0000 (16:52 +0000)]
Even though the patch has been submitted to the vendor, this file is off
the vendor branch.  Once more, with feeling!

20 years agoForced commit to note that the CVS patches in the previous commit
Jacques Vidrine [Wed, 14 Apr 2004 16:48:27 +0000 (16:48 +0000)]
Forced commit to note that the CVS patches in the previous commit
were

Submitted by: Derek Robert Price <derek@ximbiot.com>

20 years agoPatch vulnerabilities in the CVS client and server:
Jacques Vidrine [Wed, 14 Apr 2004 16:40:50 +0000 (16:40 +0000)]
Patch vulnerabilities in the CVS client and server:

  A malicious CVS server could cause your CVS client to overwrite
  arbitrary files (CAN-2004-0180).

  When a CVS client uses the `-p' checkout option, the server could be
  fooled into checking out files from outside the given $CVSROOT.

(This patch is applied in an unorthodox manner so as not to complicate
 a later vendor import of CVS.)

20 years agoUse a MANFILTER to patch the man pages to point to the right path.
Hartmut Brandt [Wed, 14 Apr 2004 16:31:54 +0000 (16:31 +0000)]
Use a MANFILTER to patch the man pages to point to the right path.

Noted by: phk

20 years agoBump the shared library version number for the bsnmp v1.6 import
Hartmut Brandt [Wed, 14 Apr 2004 16:29:46 +0000 (16:29 +0000)]
Bump the shared library version number for the bsnmp v1.6 import
because of incompatible interface changes.

20 years agoUnbreak the DDB build by replacing #includes that were deleted.
Nate Lawson [Wed, 14 Apr 2004 16:24:28 +0000 (16:24 +0000)]
Unbreak the DDB build by replacing #includes that were deleted.

Pointed out by: Tai-hwa Liang, Xin LI
Pointed hat to: njl

20 years agoThis commit was generated by cvs2svn to compensate for changes in r128237,
Hartmut Brandt [Wed, 14 Apr 2004 16:20:14 +0000 (16:20 +0000)]
This commit was generated by cvs2svn to compensate for changes in r128237,
which included commits to RCS files with non-trunk default branches.

20 years agoImport of bsnmpd 1.6
Hartmut Brandt [Wed, 14 Apr 2004 16:20:14 +0000 (16:20 +0000)]
Import of bsnmpd 1.6

20 years agoPut the name of the module first in the list of all .Nm calls with
Hartmut Brandt [Wed, 14 Apr 2004 16:11:05 +0000 (16:11 +0000)]
Put the name of the module first in the list of all .Nm calls with
argument. This makes the output of calling .Nm without an argument
more senseful later on.

20 years agoCompare with 0 if comparing an integer, not with NULL.
Hartmut Brandt [Wed, 14 Apr 2004 16:09:20 +0000 (16:09 +0000)]
Compare with 0 if comparing an integer, not with NULL.

20 years agoMove the SNMP MIBs and tree definitions from /usr/share/bsnmp to
Hartmut Brandt [Wed, 14 Apr 2004 16:06:19 +0000 (16:06 +0000)]
Move the SNMP MIBs and tree definitions from /usr/share/bsnmp to
/usr/share/snmp. This mirrors the use of /usr/local/share/snmp and
makes also more sense when non-bsnmp-specific MIBs go in.

20 years agoDocument the "return" built-in better: it will exit . (sources) and
Brian Feldman [Wed, 14 Apr 2004 15:58:50 +0000 (15:58 +0000)]
Document the "return" built-in better: it will exit . (sources) and
the top-level shell instance, too.

20 years agoThe newpcm headers currently #define away INTR_MPSAFE and INTR_TYPE_AV
Brian Feldman [Wed, 14 Apr 2004 14:57:49 +0000 (14:57 +0000)]
The newpcm headers currently #define away INTR_MPSAFE and INTR_TYPE_AV
because they bogusly check for defined(INTR_MPSAFE) -- something which
never was a #define.  Correct the definitions.

This make INTR_TYPE_AV finally get used instead of the lower-priority
INTR_TYPE_TTY, so it's quite possible some improvement will be had
on sound driver performance.  It would also make all the drivers
marked INTR_MPSAFE actually run without Giant (which does seem to
work for me), but:
INTR_MPSAFE HAS BEEN REMOVED FROM EVERY SOUND DRIVER!
It needs to be re-added on a case-by-case basis since there is no one
who will vouch for which sound drivers, if any, willy actually operate
correctly without Giant, since there hasn't been testing because of
this bug disabling INTR_MPSAFE.

Found by: "Yuriy Tsibizov" <Yuriy.Tsibizov@gfk.ru>

20 years agoInclude <sys/proc.h> instead of depending on namespace pollution in
Bruce Evans [Wed, 14 Apr 2004 09:34:17 +0000 (09:34 +0000)]
Include <sys/proc.h> instead of depending on namespace pollution in
<sys/user.h> for the definition of TDF_SINTR.  Fixed anachronous
spelling of TDF_SINTR in a comment

Demangled VCS ids.  There were 2 misplaced copies of $FreeBSD$ and of
the include before it.  The vendor id infrastructure was edited.

Fixed the only other remaining style bug since rev.1.1 (expansion of
struct member names made a line too long).

20 years agoInclude <sys/proc.h> for the definition of PS_INMEM instead of
Bruce Evans [Wed, 14 Apr 2004 09:01:56 +0000 (09:01 +0000)]
Include <sys/proc.h> for the definition of PS_INMEM instead of
depending on namespace pollution in <sys/user.h>.

Reduced nearby include messes.

20 years agoContinue my efforts to imitate Windows as closely as possible by
Bill Paul [Wed, 14 Apr 2004 07:48:03 +0000 (07:48 +0000)]
Continue my efforts to imitate Windows as closely as possible by
attempting to duplicate Windows spinlocks. Windows spinlocks differ
from FreeBSD spinlocks in the way they block preemption. FreeBSD
spinlocks use critical_enter(), which masks off _all_ interrupts.
This prevents any other threads from being scheduled, but it also
prevents ISRs from running. In Windows, preemption is achieved by
raising the processor IRQL to DISPATCH_LEVEL, which prevents other
threads from preempting you, but does _not_ prevent device ISRs
from running. (This is essentially what Solaris calls dispatcher
locks.) The Windows spinlock itself (kspin_lock) is just an integer
value which is atomically set when you acquire the lock and atomically
cleared when you release it.

FreeBSD doesn't have IRQ levels, so we have to cheat a little by
using thread priorities: normal thread priority is PASSIVE_LEVEL,
lowest interrupt thread priority is DISPATCH_LEVEL, highest thread
priority is DEVICE_LEVEL (PI_REALTIME) and critical_enter() is
HIGH_LEVEL. In practice, only PASSIVE_LEVEL and DISPATCH_LEVEL
matter to us. The immediate benefit of all this is that I no
longer have to rely on a mutex pool.

Now, I'm sure many people will be seized by the urge to criticize
me for doing an end run around our own spinlock implementation, but
it makes more sense to do it this way. Well, it does to me anyway.

Overview of the changes:

- Properly implement hal_lock(), hal_unlock(), hal_irql(),
  hal_raise_irql() and hal_lower_irql() so that they more closely
  resemble their Windows counterparts. The IRQL is determined by
  thread priority.

- Make ntoskrnl_lock_dpc() and ntoskrnl_unlock_dpc() do what they do
  in Windows, which is to atomically set/clear the lock value. These
  routines are designed to be called from DISPATCH_LEVEL, and are
  actually half of the work involved in acquiring/releasing spinlocks.

- Add FASTCALL1(), FASTCALL2() and FASTCALL3() macros/wrappers
  that allow us to call a _fastcall function in spite of the fact
  that our version of gcc doesn't support __attribute__((__fastcall__))
  yet. The macros take 1, 2 or 3 arguments, respectively. We need
  to call hal_lock(), hal_unlock() etc... ourselves, but can't really
  invoke the function directly. I could have just made the underlying
  functions native routines and put _fastcall wrappers around them for
  the benefit of Windows binaries, but that would create needless bloat.

- Remove ndis_mtxpool and all references to it. We don't need it
  anymore.

- Re-implement the NdisSpinLock routines so that they use hal_lock()
  and friends like they do in Windows.

- Use the new spinlock methods for handling lookaside lists and
  linked list updates in place of the mutex locks that were there
  before.

- Remove mutex locking from ndis_isr() and ndis_intrhand() since they're
  already called with ndis_intrmtx held in if_ndis.c.

- Put ndis_destroy_lock() code under explicit #ifdef notdef/#endif.
  It turns out there are some drivers which stupidly free the memory
  in which their spinlocks reside before calling ndis_destroy_lock()
  on them (touch-after-free bug). The ADMtek wireless driver
  is guilty of this faux pas. (Why this doesn't clobber Windows I
  have no idea.)

- Make NdisDprAcquireSpinLock() and NdisDprReleaseSpinLock() into
  real functions instead of aliasing them to NdisAcaquireSpinLock()
  and NdisReleaseSpinLock(). The Dpr routines use
  KeAcquireSpinLockAtDpcLevel() level and KeReleaseSpinLockFromDpcLevel(),
  which acquires the lock without twiddling the IRQL.

- In ndis_linksts_done(), do _not_ call ndis_80211_getstate(). Some
  drivers may call the status/status done callbacks as the result of
  setting an OID: ndis_80211_getstate() gets OIDs, which means we
  might cause the driver to recursively access some of its internal
  structures unexpectedly. The ndis_ticktask() routine will call
  ndis_80211_getstate() for us eventually anyway.

- Fix the channel setting code a little in ndis_80211_setstate(),
  and initialize the channel to IEEE80211_CHAN_ANYC. (The Microsoft
  spec says you're not supposed to twiddle the channel in BSS mode;
  I may need to enforce this later.) This fixes the problems I was
  having with the ADMtek adm8211 driver: we were setting the channel
  to a non-standard default, which would cause it to fail to associate
  in BSS mode.

- Use hal_raise_irql() to raise our IRQL to DISPATCH_LEVEL when
  calling certain miniport routines, per the Microsoft documentation.

I think that's everything. Hopefully, other than fixing the ADMtek
driver, there should be no apparent change in behavior.

20 years agoStyle cleanups, M_ZERO instead of bzero.
Nate Lawson [Wed, 14 Apr 2004 03:45:20 +0000 (03:45 +0000)]
Style cleanups, M_ZERO instead of bzero.

20 years agoStyle cleanups, use M_ZERO instead of bzero, unify the !semaphore and
Nate Lawson [Wed, 14 Apr 2004 03:43:06 +0000 (03:43 +0000)]
Style cleanups, use M_ZERO instead of bzero, unify the !semaphore and
semaphore return paths.

20 years agoStyle cleanup, plus properly backup partial resource allocation in
Nate Lawson [Wed, 14 Apr 2004 03:41:06 +0000 (03:41 +0000)]
Style cleanup, plus properly backup partial resource allocation in
AcpiOsInstallInterruptHandler() in the case of failure to initialize.

20 years agoStyle cleanups to reduce diffs to locking tree.
Nate Lawson [Wed, 14 Apr 2004 03:39:08 +0000 (03:39 +0000)]
Style cleanups to reduce diffs to locking tree.

20 years agoStyle and printf message cleanups.
Nate Lawson [Wed, 14 Apr 2004 03:34:11 +0000 (03:34 +0000)]
Style and printf message cleanups.

20 years agoUse METHOD_VIDEO instead of the method string itself.
Nate Lawson [Wed, 14 Apr 2004 03:32:01 +0000 (03:32 +0000)]
Use METHOD_VIDEO instead of the method string itself.

Pointed out by: Andrew Thompson

20 years agoUse TRUE for a boolean and a style nit.
Nate Lawson [Wed, 14 Apr 2004 03:30:09 +0000 (03:30 +0000)]
Use TRUE for a boolean and a style nit.

20 years agosx was randomly added to NOTES. Instead, place it in the misc
Warner Losh [Wed, 14 Apr 2004 02:25:31 +0000 (02:25 +0000)]
sx was randomly added to NOTES.  Instead, place it in the misc
hardware in properly sorted order.  Fix a little disorder while I'm
here.

Submitted by: bde

20 years agoUpdate the name for edge triggered for the 20040402 import.
Nate Lawson [Wed, 14 Apr 2004 02:20:35 +0000 (02:20 +0000)]
Update the name for edge triggered for the 20040402 import.

20 years agoPrefer uint16_t to ushort.
Warner Losh [Wed, 14 Apr 2004 02:20:01 +0000 (02:20 +0000)]
Prefer uint16_t to ushort.

Submitted by: bde

20 years agoCheck in files with local changes:
Nate Lawson [Wed, 14 Apr 2004 02:17:00 +0000 (02:17 +0000)]
Check in files with local changes:

* In the resume path, give up after waiting for a while
for WAK_STS to be set.  Some BIOSs never set it.

* 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.

20 years agoCheck in unmodified files off the vendor branch.
Nate Lawson [Wed, 14 Apr 2004 02:14:51 +0000 (02:14 +0000)]
Check in unmodified files off the vendor branch.

20 years agoThis commit was generated by cvs2svn to compensate for changes in r128212,
Nate Lawson [Wed, 14 Apr 2004 02:10:27 +0000 (02:10 +0000)]
This commit was generated by cvs2svn to compensate for changes in r128212,
which included commits to RCS files with non-trunk default branches.

20 years agoImport ACPI-CA 20040402 distribution.
Nate Lawson [Wed, 14 Apr 2004 02:10:27 +0000 (02:10 +0000)]
Import ACPI-CA 20040402 distribution.

20 years agoAdd another cleanfile for future imports.
Nate Lawson [Wed, 14 Apr 2004 02:03:33 +0000 (02:03 +0000)]
Add another cleanfile for future imports.

20 years agoIn an effort to simplify the routing code, try to deprecate rtalloc()
Luigi Rizzo [Wed, 14 Apr 2004 01:13:14 +0000 (01:13 +0000)]
In an effort to simplify the routing code, try to deprecate rtalloc()
in favour of rtalloc_ign(), which is what would end up being called
anyways.

There are 25 more instances of rtalloc() in net*/ and
about 10 instances of rtalloc_ign()

20 years agoStaticize <if>_clone_{create,destroy} functions.
Brooks Davis [Wed, 14 Apr 2004 00:57:49 +0000 (00:57 +0000)]
Staticize <if>_clone_{create,destroy} functions.

Reviewed by: mlaier

20 years agoA simple cache of uid->uname lookups and gid->gname lookups eliminates
Tim Kientzle [Wed, 14 Apr 2004 00:40:54 +0000 (00:40 +0000)]
A simple cache of uid->uname lookups and gid->gname lookups eliminates
almost 1/2 of the CPU time required to create an uncompressed archive
and makes a noticable reduction in wallclock time.

20 years agoAdd support for video output switching. It appears no systems use HCI to
Nate Lawson [Wed, 14 Apr 2004 00:23:58 +0000 (00:23 +0000)]
Add support for video output switching.  It appears no systems use HCI to
change the video output but use a separate device with a DSSX method
and a HID of "TOS6201" instead.  We use a pseudo-driver to get the handle
for this object and pass it to the acpi_toshiba driver.

This is untested but seems to match the Linux Toshiba driver.

20 years agoWhen all the links to a file have been dumped, don't forget
Tim Kientzle [Tue, 13 Apr 2004 23:50:48 +0000 (23:50 +0000)]
When all the links to a file have been dumped, don't forget
to free() the memory used to store the filename.

20 years agoEliminate a lot of malloc/free calls by using
Tim Kientzle [Tue, 13 Apr 2004 23:49:02 +0000 (23:49 +0000)]
Eliminate a lot of malloc/free calls by using
a stack-allocated buffer for safe_fprintf formatting.
Only if the result is too large do we resort to malloc.

20 years ago * Plug a buffer overrun in ACL parsing. (archive_entry.c)
Tim Kientzle [Tue, 13 Apr 2004 23:45:37 +0000 (23:45 +0000)]
 * Plug a buffer overrun in ACL parsing. (archive_entry.c)
 * Re-use a single buffer for shar output formatting rather
   than hammering the heap. (archive_write_set_format_shar.c)
 * Fix a handful of minor memory leaks and clean up some of the
   memory-management code.

20 years agoAdding man page for 3ware's 9000 series storage controller driver (twa).
Vinod Kashyap [Tue, 13 Apr 2004 20:57:44 +0000 (20:57 +0000)]
Adding man page for 3ware's 9000 series storage controller driver (twa).

Reviewed by: ru