mirror of
https://github.com/dingusdev/dingusppc.git
synced 2026-04-21 09:16:48 +00:00
SPRs now use symbolic names
This commit is contained in:
+12
-12
@@ -16,7 +16,7 @@ jmp_buf exc_env; /* Global exception environment. */
|
||||
|
||||
switch(exception_type) {
|
||||
case Except_Type::EXC_SYSTEM_RESET:
|
||||
ppc_state.ppc_spr[26] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_next_instruction_address = 0x0100;
|
||||
break;
|
||||
|
||||
@@ -24,52 +24,52 @@ jmp_buf exc_env; /* Global exception environment. */
|
||||
if (!(ppc_state.ppc_msr & 0x1000)) {
|
||||
/* TODO: handle internal checkstop */
|
||||
}
|
||||
ppc_state.ppc_spr[26] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_next_instruction_address = 0x0200;
|
||||
break;
|
||||
|
||||
case Except_Type::EXC_DSI:
|
||||
ppc_state.ppc_spr[26] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_next_instruction_address = 0x0300;
|
||||
break;
|
||||
|
||||
case Except_Type::EXC_ISI:
|
||||
ppc_state.ppc_spr[26] = ppc_next_instruction_address;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = ppc_next_instruction_address;
|
||||
ppc_next_instruction_address = 0x0400;
|
||||
break;
|
||||
|
||||
case Except_Type::EXC_EXT_INT:
|
||||
ppc_state.ppc_spr[26] = ppc_next_instruction_address;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = ppc_next_instruction_address;
|
||||
ppc_next_instruction_address = 0x0500;
|
||||
break;
|
||||
|
||||
case Except_Type::EXC_ALIGNMENT:
|
||||
ppc_state.ppc_spr[26] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_next_instruction_address = 0x0600;
|
||||
break;
|
||||
|
||||
case Except_Type::EXC_PROGRAM:
|
||||
ppc_state.ppc_spr[26] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_next_instruction_address = 0x0700;
|
||||
break;
|
||||
|
||||
case Except_Type::EXC_NO_FPU:
|
||||
ppc_state.ppc_spr[26] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = ppc_cur_instruction & 0xFFFFFFFC;
|
||||
ppc_next_instruction_address = 0x0800;
|
||||
break;
|
||||
|
||||
case Except_Type::EXC_DECR:
|
||||
ppc_state.ppc_spr[26] = (ppc_cur_instruction & 0xFFFFFFFC) + 4;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = (ppc_cur_instruction & 0xFFFFFFFC) + 4;
|
||||
ppc_next_instruction_address = 0x0900;
|
||||
break;
|
||||
|
||||
case Except_Type::EXC_SYSCALL:
|
||||
ppc_state.ppc_spr[26] = (ppc_cur_instruction & 0xFFFFFFFC) + 4;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = (ppc_cur_instruction & 0xFFFFFFFC) + 4;
|
||||
ppc_next_instruction_address = 0x0C00;
|
||||
break;
|
||||
|
||||
case Except_Type::EXC_TRACE:
|
||||
ppc_state.ppc_spr[26] = (ppc_cur_instruction & 0xFFFFFFFC) + 4;
|
||||
ppc_state.ppc_spr[SPR::SRR0] = (ppc_cur_instruction & 0xFFFFFFFC) + 4;
|
||||
ppc_next_instruction_address = 0x0D00;
|
||||
break;
|
||||
|
||||
@@ -79,7 +79,7 @@ jmp_buf exc_env; /* Global exception environment. */
|
||||
break;
|
||||
}
|
||||
|
||||
ppc_state.ppc_spr[27] = (ppc_state.ppc_msr & 0x0000FF73) | srr1_bits;
|
||||
ppc_state.ppc_spr[SPR::SRR1] = (ppc_state.ppc_msr & 0x0000FF73) | srr1_bits;
|
||||
ppc_state.ppc_msr &= 0xFFFB1041;
|
||||
/* copy MSR[ILE] to MSR[LE] */
|
||||
ppc_state.ppc_msr = (ppc_state.ppc_msr & 0xFFFFFFFE) |
|
||||
|
||||
Reference in New Issue
Block a user