create 68010 bus error stack frame / fix for 68010 RTE stack frame unwinding (#9293)

* 68010 RTE: don't set SR (which may change SP to USP) until after unwinding 1000 stack exception frame

* 68010: create 1000 format stack frame on bus error
This commit is contained in:
J Booth 2022-02-11 07:29:34 -05:00 committed by GitHub
parent 02cd26d37e
commit f0fc52d32c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 16 deletions

View File

@ -6886,16 +6886,12 @@ e5c0 ffc0 roxl w A+-DXWL 01:8 7:14 234fc:5
m_instr_mode = INSTRUCTION_YES;
m_run_mode = RUN_MODE_NORMAL;
} else {
if (format_word == 0x8) /* type 1000 stack frame */
if (format_word == 0x8) /* 68010 - type 1000 stack frame */
{
new_sr = m68ki_pull_16();
new_pc = m68ki_pull_32();
m68ki_fake_pull_16(); /* format word */
m68ki_jump(new_pc);
m68ki_set_sr(new_sr);
m_instr_mode = INSTRUCTION_YES;
m_run_mode = RUN_MODE_NORMAL;
m68ki_fake_pull_16(); /* special status */
m68ki_fake_pull_16(); /* format word */
m68ki_fake_pull_16(); /* special status word */
m68ki_fake_pull_32(); /* fault address */
m68ki_fake_pull_32(); /* reserved and data output buffer */
m68ki_fake_pull_32(); /* reserved and data input buffer */
@ -6908,6 +6904,10 @@ e5c0 ffc0 roxl w A+-DXWL 01:8 7:14 234fc:5
m68ki_fake_pull_32();
m68ki_fake_pull_32();
m68ki_fake_pull_32();
m68ki_jump(new_pc);
m68ki_set_sr(new_sr);
m_instr_mode = INSTRUCTION_YES;
m_run_mode = RUN_MODE_NORMAL;
}
else
{

View File

@ -957,8 +957,15 @@ void m68000_base_device::execute_run()
if (!CPU_TYPE_IS_020_PLUS())
{
/* Note: This is implemented for 68000 only! */
m68ki_stack_frame_buserr(sr);
if (CPU_TYPE_IS_010())
{
m68ki_stack_frame_1000(m_ppc, sr, EXCEPTION_BUS_ERROR);
}
else
{
/* Note: This is implemented for 68000 only! */
m68ki_stack_frame_buserr(sr);
}
}
else if(!CPU_TYPE_IS_040_PLUS()) {
if (m_mmu_tmp_buserror_address == m_ppc)

View File

@ -26542,16 +26542,12 @@ void m68000_base_device::x4e73_rte_l_71()
m_instr_mode = INSTRUCTION_YES;
m_run_mode = RUN_MODE_NORMAL;
} else {
if (format_word == 0x8) /* type 1000 stack frame */
if (format_word == 0x8) /* 68010 - type 1000 stack frame */
{
new_sr = m68ki_pull_16();
new_pc = m68ki_pull_32();
m68ki_fake_pull_16(); /* format word */
m68ki_jump(new_pc);
m68ki_set_sr(new_sr);
m_instr_mode = INSTRUCTION_YES;
m_run_mode = RUN_MODE_NORMAL;
m68ki_fake_pull_16(); /* special status */
m68ki_fake_pull_16(); /* format word */
m68ki_fake_pull_16(); /* special status word */
m68ki_fake_pull_32(); /* fault address */
m68ki_fake_pull_32(); /* reserved and data output buffer */
m68ki_fake_pull_32(); /* reserved and data input buffer */
@ -26564,6 +26560,10 @@ void m68000_base_device::x4e73_rte_l_71()
m68ki_fake_pull_32();
m68ki_fake_pull_32();
m68ki_fake_pull_32();
m68ki_jump(new_pc);
m68ki_set_sr(new_sr);
m_instr_mode = INSTRUCTION_YES;
m_run_mode = RUN_MODE_NORMAL;
}
else
{