am,nemu: use standard debug instructions for nemu_trap
This commit is contained in:
parent
f9b9b390fb
commit
d5fe878987
1 changed files with 3 additions and 3 deletions
|
@ -7,11 +7,11 @@
|
||||||
// it will be expanded as "x86/x86.h", "mips/mips32.h", ...
|
// it will be expanded as "x86/x86.h", "mips/mips32.h", ...
|
||||||
|
|
||||||
#if defined(__ISA_X86__)
|
#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__)
|
#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__)
|
#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
|
#elif
|
||||||
# error unsupported ISA __ISA__
|
# error unsupported ISA __ISA__
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue