diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-05-18 00:28:38 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-05-18 00:28:38 +0000 |
commit | 567b8d71a84ccbfec00fb59d52dfd6867296f64d (patch) | |
tree | dfcd7958d893ae00faf51af7d859bc02ab0528b1 /sys/arch/pmax/include/cpu.h | |
parent | d414ee5831ad97169bd77cf57b15b084f79e46f2 (diff) |
new cpureg.h from NetBSD plus modifications to use the changed macro names
Diffstat (limited to 'sys/arch/pmax/include/cpu.h')
-rw-r--r-- | sys/arch/pmax/include/cpu.h | 31 |
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) |