m68k: use caller supplied CPUState for interrupt related stuff

Pass CPUState to do_interrupt(). This is needed by later patches.

It would be cleaner to move the function to helper.c, but there are
a few dependencies between do_interrupt() and other functions.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2011-05-21 07:55:24 +00:00
parent e694d4e289
commit 3c688828bc
3 changed files with 30 additions and 6 deletions

View file

@ -21,9 +21,13 @@
#if defined(CONFIG_USER_ONLY)
void do_interrupt(int is_hw)
void do_interrupt(CPUState *env1)
{
env1->exception_index = -1;
}
void do_interrupt_m68k_hardirq(CPUState *env1)
{
env->exception_index = -1;
}
#else
@ -90,7 +94,7 @@ static void do_rte(void)
env->aregs[7] = sp + 8;
}
void do_interrupt(int is_hw)
static void do_interrupt_all(int is_hw)
{
uint32_t sp;
uint32_t fmt;
@ -155,6 +159,25 @@ void do_interrupt(int is_hw)
env->pc = ldl_kernel(env->vbr + vector);
}
void do_interrupt(CPUState *env1)
{
CPUState *saved_env;
saved_env = env;
env = env1;
do_interrupt_all(0);
env = saved_env;
}
void do_interrupt_m68k_hardirq(CPUState *env1)
{
CPUState *saved_env;
saved_env = env;
env = env1;
do_interrupt_all(1);
env = saved_env;
}
#endif
static void raise_exception(int tt)