From 4572ff9c78f9e673b960845742b5efce77d07348 Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 28 Mar 2001 02:40:47 +0000 Subject: - Switch from using save/disable/restore_intr to using critical_enter/exit and change the u_int mtx_saveintr member of struct mtx to a critical_t mtx_savecrit. - On the alpha we no longer need a custom _get_spin_lock() macro to avoid an extra PAL call, so remove it. - Partially fix using mutexes with WITNESS in modules. Change all the _mtx_{un,}lock_{spin,}_flags() macros to accept explicit file and line parameters and rename them to use a prefix of two underscores. Inside of kern_mutex.c, generate wrapper functions for _mtx_{un,}lock_{spin,}_flags() (only using a prefix of one underscore) that are called from modules. The macros mtx_{un,}lock_{spin,}_flags() are mapped to the __mtx_* macros inside of the kernel to inline the usual case of mutex operations and map to the internal _mtx_* functions in the module case so that modules will use WITNESS and KTR logging if the kernel is compiled with support for it. --- sys/alpha/include/mutex.h | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'sys/alpha/include') diff --git a/sys/alpha/include/mutex.h b/sys/alpha/include/mutex.h index a6e295d..fd398d7 100644 --- a/sys/alpha/include/mutex.h +++ b/sys/alpha/include/mutex.h @@ -36,29 +36,7 @@ #ifdef _KERNEL -#define mtx_intr_enable(mutex) (mutex)->mtx_saveintr = ALPHA_PSL_IPL_0 - -/* - * Assembly macros (for internal use only) - *-------------------------------------------------------------------------- - */ - -/* - * Get a spin lock, handle recusion inline. - */ -#define _get_spin_lock(mp, tid, opts) do { \ - u_int _ipl = alpha_pal_swpipl(ALPHA_PSL_IPL_HIGH); \ - if (!_obtain_lock((mp), (tid))) { \ - if ((mp)->mtx_lock == (uintptr_t)(tid)) \ - (mp)->mtx_recurse++; \ - else \ - _mtx_lock_spin((mp), (opts), _ipl, __FILE__, \ - __LINE__); \ - } else { \ - alpha_mb(); \ - (mp)->mtx_saveintr = _ipl; \ - } \ -} while (0) +#define mtx_intr_enable(mutex) (mutex)->mtx_savecrit = ALPHA_PSL_IPL_0 #endif /* _KERNEL */ -- cgit v1.1