mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
MCF5208 emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2924 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
62ea5b0bd3
commit
20dcee9483
13 changed files with 833 additions and 296 deletions
|
@ -87,6 +87,7 @@ static void do_rte(void)
|
|||
env->pc = ldl_kernel(sp + 4);
|
||||
sp |= (fmt >> 28) & 3;
|
||||
env->sr = fmt & 0xffff;
|
||||
m68k_switch_sp(env);
|
||||
env->aregs[7] = sp + 8;
|
||||
}
|
||||
|
||||
|
@ -128,9 +129,6 @@ void do_interrupt(int is_hw)
|
|||
}
|
||||
}
|
||||
|
||||
/* TODO: Implement USP. */
|
||||
sp = env->aregs[7];
|
||||
|
||||
vector = env->exception_index << 2;
|
||||
|
||||
fmt |= 0x40000000;
|
||||
|
@ -138,6 +136,15 @@ void do_interrupt(int is_hw)
|
|||
fmt |= vector << 16;
|
||||
fmt |= env->sr;
|
||||
|
||||
env->sr |= SR_S;
|
||||
if (is_hw) {
|
||||
env->sr = (env->sr & ~SR_I) | (env->pending_level << SR_I_SHIFT);
|
||||
env->sr &= ~SR_M;
|
||||
}
|
||||
m68k_switch_sp(env);
|
||||
|
||||
sp = env->aregs[7];
|
||||
|
||||
/* ??? This could cause MMU faults. */
|
||||
sp &= ~3;
|
||||
sp -= 4;
|
||||
|
@ -145,11 +152,6 @@ void do_interrupt(int is_hw)
|
|||
sp -= 4;
|
||||
stl_kernel(sp, fmt);
|
||||
env->aregs[7] = sp;
|
||||
env->sr |= SR_S;
|
||||
if (is_hw) {
|
||||
env->sr = (env->sr & ~SR_I) | (env->pending_level << SR_I_SHIFT);
|
||||
env->sr &= ~SR_M;
|
||||
}
|
||||
/* Jump to vector. */
|
||||
env->pc = ldl_kernel(env->vbr + vector);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue