[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-cpu v2 15/40] cpu: Move jmp_env field from CPU_C
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-cpu v2 15/40] cpu: Move jmp_env field from CPU_COMMON to CPUState |
Date: |
Mon, 10 Mar 2014 01:15:24 +0100 |
Signed-off-by: Andreas Färber <address@hidden>
---
cpu-exec.c | 8 +++++---
include/exec/cpu-defs.h | 2 --
include/qom/cpu.h | 2 ++
user-exec.c | 3 ++-
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/cpu-exec.c b/cpu-exec.c
index dd8da53..3e17ff5 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -28,7 +28,7 @@ void cpu_loop_exit(CPUArchState *env)
CPUState *cpu = ENV_GET_CPU(env);
cpu->current_tb = NULL;
- siglongjmp(env->jmp_env, 1);
+ siglongjmp(cpu->jmp_env, 1);
}
/* exit the current TB from a signal handler. The host registers are
@@ -37,10 +37,12 @@ void cpu_loop_exit(CPUArchState *env)
#if defined(CONFIG_SOFTMMU)
void cpu_resume_from_signal(CPUArchState *env, void *puc)
{
+ CPUState *cpu = ENV_GET_CPU(env);
+
/* XXX: restore cpu registers saved in host registers */
env->exception_index = -1;
- siglongjmp(env->jmp_env, 1);
+ siglongjmp(cpu->jmp_env, 1);
}
#endif
@@ -284,7 +286,7 @@ int cpu_exec(CPUArchState *env)
/* prepare setjmp context for exception handling */
for(;;) {
- if (sigsetjmp(env->jmp_env, 0) == 0) {
+ if (sigsetjmp(cpu->jmp_env, 0) == 0) {
/* if an exception is pending, we execute it here */
if (env->exception_index >= 0) {
if (env->exception_index >= EXCP_INTERRUPT) {
diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h
index 2ba3df7..dfb1289 100644
--- a/include/exec/cpu-defs.h
+++ b/include/exec/cpu-defs.h
@@ -24,7 +24,6 @@
#endif
#include "config.h"
-#include <setjmp.h>
#include <inttypes.h>
#include "qemu/osdep.h"
#include "qemu/queue.h"
@@ -140,7 +139,6 @@ typedef struct CPUWatchpoint {
CPUWatchpoint *watchpoint_hit; \
\
/* Core interrupt code */ \
- sigjmp_buf jmp_env; \
int exception_index; \
\
/* user data */ \
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index ada8a5a..04bfd72 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -21,6 +21,7 @@
#define QEMU_CPU_H
#include <signal.h>
+#include <setjmp.h>
#include "hw/qdev-core.h"
#include "exec/hwaddr.h"
#include "qemu/queue.h"
@@ -216,6 +217,7 @@ struct CPUState {
uint32_t interrupt_request;
int singlestep_enabled;
int64_t icount_extra;
+ sigjmp_buf jmp_env;
AddressSpace *as;
MemoryListener *tcg_as_listener;
diff --git a/user-exec.c b/user-exec.c
index d850d41..dec636e 100644
--- a/user-exec.c
+++ b/user-exec.c
@@ -52,6 +52,7 @@ static void exception_action(CPUArchState *env1)
*/
void cpu_resume_from_signal(CPUArchState *env1, void *puc)
{
+ CPUState *cpu = ENV_GET_CPU(env1);
#ifdef __linux__
struct ucontext *uc = puc;
#elif defined(__OpenBSD__)
@@ -71,7 +72,7 @@ void cpu_resume_from_signal(CPUArchState *env1, void *puc)
#endif
}
env1->exception_index = -1;
- siglongjmp(env1->jmp_env, 1);
+ siglongjmp(cpu->jmp_env, 1);
}
/* 'pc' is the host PC at which the exception was raised. 'address' is
--
1.8.4.5
- [Qemu-devel] [PATCH qom-cpu v2 08/40] target-xtensa: Clean up ENV_GET_CPU() usage, (continued)
- [Qemu-devel] [PATCH qom-cpu v2 11/40] cpu: Move can_do_io field from CPU_COMMON to CPUState, Andreas Färber, 2014/03/09
- [Qemu-devel] [PATCH qom-cpu v2 10/40] cpu: Move mem_io_{pc, vaddr} fields from CPU_COMMON to CPUState, Andreas Färber, 2014/03/09
- [Qemu-devel] [PATCH qom-cpu v2 13/40] cpu: Move icount_decr field from CPU_COMMON to CPUState, Andreas Färber, 2014/03/09
- [Qemu-devel] [PATCH qom-cpu v2 12/40] cpu: Move icount_extra field from CPU_COMMON to CPUState, Andreas Färber, 2014/03/09
- [Qemu-devel] [PATCH qom-cpu v2 14/40] cpu: Move tb_jmp_cache field from CPU_COMMON to CPUState, Andreas Färber, 2014/03/09
- [Qemu-devel] [PATCH qom-cpu v2 15/40] cpu: Move jmp_env field from CPU_COMMON to CPUState,
Andreas Färber <=
- [Qemu-devel] [PATCH qom-cpu v2 17/40] cpu: Move opaque field from CPU_COMMON to CPUState, Andreas Färber, 2014/03/09
- [Qemu-devel] [PATCH qom-cpu v2 18/40] cpu: Move watchpoint fields from CPU_COMMON to CPUState, Andreas Färber, 2014/03/09
- [Qemu-devel] [PATCH qom-cpu v2 16/40] cpu: Move exception_index field from CPU_COMMON to CPUState, Andreas Färber, 2014/03/09
- [Qemu-devel] [PATCH qom-cpu v2 19/40] cpu: Move breakpoints field from CPU_COMMON to CPUState, Andreas Färber, 2014/03/09
[Qemu-devel] [PATCH qom-cpu v2 20/40] exec: Change tlb_fill() argument to CPUState, Andreas Färber, 2014/03/09