aboutsummaryrefslogtreecommitdiff
path: root/exec-i386.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-05-13 18:59:59 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-05-13 18:59:59 +0000
commitae2285314189c0ea32fc73d38c1e9b8051d213ab (patch)
treedfc9d449d27efd7f414b3f94fb68080c041dd5ea /exec-i386.c
parentd418c81eff3ca1b7cdb3c6d09b9b7ecc9becdd41 (diff)
Sparc update (David S. Miller)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@161 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec-i386.c')
-rw-r--r--exec-i386.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/exec-i386.c b/exec-i386.c
index 5b90305058..8a20718e25 100644
--- a/exec-i386.c
+++ b/exec-i386.c
@@ -153,6 +153,13 @@ void raise_exception_err(int exception_index, int error_code)
{
/* NOTE: the register at this point must be saved by hand because
longjmp restore them */
+#ifdef __sparc__
+ /* We have to stay in the same register window as our caller,
+ * thus this trick.
+ */
+ __asm__ __volatile__("restore\n\t"
+ "mov\t%o0, %i0");
+#endif
#ifdef reg_EAX
env->regs[R_EAX] = EAX;
#endif
@@ -409,7 +416,15 @@ int cpu_x86_exec(CPUX86State *env1)
/* execute the generated code */
tc_ptr = tb->tc_ptr;
gen_func = (void *)tc_ptr;
+#ifdef __sparc__
+ __asm__ __volatile__("call %0\n\t"
+ " mov %%o7,%%i0"
+ : /* no outputs */
+ : "r" (gen_func)
+ : "i0", "i1", "i2", "i3", "i4", "i5");
+#else
gen_func();
+#endif
}
}
ret = env->exception_index;