diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-10-02 17:58:33 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-10-02 17:58:33 +0000 |
commit | 93eac243d523b473dd33f6fc84ffa15ed2f018d9 (patch) | |
tree | 28c610c3e4f42ec724e54765124d3de223a4e745 /kqemu.c | |
parent | a7e6f8ba22f7406aa13048979c6573d80dac5605 (diff) |
32 bit syscall fix (Juergen Keil)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2189 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'kqemu.c')
-rw-r--r-- | kqemu.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |