On 2026-09-18 2:42, Yonggang Luo wrote:
Name guest trap numbers RX_EXCP_* in cpu.h. TCG loop codes such as
EXCP_INTERRUPT start at 0x10000. Translate privilege, illegal, BRK,
and INT through gen_helper_raise_excp. Prefix leftover TCG wait as
rx_wait, and drop unused raise_access_fault and the one-line
raise_exception wrapper. FPSW still exits with RX_EXCP_ACCESS.
Signed-off-by: Yonggang Luo <[email protected]>
---
target/rx/cpu.h | 13 ++++++++++++
target/rx/helper.c | 16 +++++++--------
target/rx/helper.h | 7 +------
target/rx/op_helper.c | 46 +++----------------------------------------
target/rx/translate.c | 19 ++++++++++--------
5 files changed, 36 insertions(+), 65 deletions(-)
diff --git a/target/rx/cpu.h b/target/rx/cpu.h
index 64ba48a7329..233615c32dc 100644
--- a/target/rx/cpu.h
+++ b/target/rx/cpu.h
@@ -71,6 +71,19 @@ enum {
NUM_REGS = 16,
};
+/*
+ * Guest trap numbers in cs->exception_index. TCG loop codes such as
+ * EXCP_INTERRUPT start at 0x10000 in cpu-common.h and do not overlap these.
The "TCG loop codes such as EXCP_INTERRUPT start at 0x10000 in
cpu-common.h and do not overlap these." comment is generic, why
mention it here?
+ */
+enum {
+ RX_EXCP_PRIVILEGE_VIOLATION = 20,
+ RX_EXCP_ACCESS = 21,
+ RX_EXCP_ILLEGAL_INSTRUCTION = 23,
+ RX_EXCP_FPU = 25,
+ RX_EXCP_NMI = 30,
+ RX_EXCP_INT = 0x100,
+};
Otherwise LGTM as a separate patch.