freebsd-nq/sys/dev
John Baldwin 4e7f640dfb Optimize sx locks to use simple atomic operations for the common cases of
obtaining and releasing shared and exclusive locks.  The algorithms for
manipulating the lock cookie are very similar to that rwlocks.  This patch
also adds support for exclusive locks using the same algorithm as mutexes.

A new sx_init_flags() function has been added so that optional flags can be
specified to alter a given locks behavior.  The flags include SX_DUPOK,
SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature
to the similar flags for mutexes.

Adaptive spinning on select locks may be enabled by enabling the
ADAPTIVE_SX kernel option.  Only locks initialized with the SX_ADAPTIVESPIN
flag via sx_init_flags() will adaptively spin.

The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock()
are now performed inline in non-debug kernels.  As a result, <sys/sx.h> now
requires <sys/lock.h> to be included prior to <sys/sx.h>.

The new kernel option SX_NOINLINE can be used to disable the aforementioned
inlining in non-debug kernels.

The size of struct sx has changed, so the kernel ABI is probably greatly
disturbed.

MFC after:	1 month
Submitted by:	attilio
Tested by:	kris, pjd
2007-03-31 23:23:42 +00:00
..
aac o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
acpi_support Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpica Optimize sx locks to use simple atomic operations for the common cases of 2007-03-31 23:23:42 +00:00
adlink o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
advansys o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
agp Restore agp aperture size after resume, in case it is modified after boot. 2007-01-06 08:31:31 +00:00
aha o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 15:55:37 +00:00
ahb o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
aic o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
aic7xxx o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
amd o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
amr o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
an o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ar Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
arcmsr Forced commit to note that the previous CVS comment is 2007-03-12 05:10:29 +00:00
arl o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
asr o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ata Make it compile 2007-03-14 01:59:00 +00:00
ath Change mtx's to use the formulated name as type so witness does not 2007-03-05 21:56:33 +00:00
atkbdc o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
auxio - Only touch the LED bit of the (LED) AUXIO register when turning the 2006-01-26 19:04:18 +00:00
awi o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
bce Catch up the rest of the drivers with the ether_vlan_mtap modifications. 2007-03-04 03:38:08 +00:00
bfe o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
bge Fix some OID names and minor style as per feedback from various people. 2007-03-13 00:41:55 +00:00
bktr o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
buslogic o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
cardbus Cope gracefully with device_get_children returning an error. 2007-01-19 08:49:28 +00:00
ce Remove ancient preprocessor code. Fix module compilation. 2007-03-25 20:21:31 +00:00
ciss o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
cm Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
cnw Catchup to filters by piso. 2007-02-23 19:27:49 +00:00
cp Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
cpufreq Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
cs o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ct o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ctau Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
cx Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
cxgb bus_size_t is a bad cross-architectural type with respect to printf, use uint32_t instead 2007-03-24 04:28:33 +00:00
cy o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
dc o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
dcons Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
de o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
digi Fix our ioctl(2) implementation when the argument is "int". New 2006-09-27 19:57:02 +00:00
dpt o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
drm o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ed Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
eisa
em Revert previous change and take back a pointy hat. 2007-02-28 09:04:46 +00:00
en o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ep o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 15:55:37 +00:00
esp o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ex o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
exca - Fix exca_(io|mem)_map() to return proper errno values. 2007-03-23 17:15:07 +00:00
fatm o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
fb Rototill the sparc64 nexus(4) (actually this brings in the code the 2007-03-07 21:13:51 +00:00
fdc Always protect the kthread flags with the lock and close a race with 2007-02-27 17:16:52 +00:00
fe o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
firewire Teardown interrupt only when sc->ih is not NULL. 2007-03-30 22:25:26 +00:00
flash MFp4: 2006-11-29 08:05:55 +00:00
fxp Add support for the 82562GX chip within if_fxp. 2007-03-28 18:10:50 +00:00
gem o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
harp
hatm o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
hfa o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
hifn Overhaul driver/subsystem api's: 2007-03-21 03:42:51 +00:00
hme o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
hptmv Use pause() rather than tsleep() on stack variables and function pointers. 2007-02-27 17:23:29 +00:00
hwpmc Use pause() rather than tsleep() on stack variables and function pointers. 2007-02-27 17:23:29 +00:00
ic Fix style nits. No md5 changes in .o's. ;-) 2006-09-08 21:46:01 +00:00
ichsmb o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ichwd Revisit the watchdogs: Resetting the error to EINVAL after failing to set the 2007-03-27 21:03:37 +00:00
ida o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
idt o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ie o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ieee488 Catchup with filters 2007-02-23 19:34:52 +00:00
if_ndis change ic_modecaps to a bit vector and use setbit, et. al. 2007-03-11 22:37:32 +00:00
iicbus New device: icee. Generic i2c eeprom driver. 2007-03-23 23:10:35 +00:00
iir o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
io
ipmi Add constants for the fields in a BAR. Also, add two new macros 2007-03-31 21:39:02 +00:00
ips o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ipw Drop the ipw softc lock before calling back into net80211, fixing a 2007-03-24 18:53:33 +00:00
isp Fix compilation problem (add a const) for pre-7.0 compiles. 2007-03-31 21:01:35 +00:00
ispfw The MODULE_NAME should "ispfw" unless overriden, not "isp". 2006-12-10 03:42:57 +00:00
iwi Fix an off-by-one error in iwi_init_fw_dma(). It didn't reuse the existing 2007-03-21 18:40:31 +00:00
ixgb Catch up the rest of the drivers with the ether_vlan_mtap modifications. 2007-03-04 03:38:08 +00:00
joy
kbd Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
kbdmux Fix our ioctl(2) implementation when the argument is "int". New 2006-09-27 19:57:02 +00:00
le o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
led
lge o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
lmc o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
mc146818 Add macros for the individual divisor bits as some MC146818A-compatible 2007-01-20 14:57:51 +00:00
mca
mcd
md Resolve two deadlocks that could be caused by busy md device backed 2006-12-14 11:34:07 +00:00
mem
mfi o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
mii Revert couple of changes from 1.51 and 1.52. Reading link status with BMSR 2007-03-19 23:17:39 +00:00
mk48txx Revisit the watchdogs: Resetting the error to EINVAL after failing to set the 2007-03-27 21:03:37 +00:00
mlx o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
mly o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
mmc Preliminary MMC stack. This stack supports SD 1.0 cards only, but 2006-10-20 06:39:59 +00:00
mpt feedback from RELENG_5 port 2007-03-11 01:59:44 +00:00
mse o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
msk Catch up the rest of the drivers with the ether_vlan_mtap modifications. 2007-03-04 03:38:08 +00:00
mxge Optimize sx locks to use simple atomic operations for the common cases of 2007-03-31 23:23:42 +00:00
my my(4) doesn't need miibus(4). 2007-03-11 15:20:04 +00:00
ncv o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
nfe Catch up the rest of the drivers with the ether_vlan_mtap modifications. 2007-03-04 03:38:08 +00:00
nge Catch up the rest of the drivers with the ether_vlan_mtap modifications. 2007-03-04 03:38:08 +00:00
nmdm Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
nsp o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
null Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
nve o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ofw Add missing includes of priv.h. 2006-11-06 17:43:10 +00:00
patm o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
pbio Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
pccard Use pause() rather than tsleep() on stack variables and function pointers. 2007-02-27 17:23:29 +00:00
pccbb Use different wait channel name for second of two sleeps. Minor commentary 2007-03-05 05:40:24 +00:00
pcf Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
pci Add constants for the fields in a BAR. Also, add two new macros 2007-03-31 21:39:02 +00:00
pdq o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 20:11:27 +00:00
powermac_nvram Add device to access and modify Open Firmware NVRAM settings in 2006-08-01 22:19:01 +00:00
ppbus Remove a useless cast from void * to struct ppb_device *. 2007-03-06 11:44:11 +00:00
ppc Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
pst o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
puc o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
ral allow net80211 to fillin rate sets 2007-03-11 22:43:35 +00:00
random Use pause() rather than tsleep() on stack variables and function pointers. 2007-02-27 17:23:29 +00:00
ray o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
rc o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
re Add support for the RTL8110SC driver. 2007-03-28 18:07:12 +00:00
rndtest
rp - Make rp(4) 64-bit- and endian-clean as well as work on strict alignment 2006-11-20 12:59:27 +00:00
rr232x o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
safe Overhaul driver/subsystem api's: 2007-03-21 03:42:51 +00:00
sbni o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
sbsh o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
scc Add method enabled() to the SCC interface. This method can be used 2007-03-28 18:05:17 +00:00
scd Use pause() rather than tsleep() on stack variables and function pointers. 2007-02-27 17:23:29 +00:00
sf o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
si o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 20:11:27 +00:00
sio o Revert last. The chip is already supported by puc(4). 2007-03-29 04:26:52 +00:00
sk o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
smbus Only support the SMB_OLD_BREAD ioctl if one of COMPAT_FREEBSD[456] is 2006-09-26 14:38:56 +00:00
sn o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
snc o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
snp Switch to ANSI function declarations. 2007-03-23 22:48:44 +00:00
sound Tell interested readers of the source that the return value is not 2007-03-31 13:38:12 +00:00
speaker
spibus MFp4: when passing the transfer up the foodchain, make sure we go up 2006-10-20 07:11:52 +00:00
sr Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
stg o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
stge Catch up the rest of the drivers with the ether_vlan_mtap modifications. 2007-03-04 03:38:08 +00:00
streams Clean up the svr4 socket cache and streams code some to make it more easily 2006-07-21 20:40:13 +00:00
sym Fix typo in comment. 2007-03-05 21:21:03 +00:00
syscons Optimize set_origin() use in some screensavers to stop them eating 2007-02-21 12:27:12 +00:00
tdfx Take the functionality contained in the former "options TDFX_LINUX" 2006-03-03 21:37:38 +00:00
ti Catch up the rest of the drivers with the ether_vlan_mtap modifications. 2007-03-04 03:38:08 +00:00
trm o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
twa o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
twe o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
tx o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
txp Catch up the rest of the drivers with the ether_vlan_mtap modifications. 2007-03-04 03:38:08 +00:00
uart For embedded UARTs compatible with the ns8250 family it is possible 2007-03-28 18:34:59 +00:00
ubsec Overhaul driver/subsystem api's: 2007-03-21 03:42:51 +00:00
usb Optimize sx locks to use simple atomic operations for the common cases of 2007-03-31 23:23:42 +00:00
utopia
vge Catch up the rest of the drivers with the ether_vlan_mtap modifications. 2007-03-04 03:38:08 +00:00
vkbd Fix our ioctl(2) implementation when the argument is "int". New 2006-09-27 19:57:02 +00:00
vr o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
vx o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
watchdog Revisit the watchdogs: Resetting the error to EINVAL after failing to set the 2007-03-27 21:03:37 +00:00
wds Catchup with filters 2007-02-23 19:34:52 +00:00
wi o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00
wl Don't call bus_deactivate_resource() explicitly before calling 2007-03-21 03:38:37 +00:00
xe o break newbus api: add a new argument of type driver_filter_t to 2007-02-23 12:19:07 +00:00