freebsd-dev/sys/sparc64
John Baldwin c6a37e8413 Divorce critical sections from spinlocks. Critical sections as denoted by
critical_enter() and critical_exit() are now solely a mechanism for
deferring kernel preemptions.  They no longer have any affect on
interrupts.  This means that standalone critical sections are now very
cheap as they are simply unlocked integer increments and decrements for the
common case.

Spin mutexes now use a separate KPI implemented in MD code: spinlock_enter()
and spinlock_exit().  This KPI is responsible for providing whatever MD
guarantees are needed to ensure that a thread holding a spin lock won't
be preempted by any other code that will try to lock the same lock.  For
now all archs continue to block interrupts in a "spinlock section" as they
did formerly in all critical sections.  Note that I've also taken this
opportunity to push a few things into MD code rather than MI.  For example,
critical_fork_exit() no longer exists.  Instead, MD code ensures that new
threads have the correct state when they are created.  Also, we no longer
try to fixup the idlethreads for APs in MI code.  Instead, each arch sets
the initial curthread and adjusts the state of the idle thread it borrows
in order to perform the initial context switch.

This change is largely a big NOP, but the cleaner separation it provides
will allow for more efficient alternative locking schemes in other parts
of the kernel (bare critical sections rather than per-CPU spin mutexes
for per-CPU data for example).

Reviewed by:	grehan, cognet, arch@, others
Tested on:	i386, alpha, sparc64, powerpc, arm, possibly more
2005-04-04 21:53:56 +00:00
..
central - Add a device interface method for bus_get_resource_list() and use 2005-03-19 00:47:02 +00:00
compile
conf Add USB Communication Device Class Ethernet driver. Originally written for 2005-03-22 14:52:40 +00:00
creator - Add missing <sys/module.h>. [1] 2004-07-09 23:12:22 +00:00
ebus Don't panic when we're asked to allocate a resource type that we know 2005-01-09 18:58:08 +00:00
fhc Add a driver for the 'clock-board' device (the clock board is an 2005-03-19 01:04:48 +00:00
include Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
isa Since we are quite unlikely to ever face another platform which 2005-02-06 13:46:39 +00:00
pci fix kldloading of pci driver modules after boot on sparc64... since 2005-03-23 18:16:26 +00:00
sbus /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
sparc64 Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00