Line 31... |
Line 31... |
extern unsigned long pctemp;
|
extern unsigned long pctemp;
|
|
|
/* Handle OR1K exceptions. */
|
/* Handle OR1K exceptions. */
|
void except_handle(int except, unsigned long ea)
|
void except_handle(int except, unsigned long ea)
|
{
|
{
|
|
unsigned long pc_saved;
|
#if ONLY_VIRTUAL_MACHINE
|
#if ONLY_VIRTUAL_MACHINE
|
printf("WARNING: Exception 0x%x (%s): ", except, EXCEPT_NAME(except));
|
printf("WARNING: Exception 0x%x (%s): ", except, EXCEPT_NAME(except));
|
printf("Insn ADDR: 0x%x Eff ADDR: 0x%x\n", iqueue[0].insn_addr, ea);
|
printf("Insn ADDR: 0x%x Eff ADDR: 0x%x\n", iqueue[0].insn_addr, ea);
|
printf("No exception processing while ONLY_VIRTUAL_MACHINE is defined.\n");
|
printf("No exception processing while ONLY_VIRTUAL_MACHINE is defined.\n");
|
#else
|
#else
|
Line 45... |
Line 46... |
return;
|
return;
|
}
|
}
|
|
|
printf("Exception 0x%x (%s): ", except, EXCEPT_NAME(except));
|
printf("Exception 0x%x (%s): ", except, EXCEPT_NAME(except));
|
printf("Insn ADDR: 0x%x Eff ADDR: 0x%x\n", iqueue[0].insn_addr, ea);
|
printf("Insn ADDR: 0x%x Eff ADDR: 0x%x\n", iqueue[0].insn_addr, ea);
|
|
|
|
pc_saved = (iqueue[0].insn_addr & ~0x1) | (mfspr(SPR_SR) & SPR_SR_SUPV);
|
mtspr(SPR_EPCR_BASE, iqueue[0].insn_addr);
|
mtspr(SPR_EPCR_BASE, iqueue[0].insn_addr);
|
mtspr(SPR_EEAR_BASE, ea);
|
mtspr(SPR_EEAR_BASE, ea);
|
mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_SUPV); /* SUPV mode */
|
mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_SUPV); /* SUPV mode */
|
mtspr(SPR_SR, mfspr(SPR_SR) & ~SPR_SR_EIR); /* Disable ints. */
|
mtspr(SPR_SR, mfspr(SPR_SR) & ~SPR_SR_EIR); /* Disable ints. */
|
pc = (unsigned long)except;
|
pc = (unsigned long)except;
|