summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/mutex.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-03-28 02:40:47 +0000
committerjhb <jhb@FreeBSD.org>2001-03-28 02:40:47 +0000
commit4572ff9c78f9e673b960845742b5efce77d07348 (patch)
tree118249692a5e69c7cb4a44540b33e1ec40b0f35d /sys/i386/include/mutex.h
parentfdbf402b8548ef52a4bc5f1d4f27038556bfbf93 (diff)
downloadFreeBSD-src-4572ff9c78f9e673b960845742b5efce77d07348.zip
FreeBSD-src-4572ff9c78f9e673b960845742b5efce77d07348.tar.gz
- 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.
Diffstat (limited to 'sys/i386/include/mutex.h')
-rw-r--r--sys/i386/include/mutex.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/i386/include/mutex.h b/sys/i386/include/mutex.h
index 4184cde..b605efb 100644
--- a/sys/i386/include/mutex.h
+++ b/sys/i386/include/mutex.h
@@ -40,7 +40,7 @@
/* Global locks */
extern struct mtx clock_lock;
-#define mtx_intr_enable(mutex) (mutex)->mtx_saveintr |= PSL_I
+#define mtx_intr_enable(mutex) (mutex)->mtx_savecrit |= PSL_I
/*
* Assembly macros (for internal use only)
@@ -106,7 +106,7 @@ extern struct mtx clock_lock;
"# getlock_spin_block" \
: "+a" (_res), /* 0 */ \
"+m" (mtxp->mtx_lock), /* 1 */ \
- "=m" (mtxp->mtx_saveintr) /* 2 */ \
+ "=m" (mtxp->mtx_savecrit) /* 2 */ \
: "r" (tid), /* 3 (input) */ \
"gi" (type), /* 4 */ \
"g" (mtxp) /* 5 */ \
@@ -221,7 +221,7 @@ extern struct mtx clock_lock;
: "+m" (mtxp->mtx_lock), /* 0 */ \
"+m" (mtxp->mtx_recurse), /* 1 */ \
"=r" (_res) /* 2 */ \
- : "g" (mtxp->mtx_saveintr) /* 3 */ \
+ : "g" (mtxp->mtx_savecrit) /* 3 */ \
: "cc", "memory", "ecx" /* used */ ); \
})
@@ -270,7 +270,7 @@ extern struct mtx clock_lock;
incl %ebx ; \
movl %ebx, lck+MTX_RECURSECNT ; \
jmp 1f ; \
-2: movl %ecx, lck+MTX_SAVEINTR ; \
+2: movl %ecx, lck+MTX_SAVECRIT ; \
1: popl %ebx ; \
popl %ecx ; \
popl %eax
@@ -278,7 +278,7 @@ extern struct mtx clock_lock;
#define MTX_UNLOCK_SPIN(lck) \
pushl %edx ; \
pushl %eax ; \
- movl lck+MTX_SAVEINTR, %edx ; \
+ movl lck+MTX_SAVECRIT, %edx ; \
movl lck+MTX_RECURSECNT, %eax ; \
testl %eax, %eax ; \
jne 2f ; \
OpenPOWER on IntegriCloud