Skip to content

Commit

Permalink
zig.h: Add zig_trap() and zig_breakpoint() implementations for Hexagon.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrp committed Nov 24, 2024
1 parent 62074ec commit aa19e71
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/zig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand All @@ -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__)
Expand Down

0 comments on commit aa19e71

Please sign in to comment.