freebsd-dev/sys/dev/acpica
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
..
Osd - Use '*h' instead of 'struct acpi_spinlock' for sizeof[1]. 2007-03-26 23:04:02 +00:00
acpi_acad.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_battery.c ACPIIO_BATT_GET_UNITS would always return ENXIO. However, it should never 2006-12-22 00:57:26 +00:00
acpi_button.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_cmbat.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_cpu.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_dock.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_ec.c Optimize sx locks to use simple atomic operations for the common cases of 2007-03-31 23:23:42 +00:00
acpi_hpet.c Re-enable the HPET timer after a resume. 2007-03-28 22:28:48 +00:00
acpi_if.m Canonize the include of acpi.h. 2005-09-11 18:39:03 +00:00
acpi_isab.c Canonize the include of acpi.h. 2005-09-11 18:39:03 +00:00
acpi_lid.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_package.c Re-work Cx handling to be per-cpu and asymmetrical, fixing support on 2007-01-07 21:53:42 +00:00
acpi_pci_link.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_pci.c Fixup some comments to allow for the fact that PCI domains are not specific 2006-05-11 22:13:21 +00:00
acpi_pcib_acpi.c Expand the MSI/MSI-X API to address some deficiencies in the MSI-X support. 2007-01-22 21:48:44 +00:00
acpi_pcib_pci.c Expand the MSI/MSI-X API to address some deficiencies in the MSI-X support. 2007-01-22 21:48:44 +00:00
acpi_pcib.c Force any hardwire-routed interrupts to level trigger and active low 2005-12-03 21:17:17 +00:00
acpi_pcibvar.h Protect against multiple includes and use _KERNEL to protect the PCI fns. 2005-02-28 05:39:34 +00:00
acpi_perf.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_powerres.c Remove unnecessary assignment. 2006-04-21 19:06:29 +00:00
acpi_quirk.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_quirks Add a quirk for a motherboard whose acpi timer runs too fast. 2005-06-26 18:19:14 +00:00
acpi_resource.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_smbat.c Remove unused variable. 2006-02-21 03:16:58 +00:00
acpi_smbus.h Import ACPI smart battery support. Newer systems (Acer, mostly) do not 2005-10-23 00:20:13 +00:00
acpi_thermal.c Check the _TMP value for sanity also. On some systems (HP NX laptops), the 2007-03-05 21:39:53 +00:00
acpi_throttle.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_timer.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpi_video.c Improve the way we'll detect video devices as per ACPI 3.0. 2006-08-10 13:18:02 +00:00
acpi.c Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
acpiio.h Cleanups and support code for importing smart battery support. 2005-10-23 00:16:41 +00:00
acpivar.h Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00