[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/5] user: Set current vCPU during syscall execution
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH 4/5] user: Set current vCPU during syscall execution |
Date: |
Tue, 23 Feb 2016 19:22:30 +0100 |
User-agent: |
StGit/0.17.1-dirty |
Will be later used by tracing events.
Signed-off-by: Lluís Vilanova <address@hidden>
---
bsd-user/syscall.c | 2 ++
linux-user/syscall.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
index 35f784c..ce941b0 100644
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -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;
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 54ce14a..52f9d85 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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;