diff mbox

[4/5] user: Set current vCPU during syscall execution

Message ID 145625174988.12025.2541064572501885088.stgit@localhost
State New
Headers show

Commit Message

Lluís Vilanova Feb. 23, 2016, 6:22 p.m. UTC
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(+)
diff mbox

Patch

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;