summaryrefslogtreecommitdiffstats
path: root/sys/ia64/include
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-12-18 00:27:18 +0000
committerjhb <jhb@FreeBSD.org>2001-12-18 00:27:18 +0000
commita3b98398cbfb4b809f8577b6a95aabb2c30a1aeb (patch)
treebd1f842c61588e8478e798dece6dff8b2be41310 /sys/ia64/include
parent090c933e94e7345e9c9e9a9fbe29ea6c8397a662 (diff)
downloadFreeBSD-src-a3b98398cbfb4b809f8577b6a95aabb2c30a1aeb.zip
FreeBSD-src-a3b98398cbfb4b809f8577b6a95aabb2c30a1aeb.tar.gz
Modify the critical section API as follows:
- The MD functions critical_enter/exit are renamed to start with a cpu_ prefix. - MI wrapper functions critical_enter/exit maintain a per-thread nesting count and a per-thread critical section saved state set when entering a critical section while at nesting level 0 and restored when exiting to nesting level 0. This moves the saved state out of spin mutexes so that interlocking spin mutexes works properly. - Most low-level MD code that used critical_enter/exit now use cpu_critical_enter/exit. MI code such as device drivers and spin mutexes use the MI wrappers. Note that since the MI wrappers store the state in the current thread, they do not have any return values or arguments. - mtx_intr_enable() is replaced with a constant CRITICAL_FORK which is assigned to curthread->td_savecrit during fork_exit(). Tested on: i386, alpha
Diffstat (limited to 'sys/ia64/include')
-rw-r--r--sys/ia64/include/cpufunc.h6
-rw-r--r--sys/ia64/include/mutex.h12
-rw-r--r--sys/ia64/include/profile.h4
3 files changed, 7 insertions, 15 deletions
diff --git a/sys/ia64/include/cpufunc.h b/sys/ia64/include/cpufunc.h
index 45390e9..c2d074f 100644
--- a/sys/ia64/include/cpufunc.h
+++ b/sys/ia64/include/cpufunc.h
@@ -34,6 +34,8 @@
#include <sys/types.h>
#include <machine/ia64_cpu.h>
+#define CRITICAL_FORK (ia64_get_psr() |= IA64_PSR_I)
+
#ifdef __GNUC__
static __inline void
@@ -283,7 +285,7 @@ enable_intr(void)
}
static __inline critical_t
-critical_enter(void)
+cpu_critical_enter(void)
{
critical_t psr;
@@ -293,7 +295,7 @@ critical_enter(void)
}
static __inline void
-critical_exit(critical_t psr)
+cpu_critical_exit(critical_t psr)
{
__asm __volatile ("mov psr.l=%0;; srlz.d" :: "r" (psr));
}
diff --git a/sys/ia64/include/mutex.h b/sys/ia64/include/mutex.h
index b14d7ae..96d8f3d 100644
--- a/sys/ia64/include/mutex.h
+++ b/sys/ia64/include/mutex.h
@@ -32,17 +32,7 @@
#ifndef _MACHINE_MUTEX_H_
#define _MACHINE_MUTEX_H_
-#include <machine/ia64_cpu.h>
-
-#ifndef LOCORE
-
-#ifdef _KERNEL
-
-#define mtx_intr_enable(mutex) do (mutex)->mtx_savecrit |= IA64_PSR_I; while (0)
-
-#endif /* _KERNEL */
-
-#else /* !LOCORE */
+#ifdef LOCORE
/*
* Simple assembly macros to get and release non-recursive spin locks
diff --git a/sys/ia64/include/profile.h b/sys/ia64/include/profile.h
index 038c805..8d93c5c 100644
--- a/sys/ia64/include/profile.h
+++ b/sys/ia64/include/profile.h
@@ -100,9 +100,9 @@ _mcount: \n\
* The following two macros do splhigh and splx respectively.
*/
#define MCOUNT_ENTER(s) \n\
- _c = critical_enter()
+ _c = cpu_critical_enter()
#define MCOUNT_EXIT(s) \n\
- (void)critical_exit(_c)
+ cpu_critical_exit(_c)
#define MCOUNT_DECL(s) critical_t c;
#ifdef GUPROF
struct gmonparam;
OpenPOWER on IntegriCloud