Commit 06c2f5066e298d456e4a6ca24def8a84cc9ed31a
1 parent
bdfaf503
syscall insn fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1199 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
4 changed files
with
7 additions
and
7 deletions
target-i386/exec.h
... | ... | @@ -199,7 +199,7 @@ void helper_cpuid(void); |
199 | 199 | void helper_enter_level(int level, int data32); |
200 | 200 | void helper_sysenter(void); |
201 | 201 | void helper_sysexit(void); |
202 | -void helper_syscall(void); | |
202 | +void helper_syscall(int next_eip_addend); | |
203 | 203 | void helper_sysret(int dflag); |
204 | 204 | void helper_rdtsc(void); |
205 | 205 | void helper_rdmsr(void); | ... | ... |
target-i386/helper.c
... | ... | @@ -934,7 +934,7 @@ static void do_interrupt64(int intno, int is_int, int error_code, |
934 | 934 | env->eflags &= ~(TF_MASK | VM_MASK | RF_MASK | NT_MASK); |
935 | 935 | } |
936 | 936 | |
937 | -void helper_syscall(void) | |
937 | +void helper_syscall(int next_eip_addend) | |
938 | 938 | { |
939 | 939 | int selector; |
940 | 940 | |
... | ... | @@ -943,7 +943,7 @@ void helper_syscall(void) |
943 | 943 | } |
944 | 944 | selector = (env->star >> 32) & 0xffff; |
945 | 945 | if (env->hflags & HF_LMA_MASK) { |
946 | - ECX = env->eip; | |
946 | + ECX = env->eip + next_eip_addend; | |
947 | 947 | env->regs[11] = compute_eflags(); |
948 | 948 | |
949 | 949 | cpu_x86_set_cpl(env, 0); |
... | ... | @@ -963,7 +963,7 @@ void helper_syscall(void) |
963 | 963 | else |
964 | 964 | env->eip = env->cstar; |
965 | 965 | } else { |
966 | - ECX = (uint32_t)env->eip; | |
966 | + ECX = (uint32_t)(env->eip + next_eip_addend); | |
967 | 967 | |
968 | 968 | cpu_x86_set_cpl(env, 0); |
969 | 969 | cpu_x86_load_seg_cache(env, R_CS, selector & 0xfffc, |
... | ... | @@ -1119,8 +1119,8 @@ void do_interrupt(int intno, int is_int, int error_code, |
1119 | 1119 | fprintf(logfile, " EAX=" TARGET_FMT_lx, EAX); |
1120 | 1120 | } |
1121 | 1121 | fprintf(logfile, "\n"); |
1122 | - cpu_dump_state(env, logfile, fprintf, X86_DUMP_CCOP); | |
1123 | 1122 | #if 0 |
1123 | + cpu_dump_state(env, logfile, fprintf, X86_DUMP_CCOP); | |
1124 | 1124 | { |
1125 | 1125 | int i; |
1126 | 1126 | uint8_t *ptr; | ... | ... |
target-i386/op.c
target-i386/translate.c
... | ... | @@ -4626,7 +4626,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) |
4626 | 4626 | s->cc_op = CC_OP_DYNAMIC; |
4627 | 4627 | } |
4628 | 4628 | gen_jmp_im(pc_start - s->cs_base); |
4629 | - gen_op_syscall(); | |
4629 | + gen_op_syscall(s->pc - pc_start); | |
4630 | 4630 | gen_eob(s); |
4631 | 4631 | break; |
4632 | 4632 | case 0x107: /* sysret */ | ... | ... |