aboutsummaryrefslogtreecommitdiffstats
path: root/target-m68k
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2011-05-21 07:55:24 +0000
committerBlue Swirl <blauwirbel@gmail.com>2011-06-26 18:25:21 +0000
commit3c688828bcb3afa2744e1f1729a40eef4a575b56 (patch)
tree2b6ea7233dc7dca637734fbe6227056fc9ff1fa0 /target-m68k
parente694d4e289b05d0c9b118850eff961aa9ca33183 (diff)
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>
Diffstat (limited to 'target-m68k')
-rw-r--r--target-m68k/cpu.h3
-rw-r--r--target-m68k/op_helper.c29
2 files changed, 28 insertions, 4 deletions
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index b025b6689..4d8ba287b 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -119,7 +119,8 @@ void m68k_tcg_init(void);
CPUM68KState *cpu_m68k_init(const char *cpu_model);
int cpu_m68k_exec(CPUM68KState *s);
void cpu_m68k_close(CPUM68KState *s);
-void do_interrupt(int is_hw);
+void do_interrupt(CPUState *env1);
+void do_interrupt_m68k_hardirq(CPUState *env1);
/* you can call this signal handler from your SIGBUS and SIGSEGV
signal handlers to inform the virtual CPU of exceptions. non zero
is returned if the signal was handled by the virtual CPU. */
diff --git a/target-m68k/op_helper.c b/target-m68k/op_helper.c
index 084a182ad..237fc4cb5 100644
--- a/target-m68k/op_helper.c
+++ b/target-m68k/op_helper.c
@@ -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)