From 87d7bfdba1d4a963e9a89052c38a32327fa25473 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 20 Dec 2021 18:50:06 -0800 Subject: linux-user/nios2: Properly emulate EXCP_TRAP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The real kernel has to load the instruction and extract the imm5 field; for qemu, modify the translator to do this. The use of R_AT for this in cpu_loop was a bug. Handle the other trap numbers as per the kernel's trap_table. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20211221025012.1057923-2-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/nios2/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target/nios2/cpu.h') diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 1a69ed7..d2ba0c5 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -160,9 +160,9 @@ struct CPUNios2State { #if !defined(CONFIG_USER_ONLY) Nios2MMU mmu; - uint32_t irq_pending; #endif + int error_code; }; /** -- cgit v1.1