aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2015-09-26 13:00:35 +0800
committerRichard Henderson <rth@twiddle.net>2015-10-07 20:03:15 +1100
commitdd8070d865ad1b32876931f812a80645f97112ff (patch)
tree8817853137d05d0a14298dd80ffae1b8c1612686 /linux-user
parentbf0f60a61b92f4f9ddf09a3cf4fc41796fa42aed (diff)
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 <gang.chen.5i5j@gmail.com> Message-Id: <1443243635-4886-1-git-send-email-gang.chen.5i5j@gmail.com> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 6599a41404..9e8b92b03c 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);