aboutsummaryrefslogtreecommitdiff
path: root/target-tilegx/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-tilegx/cpu.c')
-rw-r--r--target-tilegx/cpu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/target-tilegx/cpu.c b/target-tilegx/cpu.c
index 78b73e45c4..3c5481d443 100644
--- a/target-tilegx/cpu.c
+++ b/target-tilegx/cpu.c
@@ -22,6 +22,7 @@
#include "qemu-common.h"
#include "hw/qdev-properties.h"
#include "migration/vmstate.h"
+#include "linux-user/syscall_defs.h"
static void tilegx_cpu_dump_state(CPUState *cs, FILE *f,
fprintf_function cpu_fprintf, int flags)
@@ -121,8 +122,12 @@ static int tilegx_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw,
{
TileGXCPU *cpu = TILEGX_CPU(cs);
- cs->exception_index = TILEGX_EXCP_SEGV;
+ /* The sigcode field will be filled in by do_signal in main.c. */
+ cs->exception_index = TILEGX_EXCP_SIGNAL;
cpu->env.excaddr = address;
+ cpu->env.signo = TARGET_SIGSEGV;
+ cpu->env.sigcode = 0;
+
return 1;
}