diff options
author | jhb <jhb@FreeBSD.org> | 2001-03-28 02:31:54 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-03-28 02:31:54 +0000 |
commit | 3e4166569d016eb336a76bfb079024dbfe30b695 (patch) | |
tree | 3c573685f1d602eaf162bbad2536ac337e2fd5a1 /sys/ia64/include/cpufunc.h | |
parent | 07d30bc01eb16ab706b0a136a5a9066b7b8dc322 (diff) | |
download | FreeBSD-src-3e4166569d016eb336a76bfb079024dbfe30b695.zip FreeBSD-src-3e4166569d016eb336a76bfb079024dbfe30b695.tar.gz |
- Add the new critical_t type used to save state inside of critical
sections.
- Add implementations of the critical_enter() and critical_exit() functions
and remove restore_intr() and save_intr().
- Remove the somewhat bogus disable_intr() and enable_intr() functions on
the alpha as the alpha actually uses a priority level and not simple bit
flag on the CPU.
Diffstat (limited to 'sys/ia64/include/cpufunc.h')
-rw-r--r-- | sys/ia64/include/cpufunc.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/ia64/include/cpufunc.h b/sys/ia64/include/cpufunc.h index 3128f70..b3ff55c 100644 --- a/sys/ia64/include/cpufunc.h +++ b/sys/ia64/include/cpufunc.h @@ -163,9 +163,6 @@ writel(u_int addr, u_int32_t data) return; /* TODO: implement this */ } -/* - * Bogus interrupt manipulation - */ static __inline void disable_intr(void) { @@ -178,16 +175,18 @@ enable_intr(void) __asm __volatile (";; ssm psr.i;; srlz.d"); } -static __inline u_int -save_intr(void) +static __inline critical_t +critical_enter(void) { - u_int psr; + critical_t psr; + __asm __volatile ("mov %0=psr;;" : "=r" (psr)); - return psr; + disable_intr(); + return (psr); } static __inline void -restore_intr(u_int psr) +critical_exit(critical_t psr) { __asm __volatile ("mov psr.l=%0;; srlz.d" :: "r" (psr)); } |