summaryrefslogtreecommitdiff
path: root/sys/arch/pmax/include/cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/pmax/include/cpu.h')
-rw-r--r--sys/arch/pmax/include/cpu.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/sys/arch/pmax/include/cpu.h b/sys/arch/pmax/include/cpu.h
index f1d1b07af6e..d1fec14aa49 100644
--- a/sys/arch/pmax/include/cpu.h
+++ b/sys/arch/pmax/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.6 1998/05/08 19:32:49 millert Exp $ */
+/* $OpenBSD: cpu.h,v 1.7 1998/05/18 00:28:11 millert Exp $ */
/* $NetBSD: cpu.h,v 1.15 1996/03/23 20:28:19 jonathan Exp $ */
/*-
@@ -45,10 +45,29 @@
#include <machine/machConst.h>
/*
- * Exported definitions unique to NetBSD/mips cpu support.
+ * Exported definitions unique to OpenBSD/mips cpu support.
*/
/*
+ * Macros to find the CPU architecture we're on at run-time,
+ * or if possible, at compile-time.
+ */
+
+#if (MIPS1 + MIPS3) == 1
+#ifdef MIPS1
+# define CPUISMIPS3 0
+#endif /* mips1 */
+
+#ifdef MIPS3
+# define CPUISMIPS3 1
+#endif /* mips1 */
+
+#else /* run-time test */
+extern int cpu_arch;
+#define CPUISMIPS3 (cpu_arch == 3)
+#endif /* run-time test */
+
+/*
* definitions of cpu-dependent requirements
* referenced in generic code
*/
@@ -73,14 +92,14 @@ struct clockframe {
*/
/* r3000 versions */
-#define CLKF_USERMODE_R3K(framep) ((framep)->sr & MACH_SR_KU_PREV)
+#define CLKF_USERMODE_R3K(framep) ((framep)->sr & MIPS_SR_KU_PREV)
#define CLKF_BASEPRI_R3K(framep) \
- ((~(framep)->sr & (MACH_INT_MASK | MACH_SR_INT_ENA_PREV)) == 0)
+ ((~(framep)->sr & (MIPS_INT_MASK | MIPS_SR_INT_ENA_PREV)) == 0)
/* r4000 versions */
-#define CLKF_USERMODE_R4K(framep) ((framep)->sr & MACH_SR_KSU_USER)
+#define CLKF_USERMODE_R4K(framep) ((framep)->sr & MIPS_SR_KSU_USER)
#define CLKF_BASEPRI_R4K(framep) \
- ((~(framep)->sr & (MACH_INT_MASK | MACH_SR_INT_ENAB)) == 0)
+ ((~(framep)->sr & (MIPS_INT_MASK | MIPS_SR_INT_ENAB)) == 0)
#define CLKF_PC(framep) ((framep)->pc)
#define CLKF_INTR(framep) (0)