From d5fe878987b6f4b547c81b71897eabb7fb250940 Mon Sep 17 00:00:00 2001 From: Zihao Yu Date: Wed, 19 Jan 2022 20:15:12 +0800 Subject: [PATCH] am,nemu: use standard debug instructions for nemu_trap --- am/src/platform/nemu/include/nemu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/am/src/platform/nemu/include/nemu.h b/am/src/platform/nemu/include/nemu.h index 92bf7f2..b2fa83d 100644 --- a/am/src/platform/nemu/include/nemu.h +++ b/am/src/platform/nemu/include/nemu.h @@ -7,11 +7,11 @@ // it will be expanded as "x86/x86.h", "mips/mips32.h", ... #if defined(__ISA_X86__) -# define nemu_trap(code) asm volatile (".byte 0xd6" : :"a"(code)) +# define nemu_trap(code) asm volatile ("int3" : :"a"(code)) #elif defined(__ISA_MIPS32__) -# define nemu_trap(code) asm volatile ("move $v0, %0; .word 0xf0000000" : :"r"(code)) +# define nemu_trap(code) asm volatile ("move $v0, %0; sdbbp" : :"r"(code)) #elif defined(__ISA_RISCV32__) || defined(__ISA_RISCV64__) -# define nemu_trap(code) asm volatile("mv a0, %0; .word 0x0000006b" : :"r"(code)) +# define nemu_trap(code) asm volatile("mv a0, %0; ebreak" : :"r"(code)) #elif # error unsupported ISA __ISA__ #endif