freebsd-skq/sys
bmilekic f364d4ac36 Change and clean the mutex lock interface.
mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)
2001-02-09 06:11:45 +00:00
..
alpha Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
amd64 Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
arm/include Convert all simplelocks to mutexes and remove the simplelock implementations. 2001-01-24 12:35:55 +00:00
boot Fix typo: seperate -> separate. 2001-02-06 11:21:58 +00:00
cam Change the peripheral driver list from a linker set to module driven 2001-02-07 07:05:59 +00:00
coda Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
compat Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
compile
conf Add recently added PHY drivers sources. 2001-02-08 04:58:17 +00:00
contrib fix duplicate rcsid 2001-02-04 15:25:15 +00:00
crypto This commit was generated by cvs2svn to compensate for changes in r67957, 2000-10-30 11:03:32 +00:00
ddb Use macro API for <sys/queue.h> 2000-12-30 22:06:19 +00:00
dev Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
fs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
geom Fix a braino in ccd's clone routine. 2001-01-29 06:18:14 +00:00
gnu Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
i4b Fix typo: seperate -> separate. 2001-02-06 11:21:58 +00:00
i386 Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
ia64 Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
isa Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
isofs/cd9660 Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
kern Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
libkern - Reverse the order of two loop invariant to ensure strlcat() does not 2001-01-17 20:51:16 +00:00
miscfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
modules Added pc98 supports. 2001-02-08 13:24:30 +00:00
msdosfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
net Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
netatalk Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
netatm * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT. 2000-12-21 21:44:31 +00:00
netgraph Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
netinet Fix typo: seperate -> separate. 2001-02-06 11:21:58 +00:00
netinet6 Fix typo: compatability -> compatibility. 2001-02-06 12:05:58 +00:00
netipx Another round of the <sys/queue.h> FOREACH transmogriffer. 2001-02-04 16:08:18 +00:00
netkey fixed possibility of panic at key_acquire(). 2001-01-14 17:25:08 +00:00
netnatm Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
netncp Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
netns * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT. 2000-12-21 21:44:31 +00:00
nfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
nfsclient Enable use of DHCP extensions. 2001-02-02 02:35:40 +00:00
nfsserver * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT. 2000-12-21 21:44:31 +00:00
ntfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
nwfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
pc98 Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
pccard Move ti1031 to the 16-bit bridge section 2001-02-07 01:16:40 +00:00
pci Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
posix4
powerpc Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
rpc
svr4 This patchset fixes a large number of file descriptor race conditions. 2000-11-18 21:01:04 +00:00
sys Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
tools Simplify this a bit so that it doesn't have to generate silly redundant 2000-12-06 06:59:38 +00:00
ufs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
vm Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
Makefile