@@ -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;
}
@@ -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
@@ -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;
}
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 <cota@braap.org> --- linux-user/main.c | 2 +- linux-user/qemu.h | 6 ++++++ linux-user/syscall.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-)