From dd8070d865ad1b32876931f812a80645f97112ff Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Sat, 26 Sep 2015 13:00:35 +0800 Subject: target-tilegx: Decode ill pseudo-instructions Notice raise and bpt, decoding the constants embedded in the nop addil instruction in the x0 slot. [rth: Generalize TILEGX_EXCP_OPCODE_ILL to TILEGX_EXCP_SIGNAL. Drop validation of signal values.] Signed-off-by: Chen Gang Message-Id: <1443243635-4886-1-git-send-email-gang.chen.5i5j@gmail.com> Signed-off-by: Richard Henderson --- linux-user/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'linux-user/main.c') diff --git a/linux-user/main.c b/linux-user/main.c index 6599a41..9e8b92b 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3436,6 +3436,17 @@ static void gen_sigill_reg(CPUTLGState *env) queue_signal(env, info.si_signo, &info); } +static void do_signal(CPUTLGState *env) +{ + target_siginfo_t info; + + info.si_signo = env->signo; + info.si_errno = 0; + info.si_code = env->sigcode; + info._sifields._sigfault._addr = env->pc; + queue_signal(env, info.si_signo, &info); +} + static void set_regval(CPUTLGState *env, uint8_t reg, uint64_t val) { if (unlikely(reg >= TILEGX_R_COUNT)) { @@ -3622,6 +3633,9 @@ void cpu_loop(CPUTLGState *env) case TILEGX_EXCP_OPCODE_FETCHOR4: do_fetch(env, trapnr, false); break; + case TILEGX_EXCP_SIGNAL: + do_signal(env); + break; case TILEGX_EXCP_REG_IDN_ACCESS: case TILEGX_EXCP_REG_UDN_ACCESS: gen_sigill_reg(env); -- cgit v1.1