@@ -320,6 +320,7 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef DEBUG
gemu_log("freebsd syscall %d\n", num);
#endif
+ current_cpu = cpu; /* accessed by tracing events*/
if(do_strace)
print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
@@ -399,6 +400,7 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
#endif
if (do_strace)
print_freebsd_syscall_ret(num, ret);
+ current_cpu = NULL;
return ret;
efault:
ret = -TARGET_EFAULT;
@@ -5859,6 +5859,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef DEBUG
gemu_log("syscall %d", num);
#endif
+ current_cpu = cpu; /* accessed by tracing events*/
if(do_strace)
print_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
@@ -10240,6 +10241,7 @@ fail:
#endif
if(do_strace)
print_syscall_ret(num, ret);
+ current_cpu = NULL;
return ret;
efault:
ret = -TARGET_EFAULT;
Will be later used by tracing events. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> --- bsd-user/syscall.c | 2 ++ linux-user/syscall.c | 2 ++ 2 files changed, 4 insertions(+)