Subversion Repositories HelenOS-historic

Compare Revisions

Regard whitespace Rev 122 → Rev 123

/SPARTAN/trunk/arch/mips/include/exception.h
33,6 → 33,20
#define EXC_MOD 1
#define EXC_TLBL 2
#define EXC_TLBS 3
#define EXC_AdEL 4
#define EXC_AdES 5
#define EXC_IBE 6
#define EXC_DBE 7
#define EXC_Sys 8
#define EXC_Bp 9
#define EXC_RI 10
#define EXC_CpU 11
#define EXC_Ov 12
#define EXC_Tr 13
#define EXC_VCEI 14
#define EXC_FPE 15
#define EXC_WATCH 23
#define EXC_VCED 31
 
extern void exception(void);
 
/SPARTAN/trunk/arch/mips/src/exception.c
36,6 → 36,7
{
int excno;
__u32 epc;
__u32 epc_shift = 0;
pri_t pri;
pri = cpu_priority_high();
48,10 → 49,59
}
/* decode exception number and process the exception */
switch(excno = (cp0_cause_read()>>2)&0x1f) {
case EXC_Int: interrupt(); break;
case EXC_Int:
interrupt();
break;
case EXC_TLBL:
case EXC_TLBS: tlb_invalid(); break;
default: panic("unhandled exception %d\n", excno); break;
case EXC_TLBS:
tlb_invalid();
break;
case EXC_Mod:
panic("unhandled TLB Modification Exception\n");
break;
case EXC_AdEL:
panic("unhandled Address Error Exception - load or instruction fetch\n");
break;
case EXC_AdES:
panic("unhandled Address Error Exception - store\n");
break;
case EXC_IBE:
panic("unhandled Bus Error Exception - fetch instruction\n");
break;
case EXC_DBE:
panic("unhandled Bus Error Exception - data reference: load or store\n");
break;
case EXC_Bp:
/* it is necessary to not re-execute BREAK instruction after returning from Exception handler
(see page 138 in R4000 Manual for more information) */
epc_shift = 4;
break;
case EXC_RI:
panic("unhandled Reserved Instruction Exception\n");
break;
case EXC_CpU:
panic("unhandled Coprocessor Unusable Exception\n");
break;
case EXC_Ov:
panic("unhandled Arithmetic Overflow Exception\n");
break;
case EXC_Tr:
panic("unhandled Trap Exception\n");
break;
case EXC_VCEI:
panic("unhandled Virtual Coherency Exception - instruction\n");
break;
case EXC_FPE:
panic("unhandled Floating-Point Exception\n");
break;
case EXC_WATCH:
panic("unhandled reference to WatchHi/WatchLo address\n");
break;
case EXC_VCED:
panic("unhandled Virtual Coherency Exception - data\n");
break;
default:
panic("unhandled exception %d\n", excno);
}
if (THREAD) {
59,7 → 109,7
epc = THREAD->saved_epc;
}
 
cp0_epc_write(epc);
cp0_epc_write(epc + epc_shift);
cp0_status_write(cp0_status_read() | cp0_status_exl_exception_bit);
cpu_priority_restore(pri);
}