aboutsummaryrefslogtreecommitdiff
path: root/linux-user/main.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-04-27 21:07:38 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-04-27 21:07:38 +0000
commitfdf9b3e831e8e6b5ceb2a44c742da7d1ab558242 (patch)
treeba55ae7076148e88f174b9ce8928f12551583941 /linux-user/main.c
parent66a93e0f47fa9869178008c7bc38d66a7c5e45f4 (diff)
sh4 target (Samuel Tardieu)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1861 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/main.c')
-rw-r--r--linux-user/main.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 1f4720516d..78f45a5f9f 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -1387,6 +1387,38 @@ void cpu_loop(CPUMIPSState *env)
}
#endif
+#ifdef TARGET_SH4
+void cpu_loop (CPUState *env)
+{
+ int trapnr, ret;
+ // target_siginfo_t info;
+
+ while (1) {
+ trapnr = cpu_sh4_exec (env);
+
+ switch (trapnr) {
+ case 0x160:
+ ret = do_syscall(env,
+ env->gregs[0x13],
+ env->gregs[0x14],
+ env->gregs[0x15],
+ env->gregs[0x16],
+ env->gregs[0x17],
+ env->gregs[0x10],
+ 0);
+ env->gregs[0x10] = ret;
+ env->pc += 2;
+ break;
+ default:
+ printf ("Unhandled trap: 0x%x\n", trapnr);
+ cpu_dump_state(env, stderr, fprintf, 0);
+ exit (1);
+ }
+ process_pending_signals (env);
+ }
+}
+#endif
+
void usage(void)
{
printf("qemu-" TARGET_ARCH " version " QEMU_VERSION ", Copyright (c) 2003-2005 Fabrice Bellard\n"
@@ -1665,6 +1697,15 @@ int main(int argc, char **argv)
}
env->PC = regs->cp0_epc;
}
+#elif defined(TARGET_SH4)
+ {
+ int i;
+
+ for(i = 0; i < 16; i++) {
+ env->gregs[i] = regs->regs[i];
+ }
+ env->pc = regs->pc;
+ }
#else
#error unsupported target CPU
#endif