zig.h: Add zig_trap() and zig_breakpoint() implementations for Hexagon.

This commit is contained in:
Alex Rønne Petersen 2024-11-24 08:18:41 +01:00
parent 62074ec61b
commit aa19e71a27
No known key found for this signature in database

View File

@ -256,6 +256,8 @@ typedef char bool;
#define zig_trap() __asm__ volatile("udf #0xfe")
#elif defined(__arm__) || defined(__aarch64__)
#define zig_trap() __asm__ volatile("udf #0xfdee")
#elif defined(__hexagon__)
#define zig_trap() __asm__ volatile("r27:26 = memd(#0xbadc0fee)")
#elif defined(__loongarch__) || defined(__powerpc__)
#define zig_trap() __asm__ volatile(".word 0x0")
#elif defined(__mips__)
@ -280,6 +282,8 @@ typedef char bool;
#define zig_breakpoint() __asm__ volatile("bkpt #0x0")
#elif defined(__aarch64__)
#define zig_breakpoint() __asm__ volatile("brk #0xf000")
#elif defined(__hexagon__)
#define zig_breakpoint() __asm__ volatile("brkpt")
#elif defined(__loongarch__)
#define zig_breakpoint() __asm__ volatile("break 0x0")
#elif defined(__mips__)