aboutsummaryrefslogtreecommitdiff
path: root/linux-user/hexagon
diff options
context:
space:
mode:
authorMatheus Tavares Bernardino <quic_mathbern@quicinc.com>2024-05-03 13:53:15 -0300
committerBrian Cain <bcain@quicinc.com>2024-06-08 17:48:50 -0700
commite1b526f1d86b7c51b97227989b9ba2925cc53069 (patch)
tree2eca193f6709a5e6f894fbe1483e45fb0f1c76b5 /linux-user/hexagon
parenta1852002c7509569eaaedb783925f34350fe0a84 (diff)
Hexagon: add PC alignment check and exception
The Hexagon Programmer's Reference Manual says that the exception 0x1e should be raised upon an unaligned program counter. Let's implement that and also add some tests. Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com> Reviewed-by: Brian Cain <bcain@quicinc.com> Message-Id: <277b7aeda2c717a96d4dde936b3ac77707cb6517.1714755107.git.quic_mathbern@quicinc.com> Signed-off-by: Brian Cain <bcain@quicinc.com>
Diffstat (limited to 'linux-user/hexagon')
-rw-r--r--linux-user/hexagon/cpu_loop.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linux-user/hexagon/cpu_loop.c b/linux-user/hexagon/cpu_loop.c
index 7f1499ed28..d41159e52a 100644
--- a/linux-user/hexagon/cpu_loop.c
+++ b/linux-user/hexagon/cpu_loop.c
@@ -60,6 +60,10 @@ void cpu_loop(CPUHexagonState *env)
env->gpr[0] = ret;
}
break;
+ case HEX_EXCP_PC_NOT_ALIGNED:
+ force_sig_fault(TARGET_SIGBUS, TARGET_BUS_ADRALN,
+ env->gpr[HEX_REG_R31]);
+ break;
case EXCP_ATOMIC:
cpu_exec_step_atomic(cs);
break;