mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
target/i386: implement SYSCALL/SYSRET in 32-bit emulators
AMD supports both 32-bit and 64-bit SYSCALL/SYSRET, but the TCG only exposes it for 64-bit targets. For system emulation just reuse the helper; for user-mode emulation the ABI is the same as "int $80". The BSDs does not support any fast system call mechanism in 32-bit mode so add to bsd-user the same stub that FreeBSD has for 64-bit compatibility mode. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6750485bf4
commit
63fd8ef080
8 changed files with 20 additions and 17 deletions
|
@ -211,6 +211,9 @@ void cpu_loop(CPUX86State *env)
|
|||
|
||||
switch(trapnr) {
|
||||
case 0x80:
|
||||
#ifndef TARGET_X86_64
|
||||
case EXCP_SYSCALL:
|
||||
#endif
|
||||
/* linux syscall from int $0x80 */
|
||||
ret = do_syscall(env,
|
||||
env->regs[R_EAX],
|
||||
|
@ -227,9 +230,9 @@ void cpu_loop(CPUX86State *env)
|
|||
env->regs[R_EAX] = ret;
|
||||
}
|
||||
break;
|
||||
#ifndef TARGET_ABI32
|
||||
#ifdef TARGET_X86_64
|
||||
case EXCP_SYSCALL:
|
||||
/* linux syscall from syscall instruction */
|
||||
/* linux syscall from syscall instruction. */
|
||||
ret = do_syscall(env,
|
||||
env->regs[R_EAX],
|
||||
env->regs[R_EDI],
|
||||
|
@ -245,8 +248,6 @@ void cpu_loop(CPUX86State *env)
|
|||
env->regs[R_EAX] = ret;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef TARGET_X86_64
|
||||
case EXCP_VSYSCALL:
|
||||
emulate_vsyscall(env);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue