aboutsummaryrefslogtreecommitdiff
path: root/target-tilegx
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2015-09-27 14:26:04 -0700
committerRichard Henderson <rth@twiddle.net>2015-10-07 20:03:15 +1100
commita0577d2aa9bd42d5d584fa03649a166ba45c2f3d (patch)
tree3aefc90eb42de4c32213479c96d94bdfc2115dd1 /target-tilegx
parentdd8070d865ad1b32876931f812a80645f97112ff (diff)
target-tilegx: Use TILEGX_EXCP_SIGNAL instead of TILEGX_EXCP_SEGV
Consolidate signal handling under a single exception. Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-tilegx')
-rw-r--r--target-tilegx/cpu.c7
-rw-r--r--target-tilegx/cpu.h3
2 files changed, 7 insertions, 3 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;
}
diff --git a/target-tilegx/cpu.h b/target-tilegx/cpu.h
index 023ccd4735..6f04fe7fb2 100644
--- a/target-tilegx/cpu.h
+++ b/target-tilegx/cpu.h
@@ -60,8 +60,7 @@ enum {
typedef enum {
TILEGX_EXCP_NONE = 0,
TILEGX_EXCP_SYSCALL = 1,
- TILEGX_EXCP_SEGV = 2,
- TILEGX_EXCP_SIGNAL = 3,
+ TILEGX_EXCP_SIGNAL = 2,
TILEGX_EXCP_OPCODE_UNKNOWN = 0x101,
TILEGX_EXCP_OPCODE_UNIMPLEMENTED = 0x102,
TILEGX_EXCP_OPCODE_CMPEXCH = 0x103,