Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 312 → Rev 313

/SPARTAN/trunk/arch/mips/src/exception.c
39,7 → 39,6
int excno;
__u32 epc;
__u32 epc_shift = 0;
pri_t pri;
 
ASSERT(CPU != NULL);
 
50,12 → 49,12
* On exit, exception bit must be set before cpu_priority_restore() is called.
*/
 
pri = cpu_priority_high();
cpu_priority_high();
epc = cp0_epc_read();
cp0_status_write(cp0_status_read() & ~ cp0_status_exl_exception_bit);
cp0_status_write(cp0_status_read() & ~ (cp0_status_exl_exception_bit |
cp0_status_um_bit));
 
if (THREAD) {
THREAD->saved_pri = pri;
THREAD->saved_epc = epc;
}
/* decode exception number and process the exception */
115,12 → 114,12
panic("unhandled exception %d\n", excno);
}
if (THREAD) {
pri = THREAD->saved_pri;
if (THREAD)
epc = THREAD->saved_epc;
}
 
/* Raise EXL bit before epc_write, so that we support
* properly nested exceptions
*/
cp0_status_write(cp0_status_read() | cp0_status_exl_exception_bit);
cp0_epc_write(epc + epc_shift);
cp0_status_write(cp0_status_read() | cp0_status_exl_exception_bit);
cpu_priority_restore(pri);
}