summaryrefslogtreecommitdiff
path: root/sys/arch/vax
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-05-30 21:25:29 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-05-30 21:25:29 +0000
commit3dde842074cde6e4a6e51023d820c7594f304449 (patch)
treeb57258ee5ffc2f393dfaedc2c4561fbe18c54fe5 /sys/arch/vax
parentc7a8aff97ffaa83f1bb16c0bfebf96ff4b4c284a (diff)
Define meaningful values for IPL_ levels, which directly map to the spl
operation. Will allow a vax implementation of splassert().
Diffstat (limited to 'sys/arch/vax')
-rw-r--r--sys/arch/vax/include/intr.h67
-rw-r--r--sys/arch/vax/include/param.h48
2 files changed, 58 insertions, 57 deletions
diff --git a/sys/arch/vax/include/intr.h b/sys/arch/vax/include/intr.h
index 559586e2f20..0e527536f38 100644
--- a/sys/arch/vax/include/intr.h
+++ b/sys/arch/vax/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.2 2006/03/12 03:18:38 brad Exp $ */
+/* $OpenBSD: intr.h,v 1.3 2006/05/30 21:25:28 miod Exp $ */
/* $NetBSD: intr.h,v 1.1 1998/08/18 23:55:00 matt Exp $ */
/*
@@ -37,15 +37,17 @@
/* Interrupt Priority Levels are not mutually exclusive. */
-#define IPL_BIO 0 /* block I/O */
-#define IPL_NET 1 /* network */
-#define IPL_TTY 2 /* terminal */
-#define IPL_VM 3 /* memory allocation */
-#define IPL_AUDIO 4 /* audio */
-#define IPL_CLOCK 5 /* clock */
-#define IPL_NONE 6
-
-#define IPL_LEVELS 7
+#define IPL_NONE 0x00
+#define IPL_SOFTCLOCK 0x08
+#define IPL_SOFTNET 0x0c
+#define IPL_BIO 0x15 /* block I/O */
+#define IPL_NET 0x15 /* network */
+#define IPL_TTY 0x15 /* terminal */
+#define IPL_VM 0x17 /* memory allocation */
+#define IPL_AUDIO 0x15 /* audio */
+#define IPL_CLOCK 0x18 /* clock */
+#define IPL_STATCLOCK 0x18 /* statclock */
+#define IPL_HIGH 0x1f
#define IST_UNUSABLE -1 /* interrupt cannot be used */
#define IST_NONE 0 /* none (dummy) */
@@ -53,6 +55,49 @@
#define IST_EDGE 2 /* edge-triggered */
#define IST_LEVEL 3 /* level-triggered */
-#include <machine/param.h>
+/* SPL asserts */
+#define splassert(wantipl) /* nothing */
+
+#ifndef lint
+#define splx(reg) \
+({ \
+ register int val; \
+ __asm __volatile ("mfpr $0x12,%0;mtpr %1,$0x12" \
+ : "=&g" (val) \
+ : "g" (reg)); \
+ val; \
+})
+
+#define _splraise(reg) \
+({ \
+ register int val; \
+ __asm __volatile ("mfpr $0x12,%0" \
+ : "=&g" (val) \
+ : ); \
+ if ((reg) > val) { \
+ __asm __volatile ("mtpr %0,$0x12" \
+ : \
+ : "g" (reg)); \
+ } \
+ val; \
+})
+#endif
+
+#define spl0() splx(IPL_NONE)
+#define splsoftclock() _splraise(IPL_SOFTCLOCK)
+#define splsoftnet() _splraise(IPL_SOFTNET)
+#define splbio() _splraise(IPL_BIO)
+#define splnet() _splraise(IPL_NET)
+#define spltty() _splraise(IPL_TTY)
+#define splvm() _splraise(IPL_VM)
+#define splclock() _splraise(IPL_CLOCK)
+#define splstatclock() _splraise(IPL_STATCLOCK)
+#define splhigh() splx(IPL_HIGH)
+
+/* These are better to use when playing with VAX buses */
+#define spl4() splx(0x14)
+#define spl5() splx(0x15)
+#define spl6() splx(0x16)
+#define spl7() splx(0x17)
#endif /* _VAX_INTR_H */
diff --git a/sys/arch/vax/include/param.h b/sys/arch/vax/include/param.h
index 55bbfe026cf..ab1fc45ce4d 100644
--- a/sys/arch/vax/include/param.h
+++ b/sys/arch/vax/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.31 2006/03/19 01:47:24 martin Exp $ */
+/* $OpenBSD: param.h,v 1.32 2006/05/30 21:25:28 miod Exp $ */
/* $NetBSD: param.h,v 1.39 1999/10/22 21:14:34 ragge Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -144,51 +144,7 @@
#ifdef _KERNEL
-/* SPL asserts */
-#define splassert(wantipl) /* nothing */
-
-#ifndef lint
-#define splx(reg) \
-({ \
- register int val; \
- __asm __volatile ("mfpr $0x12,%0;mtpr %1,$0x12" \
- : "=&g" (val) \
- : "g" (reg)); \
- val; \
-})
-
-#define _splraise(reg) \
-({ \
- register int val; \
- __asm __volatile ("mfpr $0x12,%0" \
- : "=&g" (val) \
- : ); \
- if ((reg) > val) { \
- __asm __volatile ("mtpr %0,$0x12" \
- : \
- : "g" (reg)); \
- } \
- val; \
-})
-#endif
-
-#define spl0() splx(0) /* IPL0 */
-#define splsoftclock() _splraise(8) /* IPL08 */
-#define splsoftnet() _splraise(0xc) /* IPL0C */
-#define splddb() _splraise(0xf) /* IPL0F */
-#define splbio() _splraise(0x15) /* IPL15 */
-#define splnet() _splraise(0x15) /* IPL15 */
-#define spltty() _splraise(0x15) /* IPL15 */
-#define splvm() _splraise(0x17) /* IPL17 */
-#define splclock() _splraise(0x18) /* IPL18 */
-#define splhigh() _splraise(0x1f) /* IPL1F */
-#define splstatclock() splclock()
-
-/* These are better to use when playing with VAX buses */
-#define spl4() splx(0x14)
-#define spl5() splx(0x15)
-#define spl6() splx(0x16)
-#define spl7() splx(0x17)
+#include <machine/intr.h>
/* Prototype needed for delay() */
#ifndef _LOCORE