summaryrefslogtreecommitdiffstats
path: root/sys/ia64/include
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-03-28 02:31:54 +0000
committerjhb <jhb@FreeBSD.org>2001-03-28 02:31:54 +0000
commit3e4166569d016eb336a76bfb079024dbfe30b695 (patch)
tree3c573685f1d602eaf162bbad2536ac337e2fd5a1 /sys/ia64/include
parent07d30bc01eb16ab706b0a136a5a9066b7b8dc322 (diff)
downloadFreeBSD-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')
-rw-r--r--sys/ia64/include/cpufunc.h15
-rw-r--r--sys/ia64/include/types.h5
2 files changed, 11 insertions, 9 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));
}
diff --git a/sys/ia64/include/types.h b/sys/ia64/include/types.h
index f8235a2..86ece49 100644
--- a/sys/ia64/include/types.h
+++ b/sys/ia64/include/types.h
@@ -64,8 +64,11 @@ typedef long intfptr_t;
typedef unsigned long uintfptr_t;
#endif
+/* Critical section value */
+typedef register_t critical_t;
+
/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint32_t intrmask_t;
+typedef __uint64_t intrmask_t;
/* Interrupt handler function type */
typedef void inthand2_t(void *);
OpenPOWER on IntegriCloud