[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/4] linux-user: add helper to set current_cpu befor
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [PATCH 2/4] linux-user: add helper to set current_cpu before cpu_loop() |
Date: |
Mon, 24 Aug 2015 20:41:08 -0400 |
There are as many versions of cpu_loop as architectures supported,
so introduce here a helper that is common to all of them.
Signed-off-by: Emilio G. Cota <address@hidden>
---
linux-user/main.c | 2 +-
linux-user/qemu.h | 6 ++++++
linux-user/syscall.c | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 3e10bd8..24c53ad 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -4405,7 +4405,7 @@ int main(int argc, char **argv, char **envp)
}
gdb_handlesig(cpu, 0);
}
- cpu_loop(env);
+ do_cpu_loop(env);
/* never exits */
return 0;
}
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index e8606b2..8af5e01 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -201,6 +201,12 @@ void init_qemu_uname_release(void);
void fork_start(void);
void fork_end(int child);
+static inline void do_cpu_loop(CPUArchState *env)
+{
+ current_cpu = ENV_GET_CPU(env);
+ cpu_loop(env);
+}
+
/* Creates the initial guest address space in the host memory space using
* the given host start address hint and size. The guest_start parameter
* specifies the start address of the guest space. guest_base will be the
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c7062ab..701c8fa 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4533,7 +4533,7 @@ static void *clone_func(void *arg)
/* Wait until the parent has finshed initializing the tls state. */
pthread_mutex_lock(&clone_lock);
pthread_mutex_unlock(&clone_lock);
- cpu_loop(env);
+ do_cpu_loop(env);
/* never exits */
return NULL;
}
--
1.9.1
[Qemu-devel] [RFC 04/38] translate-all: remove volatile from have_tb_lock, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 06/38] seqlock: add missing 'inline' to seqlock_read_retry, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 02/38] hw/i386/kvmvapic: add missing include of tcg.h, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 01/38] cpu-exec: add missing mmap_lock in tb_find_slow, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 10/38] translate-all: remove obsolete comment about l1_map, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 18/38] tcg: add fences, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 12/38] linux-user: call rcu_(un)register_thread on pthread_(exit|create), Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 05/38] thread-posix: inline qemu_spin functions, Emilio G. Cota, 2015/08/23