X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/986563b173ca2d4bd47b10455b19c86e5cd5bba2..ac873f1ed5060653719320d562bff7c8f6c4e6a9:/user-exec.c diff --git a/user-exec.c b/user-exec.c index abf688546e..b2a4261eca 100644 --- a/user-exec.c +++ b/user-exec.c @@ -38,10 +38,10 @@ //#define DEBUG_SIGNAL -static void exception_action(CPUState *env1) +static void exception_action(CPUArchState *env1) { #if defined(TARGET_I386) - raise_exception_err_env(env1, env1->exception_index, env1->error_code); + raise_exception_err(env1, env1->exception_index, env1->error_code); #else cpu_loop_exit(env1); #endif @@ -50,7 +50,7 @@ static void exception_action(CPUState *env1) /* exit the current TB from a signal handler. The host registers are restored in a state compatible with the CPU emulator */ -void cpu_resume_from_signal(CPUState *env1, void *puc) +void cpu_resume_from_signal(CPUArchState *env1, void *puc) { #ifdef __linux__ struct ucontext *uc = puc; @@ -82,7 +82,7 @@ void cpu_resume_from_signal(CPUState *env1, void *puc) the effective address of the memory exception. 'is_write' is 1 if a write caused the exception and otherwise 0'. 'old_set' is the signal set which should be restored */ -static inline int handle_cpu_signal(unsigned long pc, unsigned long address, +static inline int handle_cpu_signal(uintptr_t pc, unsigned long address, int is_write, sigset_t *old_set, void *puc) { @@ -97,7 +97,8 @@ static inline int handle_cpu_signal(unsigned long pc, unsigned long address, pc, address, is_write, *(unsigned long *)old_set); #endif /* XXX: locking issue */ - if (is_write && page_unprotect(h2g(address), pc, puc)) { + if (is_write && h2g_valid(address) + && page_unprotect(h2g(address), pc, puc)) { return 1; }