@@ -21,13 +21,13 @@
#include "qemu/osdep.h"
#include "qemu.h"
#include "cpu_loop-common.h"
+#include "signal-common.h"
#include "internal.h"
void cpu_loop(CPUHexagonState *env)
{
CPUState *cs = env_cpu(env);
- int trapnr, signum, sigcode;
- target_ulong sigaddr;
+ int trapnr;
target_ulong syscallnum;
target_ulong ret;
@@ -37,10 +37,6 @@ void cpu_loop(CPUHexagonState *env)
cpu_exec_end(cs);
process_queued_cpu_work(cs);
- signum = 0;
- sigcode = 0;
- sigaddr = 0;
-
switch (trapnr) {
case EXCP_INTERRUPT:
/* just indicate that signals should be handled asap */
@@ -66,8 +62,8 @@ void cpu_loop(CPUHexagonState *env)
case HEX_EXCP_FETCH_NO_UPAGE:
case HEX_EXCP_PRIV_NO_UREAD:
case HEX_EXCP_PRIV_NO_UWRITE:
- signum = TARGET_SIGSEGV;
- sigcode = TARGET_SEGV_MAPERR;
+ /* FIXME: need to store vaddr in hexagon_tlb_fill */
+ force_sigsegv_for_addr(0);
break;
case EXCP_ATOMIC:
cpu_exec_step_atomic(cs);
@@ -78,16 +74,6 @@ void cpu_loop(CPUHexagonState *env)
exit(EXIT_FAILURE);
}
- if (signum) {
- target_siginfo_t info = {
- .si_signo = signum,
- .si_errno = 0,
- .si_code = sigcode,
- ._sifields._sigfault._addr = sigaddr
- };
- queue_signal(env, info.si_signo, QEMU_SI_KILL, &info);
- }
-
process_pending_signals(env);
}
}
Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Note that we were incorrectly using QEMU_SI_KILL instead of QEMU_SI_FAULT for raising SIGSEGV. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/hexagon/cpu_loop.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) -- 2.25.1