@samitouri / QOSamiQemu / commits / 211201cc5b

target/hexagon: Add TCG overrides for rte, nmi

Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>

Brian Cain committed Jun 22, 2026 at 15:28 UTC 211201cc5bd40a84c5a51a57b3c73761095c0135
4 files changed +28
target/hexagon/gen_tcg_sys.h
+16
@@ -95,4 +95,20 @@
95 gen_helper_stop(tcg_env); \
96 } while (0)
97
98 +/*
99 + * rte (return from exception)
100 + * Clear the EX bit in SSR
101 + * Jump to ELR
102 + */
103 +#define fGEN_TCG_J2_rte(SHORTCODE) \
104 + do { \
105 + TCGv_i32 new_ssr = tcg_temp_new_i32(); \
106 + tcg_gen_deposit_tl(new_ssr, hex_t_sreg[HEX_SREG_SSR], \
107 + tcg_constant_tl(0), \
108 + reg_field_info[SSR_EX].offset, \
109 + reg_field_info[SSR_EX].width); \
110 + gen_log_sreg_write(ctx, HEX_SREG_SSR, new_ssr); \
111 + gen_jumpr(ctx, hex_t_sreg[HEX_SREG_ELR]); \
112 + } while (0)
113 +
114 #endif
target/hexagon/helper.h
+3
@@ -127,4 +127,7 @@ DEF_HELPER_2(start, void, env, i32)
127 DEF_HELPER_1(stop, void, env)
128 DEF_HELPER_2(wait, void, env, i32)
129 DEF_HELPER_2(resume, void, env, i32)
130 +DEF_HELPER_1(resched, void, env)
131 +DEF_HELPER_3(modify_ssr, void, env, i32, i32)
132 +DEF_HELPER_1(pending_interrupt, void, env)
133 #endif
target/hexagon/op_helper.c
+6
@@ -1480,6 +1480,12 @@ void HELPER(setprio)(CPUHexagonState *env, uint32_t thread, uint32_t prio)
1480 g_assert_not_reached();
1481 }
1482
1483 +
1484 +void HELPER(pending_interrupt)(CPUHexagonState *env)
1485 +{
1486 + BQL_LOCK_GUARD();
1487 + hex_interrupt_update(env);
1488 +}
1489 #endif
1490
1491
target/hexagon/sys_macros.h
+3
@@ -236,4 +236,7 @@
236
237 #define NUM_TLB_REGS(x) (hexagon_tlb_get_num_entries(env_archcpu(env)->tlb))
238
239 +/* NMI routing not yet implemented; Y4_nmi is a no-op for now */
240 +#define fDO_NMI(THREAD_MASK) do { } while (0)
241 +
242 #endif