FreeBSD src
Go to file
Bill Paul 52378c7ead Fix a problem reported by Pierre Beyssac. Sometinmes when ndis_get_info()
calls MiniportQueryInformation(), it will return NDIS_STATUS_PENDING.
When this happens, ndis_get_info() will sleep waiting for a completion
event. If two threads call ndis_get_info() and both end up having to
sleep, they will both end up waiting on the same wait channel, which
can cause a panic in sleepq_add() if INVARIANTS are turned on.

Fix this by having ndis_get_info() use a common mutex rather than
using the process mutex with PROC_LOCK(). Also do the same for
ndis_set_info(). Note that Pierre's original patch also made ndis_thsuspend()
use the new mutex, but ndis_thsuspend() shouldn't need this since
it will make each thread that calls it sleep on a unique wait channel.

Also, it occured to me that we probably don't want to enter
MiniportQueryInformation() or MiniportSetInformation() from more
than one thread at any given time, so now we acquire a Windows
spinlock before calling either of them. The Microsoft documentation
says that MiniportQueryInformation() and MiniportSetInformation()
are called at DISPATCH_LEVEL, and previously we would call
KeRaiseIrql() to set the IRQL to DISPATCH_LEVEL before entering
either routine, but this only guarantees mutual exclusion on
uniprocessor machines. To make it SMP safe, we need to use a real
spinlock. For now, I'm abusing the spinlock embedded in the
NDIS_MINIPORT_BLOCK structure for this purpose. (This may need to be
applied to some of the other routines in kern_ndis.c at a later date.)

Export ntoskrnl_init_lock() (KeInitializeSpinlock()) from subr_ntoskrnl.c
since we need to use in in kern_ndis.c, and since it's technically part
of the Windows kernel DDK API along with the other spinlock routines. Use
it in subr_ndis.c too rather than frobbing the spinlock directly.
2005-01-14 22:39:44 +00:00
bin Removed harmful empty lines that crept in during the copyright 2005-01-13 08:46:19 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r140229, 2005-01-14 09:50:45 +00:00
crypto Better Xlist command line. 2004-10-28 16:13:28 +00:00
etc Fix the pbio include file installation process and the 2005-01-14 14:18:19 +00:00
games 1. s/women/woman/ when the singular is intended 2005-01-11 00:25:38 +00:00
gnu Markup nits. 2005-01-13 10:07:51 +00:00
include Fix the pbio include file installation process and the 2005-01-14 14:18:19 +00:00
kerberos5 NODOCCOMPRESS -> NO_DOCCOMPRESS 2004-12-21 09:33:47 +00:00
lib Set math_errhandling to MATH_ERREXCEPT. Now that we have fenv.h, we 2005-01-14 22:03:27 +00:00
libexec 64-bit clean + WARNS=6: 2005-01-14 12:22:57 +00:00
release Safer version of the chflags command. 2005-01-13 08:29:51 +00:00
rescue Don't call "objs" target in rescue.mk twice. 2004-12-23 10:16:46 +00:00
sbin Improve readability for the recently introduced changes by having 2005-01-14 15:49:05 +00:00
secure NOCRYPT -> NO_CRYPT 2004-12-21 10:16:04 +00:00
share Markup fixes. 2005-01-14 20:23:58 +00:00
sys Fix a problem reported by Pierre Beyssac. Sometinmes when ndis_get_info() 2005-01-14 22:39:44 +00:00
tools Add test which excersises problem with unability to change association of 2005-01-12 09:57:18 +00:00
usr.bin Fix off-by-one error. 2005-01-14 09:21:54 +00:00
usr.sbin Removed bitrot. 2005-01-13 13:34:00 +00:00
COPYRIGHT Complete 2005 transition. 2005-01-01 07:29:20 +00:00
MAINTAINERS Drop hold on patch. ENOTIME for long-stalled ideas here. Too busy elsewhere. 2004-12-29 03:49:58 +00:00
Makefile NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00
Makefile.inc1 Remove the special sparc64 time_t support. 2004-12-29 19:39:06 +00:00
README KerberosIV de-orbit burn continues. Disconnect from "make world". 2003-03-08 10:01:26 +00:00
UPDATING Warn about the NOFOO -> NO_FOO conversion, and remind users to 2004-12-23 16:03:08 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The
``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html