diff options
-rw-r--r-- | sys/arch/mvme88k/ddb/db_interface.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/asm.h | 21 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/asm_macro.h | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/locore.h | 3 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/locore_asm_routines.S | 25 |
5 files changed, 17 insertions, 40 deletions
diff --git a/sys/arch/mvme88k/ddb/db_interface.c b/sys/arch/mvme88k/ddb/db_interface.c index e795097224d..58e67b6028d 100644 --- a/sys/arch/mvme88k/ddb/db_interface.c +++ b/sys/arch/mvme88k/ddb/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.41 2004/01/14 20:45:59 miod Exp $ */ +/* $OpenBSD: db_interface.c,v 1.42 2004/01/23 17:26:02 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -384,7 +384,7 @@ m88k_db_trap(type, frame) struct trapframe *frame; { - if (db_are_interrupts_disabled()) + if (get_psr() & (1 << PSR_INTERRUPT_DISABLE_BIT)) db_printf("WARNING: entered debugger with interrupts disabled\n"); switch(type) { diff --git a/sys/arch/mvme88k/include/asm.h b/sys/arch/mvme88k/include/asm.h index 5d73a305816..8756c0dcc24 100644 --- a/sys/arch/mvme88k/include/asm.h +++ b/sys/arch/mvme88k/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.25 2003/10/05 20:25:08 miod Exp $ */ +/* $OpenBSD: asm.h,v 1.26 2004/01/23 17:26:05 miod Exp $ */ /* * Mach Operating System @@ -168,13 +168,12 @@ /* * Useful in some situations. - * NOTE: If ARG1 or ARG2 are r2 or r3, strange things may happen. Watch out! */ #define CALL(NAME, ARG1, ARG2) \ subu r31, r31, 32; \ or r2, r0, ARG1; \ bsr.n NAME; \ - or r3, r0, ARG2; \ + or r3, r0, ARG2; \ addu r31, r31, 32 /* This define is similar to CALL, but accepts a function pointer XXX smurph */ @@ -184,7 +183,7 @@ ld r4, r5, lo16(NAME); \ or r2, r0, ARG1; \ jsr.n r4; \ - or r3, r0, ARG2; \ + or r3, r0, ARG2; \ addu r31, r31, 32 /* @@ -198,10 +197,6 @@ * * The bit FLAG_IGNORE_DATA_EXCEPTION indicates that any data exceptions * should be ignored (well, at least treated in a special way). - * The bit FLAG_INTERRUPT_EXCEPTION indicates that the current exception - * is the interrupt exception. Such information can be gotten - * in other ways, but having it in the flags makes it easy for the - * exception handler to check quickly. * The bit FLAG_ENABLING_FPU indicates that the exception handler is * in the process of enabling the FPU (so that an exception can * be serviced). This is needed because enabling the FPU can @@ -210,13 +205,9 @@ * be taken. */ #define FLAG_CPU_FIELD_WIDTH 2 /* must be <= 12 */ -#define FLAG_IGNORE_DATA_EXCEPTION 5 /* bit number 5 */ -#define FLAG_INTERRUPT_EXCEPTION 6 /* bit number 6 */ -#define FLAG_ENABLING_FPU 7 /* bit number 7 */ -#define FLAG_FROM_KERNEL 8 /* bit number 8 */ -#define FLAG_187 9 /* bit number 9 */ -#define FLAG_188 10 /* bit number 10 */ -#define FLAG_197 11 /* bit number 11 */ +#define FLAG_IGNORE_DATA_EXCEPTION 5 +#define FLAG_ENABLING_FPU 7 +#define FLAG_FROM_KERNEL 8 /* REGister OFFset into the E.F. (exception frame) */ #define REG_OFF(reg_num) ((reg_num) * 4) /* (num * sizeof(register_t)) */ diff --git a/sys/arch/mvme88k/include/asm_macro.h b/sys/arch/mvme88k/include/asm_macro.h index a981cfeedfb..562ea05282b 100644 --- a/sys/arch/mvme88k/include/asm_macro.h +++ b/sys/arch/mvme88k/include/asm_macro.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm_macro.h,v 1.22 2003/10/05 20:25:08 miod Exp $ */ +/* $OpenBSD: asm_macro.h,v 1.23 2004/01/23 17:26:05 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -41,8 +41,6 @@ #define flush_pipeline() \ __asm__ __volatile__ (FLUSH_PIPELINE_STRING) -#define db_flush_pipeline flush_pipeline - /* * PSR_TYPE is the type of the Process Status Register. */ diff --git a/sys/arch/mvme88k/include/locore.h b/sys/arch/mvme88k/include/locore.h index 2c8c0cb8046..55d5ff8235b 100644 --- a/sys/arch/mvme88k/include/locore.h +++ b/sys/arch/mvme88k/include/locore.h @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.h,v 1.20 2004/01/12 07:46:16 miod Exp $ */ +/* $OpenBSD: locore.h,v 1.21 2004/01/23 17:26:05 miod Exp $ */ #ifndef _MACHINE_LOCORE_H_ #define _MACHINE_LOCORE_H_ @@ -35,7 +35,6 @@ int badaddr(vaddr_t addr, int size); #define badwordaddr(x) badaddr(x, 4) void set_cpu_number(unsigned number); void doboot(void); -int db_are_interrupts_disabled(void); int guarded_access(unsigned char *volatile address, unsigned len, u_char *vec); diff --git a/sys/arch/mvme88k/mvme88k/locore_asm_routines.S b/sys/arch/mvme88k/mvme88k/locore_asm_routines.S index d05e7504bd8..33ba3f9376c 100644 --- a/sys/arch/mvme88k/mvme88k/locore_asm_routines.S +++ b/sys/arch/mvme88k/mvme88k/locore_asm_routines.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore_asm_routines.S,v 1.27 2003/11/08 21:45:19 miod Exp $ */ +/* $OpenBSD: locore_asm_routines.S,v 1.28 2004/01/23 17:26:06 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1992 Carnegie Mellon University @@ -169,14 +169,6 @@ ENTRY(do_xmem_byte) /* do_xmem_byte(address, data, supervisor) */ 1: xmem.bu r3,r2,r0 2: jmp r1 -#ifdef DDB -ENTRY(db_are_interrupts_disabled) - ldcr r2, PSR - set r3, r0, 1<PSR_INTERRUPT_DISABLE_BIT> - jmp.n r1 - and r2, r2, r3 -#endif /* DDB */ - /* * Copy specified amount of data from user space into the kernel * copyin(from, to, len) @@ -1541,12 +1533,6 @@ ENTRY(longjmp) jmp.n r1 or r2,r0,1 -#ifdef DDB -ENTRY(db_flush_pipeline) - FLUSH_PIPELINE - jmp r1 -#endif /* DDB */ - ENTRY(read_processor_identification_register) jmp.n r1 ldcr r2, PID @@ -1601,17 +1587,18 @@ GLOBAL(guarded_access_end) * r5 temporary new PSR */ ENTRY(set_cpu_number) +#ifdef DEBUG /* make sure the CPU number is valid */ clr r3, r2, FLAG_CPU_FIELD_WIDTH<0> bcnd ne0, r3, 1f /* bad cpu number */ +#endif /* going to change a control register -- disable interrupts */ ldcr r4, PSR set r5, r4, 1<PSR_INTERRUPT_DISABLE_BIT> stcr r5, PSR FLUSH_PIPELINE - tcnd ne0,r0,10 /* make sure interrupts are really disabled */ - /* if they are not, branch to error_handler() */ + /* put in the cpu number */ ldcr r3, SR1 /* get the flags */ clr r3, r3, FLAG_CPU_FIELD_WIDTH<0> /* clean the slate */ @@ -1623,10 +1610,12 @@ ENTRY(set_cpu_number) FLUSH_PIPELINE jmp r1 +#ifdef DEBUG 1: /* bad cpu number*/ or.u r2, r0, hi16(9f) bsr.n _C_LABEL(panic) or r2, r2, lo16(9f) data -9: string "set_cpu_number: bad CPU number\0" +9: string "set_cpu_number: bad CPU number %x\0" +#endif |