aboutsummaryrefslogtreecommitdiff
path: root/cpu-all.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-10-28 10:52:42 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2011-11-01 10:58:08 -0500
commitb3c4bbe56dc707102d3abd969f51bb2aa9c6c53d (patch)
tree4494108465a1d39a4421da8c945db566a6691089 /cpu-all.h
parent8a5f7b03a0a711ec8e04aeebe339cdb8b876794b (diff)
Make cpu_single_env thread-local
Make cpu_single_env thread-local. This fixes a regression in handling of multi-threaded programs in linux-user mode (bug 823902). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [Peter Maydell: rename tls_cpu_single_env to cpu_single_env] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'cpu-all.h')
-rw-r--r--cpu-all.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/cpu-all.h b/cpu-all.h
index 42a5fa0a7c..5f47ab8df9 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -20,6 +20,7 @@
#define CPU_ALL_H
#include "qemu-common.h"
+#include "qemu-tls.h"
#include "cpu-common.h"
/* some important defines:
@@ -334,7 +335,8 @@ void cpu_dump_statistics(CPUState *env, FILE *f, fprintf_function cpu_fprintf,
void QEMU_NORETURN cpu_abort(CPUState *env, const char *fmt, ...)
GCC_FMT_ATTR(2, 3);
extern CPUState *first_cpu;
-extern CPUState *cpu_single_env;
+DECLARE_TLS(CPUState *,cpu_single_env);
+#define cpu_single_env get_tls(cpu_single_env)
/* Flags for use in ENV->INTERRUPT_PENDING.