From 93eac243d523b473dd33f6fc84ffa15ed2f018d9 Mon Sep 17 00:00:00 2001 From: bellard Date: Mon, 2 Oct 2006 17:58:33 +0000 Subject: 32 bit syscall fix (Juergen Keil) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2189 c046a42c-6fe2-441c-8c8c-71466251a162 --- kqemu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'kqemu.c') diff --git a/kqemu.c b/kqemu.c index b7a93b0..5ba314f 100644 --- a/kqemu.c +++ b/kqemu.c @@ -470,9 +470,13 @@ static int do_syscall(CPUState *env, selector = (env->star >> 32) & 0xffff; #ifdef __x86_64__ if (env->hflags & HF_LMA_MASK) { + int code64; + env->regs[R_ECX] = kenv->next_eip; env->regs[11] = env->eflags; + code64 = env->hflags & HF_CS64_MASK; + cpu_x86_set_cpl(env, 0); cpu_x86_load_seg_cache(env, R_CS, selector & 0xfffc, 0, 0xffffffff, @@ -485,7 +489,7 @@ static int do_syscall(CPUState *env, DESC_S_MASK | DESC_W_MASK | DESC_A_MASK); env->eflags &= ~env->fmask; - if (env->hflags & HF_CS64_MASK) + if (code64) env->eip = env->lstar; else env->eip = env->cstar; -- cgit v1.1