On Fri, Feb 27, 2026 at 1:37 PM Brian Cain <[email protected]> wrote:
> From: Brian Cain <[email protected]> > > Signed-off-by: Brian Cain <[email protected]> > --- > target/hexagon/internal.h | 5 +++++ > target/hexagon/op_helper.c | 19 +++++++++++++++++++ > 2 files changed, 24 insertions(+) > > diff --git a/target/hexagon/internal.h b/target/hexagon/internal.h > index cd06ff41d4f..d94f84b46a7 100644 > --- a/target/hexagon/internal.h > +++ b/target/hexagon/internal.h > @@ -31,6 +31,11 @@ void hexagon_debug(CPUHexagonState *env); > > extern const char * const hexagon_regnames[TOTAL_PER_THREAD_REGS]; > > +void G_NORETURN do_raise_exception(CPUHexagonState *env, > + uint32_t exception, > + target_ulong PC, > + uintptr_t retaddr); > + > #ifndef CONFIG_USER_ONLY > extern const VMStateDescription vmstate_hexagon_cpu; > #endif > diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c > index 13e3c2c3a41..54b22f2fee4 100644 > --- a/target/hexagon/op_helper.c > +++ b/target/hexagon/op_helper.c > @@ -37,6 +37,25 @@ > #define SF_MANTBITS 23 > > /* Exceptions processing helpers */ > +G_NORETURN > +void do_raise_exception(CPUHexagonState *env, uint32_t exception, > + target_ulong PC, uintptr_t retaddr) > +{ > + CPUState *cs = env_cpu(env); > +#ifdef CONFIG_USER_ONLY > + qemu_log_mask(CPU_LOG_INT, "%s: 0x%08x\n", __func__, exception); > +#else > + qemu_log_mask(CPU_LOG_INT, "%s: 0x%08x, @ %08" PRIx32 "\n", > + __func__, exception, PC); > Just print this in both user and system mode. Also, use PRIx32 instead of the x in the format string. > + > + ASSERT_DIRECT_TO_GUEST_UNSET(env, exception); > Consider defining this macro to a nop in user mode. Then you don't need the #ifdef CONFIG_USER_ONLY in this function. > +#endif > > Otherwise Reviewed-by: Taylor Simpson <[email protected]>
