freebsd-nq/sys/compat/svr4
Bosko Milekic 9ed346bab0 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
..
imgact_svr4.c Proc locking. 2001-01-23 21:33:55 +00:00
Makefile Make the target a little bit more generic. 2000-11-01 08:47:34 +00:00
svr4_acl.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_dirent.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_errno.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_exec.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_fcntl.c Back out proc locking to protect p_ucred for obtaining additional 2001-01-27 00:01:31 +00:00
svr4_fcntl.h Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_filio.c Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_filio.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_fuser.h Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_hrt.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_ioctl.c Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_ioctl.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_ipc.c FreeBSD doesn't have p_emuldata, and our stackgap_init() doesn't take an 2001-01-23 21:02:44 +00:00
svr4_ipc.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_misc.c Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
svr4_mman.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_proto.h Regen. (Fix SYS_exit) 2000-07-29 10:07:38 +00:00
svr4_resource.c Proc locking. 2001-01-23 21:33:55 +00:00
svr4_resource.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_siginfo.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_signal.c Proc locking. 2001-01-23 21:33:55 +00:00
svr4_signal.h Make MINSIGSTKSZ machine dependent, and have the sigaltstack 2000-11-09 08:25:48 +00:00
svr4_socket.c Argh, atomic_store_rel -> atomic_store_rel_int. 2001-01-23 21:40:07 +00:00
svr4_socket.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_sockio.c Use queue macros. 2001-01-23 21:32:02 +00:00
svr4_sockio.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_sockmod.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_stat.c Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_stat.h Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_statvfs.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_stream.c Fix typo: wierd -> weird. 2001-02-06 09:25:10 +00:00
svr4_stropts.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_syscall.h Regen. (Fix SYS_exit) 2000-07-29 10:07:38 +00:00
svr4_syscallnames.c Regen. (Fix SYS_exit) 2000-07-29 10:07:38 +00:00
svr4_sysconfig.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_sysent.c Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_systeminfo.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_sysvec.c Fix typo: seperate -> separate. 2001-02-06 11:21:58 +00:00
svr4_termios.c Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_termios.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_time.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_timod.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_ttold.c Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_ttold.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_types.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_ucontext.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_ulimit.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_ustat.h Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_util.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4_utsname.h Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_wait.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
svr4.h Removed bogus include of opt_global.h. opt_global.h is automatically 2000-01-09 12:29:45 +00:00
syscalls.conf $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
syscalls.master Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00