diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-11-09 21:50:02 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-11-09 21:50:02 +0000 |
commit | 1f3a0aa0fc81150e541ecfad55c0bb6c49c87844 (patch) | |
tree | 42dcc78cf5ea14675c92ff00c4c3bf98448a8e60 /sys/arch | |
parent | 3657f1f4d975dc18116ded1d958d6a413a0676f7 (diff) |
Kill guarded_access() - the way we map OBIO, there is no need for special
treatement of interrupt vectors variables, a simple read will do.
While there, speed up the interrupt handlers a bit:
- remove old debug code or only compile it if option DEBUG.
- use short circuits for setipl() if we know interrupts are disabled at
this point: there is no need playing with the psr in these cases.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/m88k/m88k/trap.c | 36 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/locore.h | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/locore.S | 43 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/m187_machdep.c | 46 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/m188_machdep.c | 15 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/m197_machdep.c | 42 |
6 files changed, 25 insertions, 161 deletions
diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index 57e7df4af7d..aa044746c15 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.13 2004/11/08 16:39:31 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.14 2004/11/09 21:49:56 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -213,11 +213,6 @@ m88100_trap(unsigned type, struct trapframe *frame) int sig = 0; extern struct vm_map *kernel_map; -#ifdef MVME188 /* XXX - only MVME188 needs guarded_access() */ - extern caddr_t guarded_access_start; - extern caddr_t guarded_access_end; - extern caddr_t guarded_access_bad; -#endif uvmexp.traps++; if ((p = curproc) == NULL) @@ -319,35 +314,6 @@ m88100_trap(unsigned type, struct trapframe *frame) #endif switch (pbus_type) { -#ifdef MVME188 /* XXX - only MVME188 needs guarded_access() */ - case CMMU_PFSR_BERROR: - /* - * If it is a guarded access, bus error is OK. - */ - if ((frame->tf_sxip & XIP_ADDR) >= - (unsigned)&guarded_access_start && - (frame->tf_sxip & XIP_ADDR) <= - (unsigned)&guarded_access_end) { - frame->tf_snip = - ((unsigned)&guarded_access_bad ) | NIP_V; - frame->tf_sfip = - ((unsigned)&guarded_access_bad + 4) | FIP_V; - frame->tf_sxip = 0; - /* We sort of resolved the fault ourselves - * because we know where it came from - * [guarded_access()]. But we must still think - * about the other possible transactions in - * dmt1 & dmt2. Mark dmt0 so that - * data_access_emulation skips it. XXX smurph - */ - frame->tf_dmt0 |= DMT_SKIP; - data_access_emulation((unsigned *)frame); - frame->tf_dpfsr = 0; - frame->tf_dmt0 = 0; - return; - } - break; -#endif case CMMU_PFSR_SUCCESS: /* * The fault was resolved. Call data_access_emulation diff --git a/sys/arch/mvme88k/include/locore.h b/sys/arch/mvme88k/include/locore.h index dd554aaeafa..e57fc9ef3b8 100644 --- a/sys/arch/mvme88k/include/locore.h +++ b/sys/arch/mvme88k/include/locore.h @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.h,v 1.25 2004/10/01 19:00:51 miod Exp $ */ +/* $OpenBSD: locore.h,v 1.26 2004/11/09 21:50:01 miod Exp $ */ #ifndef _MACHINE_LOCORE_H_ #define _MACHINE_LOCORE_H_ @@ -15,8 +15,6 @@ int badaddr(vaddr_t addr, int size); void set_cpu_number(unsigned number); void doboot(void); -int guarded_access(volatile u_int8_t *, unsigned, u_int8_t *); - /* locore_c_routines.c */ unsigned getipl(void); diff --git a/sys/arch/mvme88k/mvme88k/locore.S b/sys/arch/mvme88k/mvme88k/locore.S index b5adde0677a..d63370a82e7 100644 --- a/sys/arch/mvme88k/mvme88k/locore.S +++ b/sys/arch/mvme88k/mvme88k/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.39 2004/10/01 20:20:36 miod Exp $ */ +/* $OpenBSD: locore.S,v 1.40 2004/11/09 21:50:01 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -413,7 +413,6 @@ GLOBAL(spin_cpu) */ #ifdef MVME188 - /* * void m188_delay(int us) * @@ -439,46 +438,6 @@ GLOBAL(m188_delay) subu r4, r4, 2 /* two cycles per iteration */ jmp r1 - -/* - * int guarded_access(volatile u_int8_t *, unsigned, u_int8_t *) - * - * Necessary for interrupt vector retrieval - it could cause a bus error! - */ -GLOBAL(guarded_access_start) -ENTRY(guarded_access) - cmp r9,r3,4 - bb1 eq,r9,@L145 - cmp r9,r3,2 - bb1 eq,r9,@L144 - cmp r9,r3,1 - bb1 eq,r9,@L143 - br _C_LABEL(guarded_access_bad) -@L143: - ld.b r9,r0,r2 - tb1 0, r0, 0 - st.b r9,r0,r4 - br @L142 -@L144: - ld.h r9,r0,r2 - tb1 0, r0, 0 - st.h r9,r0,r4 - br @L142 -@L145: - ld r9,r0,r2 - tb1 0, r0, 0 - st r9,r0,r4 - br @L142 - -GLOBAL(guarded_access_bad) - jmp.n r1 - or r2,r0,EFAULT - -@L142: - jmp.n r1 - or r2,r0,0 -GLOBAL(guarded_access_end) - #endif /*****************************************************************************/ diff --git a/sys/arch/mvme88k/mvme88k/m187_machdep.c b/sys/arch/mvme88k/mvme88k/m187_machdep.c index 916f9ad275c..c5e8de52a9a 100644 --- a/sys/arch/mvme88k/mvme88k/m187_machdep.c +++ b/sys/arch/mvme88k/mvme88k/m187_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m187_machdep.c,v 1.3 2004/11/09 12:01:19 miod Exp $ */ +/* $OpenBSD: m187_machdep.c,v 1.4 2004/11/09 21:50:01 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -157,48 +157,18 @@ m187_ext_int(u_int v, struct trapframe *eframe) struct intrhand *intr; intrhand_t *list; int ret; - u_char vec; + u_int8_t vec; - /* get level and mask */ mask = *(u_int8_t *)M187_IMASK & 0x07; level = *(u_int8_t *)M187_ILEVEL & 0x07; - -#ifdef DIAGNOSTIC - /* - * It is really bizarre for the mask and level to the be the same. - * pcc2 for 187 blocks all interrupts at and below the mask value, - * so we should not be getting an interrupt at the level that is - * already blocked. I can't explain this case XXX nivas - */ - - if ((mask == level) && level) { - panic("mask == level, %d", level); - } - - /* - * Interrupting level cannot be 0--0 doesn't produce an interrupt. - * Weird! XXX nivas - */ - - if (level == 0) { - panic("Bogons... level %x and mask %x", level, mask); - } -#endif + /* generate IACK and get the vector */ + vec = *ivec[level]; uvmexp.intrs++; - /* generate IACK and get the vector */ - flush_pipeline(); - if (guarded_access(ivec[level], 1, &vec) == EFAULT) { - panic("Unable to get vector for this interrupt (level %x)", level); - } - flush_pipeline(); - flush_pipeline(); - flush_pipeline(); - /* block interrupts at level or lower */ - setipl(level); - + m187_setipl(level); + flush_pipeline(); enable_interrupt(); list = &intr_handlers[vec]; @@ -208,7 +178,7 @@ m187_ext_int(u_int v, struct trapframe *eframe) printf("Spurious interrupt (level %x and vec %x)\n", level, vec); } else { -#ifdef DIAGNOSTIC +#ifdef DEBUG intr = SLIST_FIRST(list); if (intr->ih_ipl != level) { panic("Handler ipl %x not the same as level %x. " @@ -254,7 +224,7 @@ m187_ext_int(u_int v, struct trapframe *eframe) * Restore the mask level to what it was when the interrupt * was taken. */ - setipl(mask); + m187_setipl(mask); } u_int diff --git a/sys/arch/mvme88k/mvme88k/m188_machdep.c b/sys/arch/mvme88k/mvme88k/m188_machdep.c index 40ff1a5704f..7b97e5a93c9 100644 --- a/sys/arch/mvme88k/mvme88k/m188_machdep.c +++ b/sys/arch/mvme88k/mvme88k/m188_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m188_machdep.c,v 1.3 2004/11/09 12:01:19 miod Exp $ */ +/* $OpenBSD: m188_machdep.c,v 1.4 2004/11/09 21:50:01 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -294,7 +294,7 @@ m188_ext_int(u_int v, struct trapframe *eframe) struct intrhand *intr; intrhand_t *list; int ret, intbit; - unsigned vec; + u_int vec; cur_mask = ISR_GET_CURRENT_MASK(cpu); old_spl = m188_curspl[cpu]; @@ -378,16 +378,11 @@ m188_ext_int(u_int v, struct trapframe *eframe) 1 << intbit, IST_STRING); } } else if (VME_INTERRUPT_MASK & (1 << intbit)) { - if (guarded_access(ivec[level], 4, (u_char *)&vec) == - EFAULT) { - panic("unable to get vector for this vmebus " - "interrupt (level %x)", level); - } - vec &= VME_VECTOR_MASK; + vec = *(u_int32_t *)ivec[level] & VME_VECTOR_MASK; if (vec & VME_BERR_MASK) { printf("VME vec timeout, vec = %x, mask = 0x%b\n", vec, 1 << intbit, IST_STRING); - break; + continue; } if (vec == 0) { panic("unknown vme interrupt: mask = 0x%b", @@ -447,5 +442,5 @@ out: * Restore the mask level to what it was when the interrupt * was taken. */ - setipl(eframe->tf_mask); + m188_setipl(eframe->tf_mask); } diff --git a/sys/arch/mvme88k/mvme88k/m197_machdep.c b/sys/arch/mvme88k/mvme88k/m197_machdep.c index 30c887d85bc..5d6d031f5d6 100644 --- a/sys/arch/mvme88k/mvme88k/m197_machdep.c +++ b/sys/arch/mvme88k/mvme88k/m197_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m197_machdep.c,v 1.3 2004/11/09 12:01:19 miod Exp $ */ +/* $OpenBSD: m197_machdep.c,v 1.4 2004/11/09 21:50:01 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -169,53 +169,29 @@ m197_setupiackvectors() void m197_ext_int(u_int v, struct trapframe *eframe) { - int mask, level, src; + int mask, level; struct intrhand *intr; intrhand_t *list; int ret; - u_char vec; + u_int8_t vec; - /* get src and mask */ mask = *(u_int8_t *)M197_IMASK & 0x07; - src = *(u_int8_t *)M197_ISRC; - if (v == T_NON_MASK) { /* This is the abort switch */ level = IPL_NMI; vec = BS_ABORTVEC; } else { - /* get level */ level = *(u_int8_t *)M197_ILEVEL & 0x07; + /* generate IACK and get the vector */ + vec = *ivec[level]; } -#ifdef DIAGNOSTIC - /* - * Interrupting level cannot be 0--0 doesn't produce an interrupt. - * Weird! XXX nivas - */ - - if (level == 0) { - panic("Bogons... level %x and mask %x", level, mask); - } -#endif - uvmexp.intrs++; - if (v != T_NON_MASK) { - /* generate IACK and get the vector */ - flush_pipeline(); - if (guarded_access(ivec[level], 1, &vec) == EFAULT) { - panic("Unable to get vector for this interrupt (level %x)", level); - } - flush_pipeline(); - flush_pipeline(); - flush_pipeline(); - } - if (v != T_NON_MASK || cold == 0) { /* block interrupts at level or lower */ - setipl(level); - + m197_setipl(level); + flush_pipeline(); enable_interrupt(); } @@ -226,7 +202,7 @@ m197_ext_int(u_int v, struct trapframe *eframe) printf("Spurious interrupt (level %x and vec %x)\n", level, vec); } else { -#ifdef DIAGNOSTIC +#ifdef DEBUG intr = SLIST_FIRST(list); if (intr->ih_ipl != level) { panic("Handler ipl %x not the same as level %x. " @@ -267,7 +243,7 @@ m197_ext_int(u_int v, struct trapframe *eframe) * Restore the mask level to what it was when the interrupt * was taken. */ - setipl(mask); + m197_setipl(mask); } } |