Merge pull request #1043 from MooglyGuy/master

Really fix traps in SPARC core
This commit is contained in:
Vas Crabb 2016-07-06 10:27:49 +10:00 committed by GitHub
commit aed7acbe66

View File

@ -1071,7 +1071,10 @@ void mb86901_device::execute_rdsr(UINT32 op)
} }
} }
else if (RDPSR) else if (RDPSR)
{
MAKE_PSR;
RDREG = PSR; RDREG = PSR;
}
else if (RDWIM) else if (RDWIM)
RDREG = WIM; RDREG = WIM;
else if (RDTBR) else if (RDTBR)
@ -1171,6 +1174,7 @@ void mb86901_device::execute_wrsr(UINT32 op)
{ {
PSR = result &~ PSR_ZERO_MASK; PSR = result &~ PSR_ZERO_MASK;
} }
BREAK_PSR;
} }
else if (WRWIM) else if (WRWIM)
{ {
@ -2602,6 +2606,7 @@ void mb86901_device::select_trap()
m_tt = 0x10 | m_interrupt_level; m_tt = 0x10 | m_interrupt_level;
TBR |= m_tt << 4; TBR |= m_tt << 4;
m_trap = 0;
m_instruction_access_exception = 0; m_instruction_access_exception = 0;
m_illegal_instruction = 0; m_illegal_instruction = 0;
m_privileged_instruction = 0; m_privileged_instruction = 0;
@ -2719,7 +2724,10 @@ void mb86901_device::execute_trap()
{ {
ET = 0; ET = 0;
PS = S; PS = S;
S = 1;
CWP = ((CWP + NWINDOWS) - 1) % NWINDOWS; CWP = ((CWP + NWINDOWS) - 1) % NWINDOWS;
MAKE_PSR;
update_gpr_pointers();
if (m_annul == 0) if (m_annul == 0)
{ {
@ -2733,7 +2741,6 @@ void mb86901_device::execute_trap()
m_annul = 0; m_annul = 0;
} }
S = 1;
if (!m_reset_trap) if (!m_reset_trap)
{ {
PC = TBR; PC = TBR;
@ -2746,9 +2753,6 @@ void mb86901_device::execute_trap()
m_reset_trap = 0; m_reset_trap = 0;
} }
} }
MAKE_PSR;
update_gpr_pointers();
} }
@ -2949,7 +2953,11 @@ void mb86901_device::execute_step()
m_interrupt_level = m_bp_irl; m_interrupt_level = m_bp_irl;
} }
if (m_trap) execute_trap(); if (m_trap)
{
execute_trap();
debugger_instruction_hook(this, PC);
}
if (m_execute_mode) if (m_execute_mode)
{ {
@ -3114,7 +3122,7 @@ void mb86901_device::execute_run()
continue; continue;
} }
debugger_instruction_hook(this, m_pc); debugger_instruction_hook(this, PC);
if (m_reset_mode) if (m_reset_mode)
{ {