diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-10-19 11:50:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-19 11:50:06 +0200 |
| commit | 38caa4902f87f63246d8bef9596f2cb7ad8bbbda (patch) | |
| tree | 06f9267cb6af6629221a32f858281ef5bbe946ef /lib/std/debug.zig | |
| parent | c37d23f45ae6bd0db6b072180d7b84566c7dc8a2 (diff) | |
| parent | 08014589e291d9ffc8ba4d7abc9a669bfd0c3bec (diff) | |
| download | zig-38caa4902f87f63246d8bef9596f2cb7ad8bbbda.tar.gz zig-38caa4902f87f63246d8bef9596f2cb7ad8bbbda.zip | |
Merge pull request #25623 from alexrp/or1k
Add `or1k-linux` support (via CBE)
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index b58bb315db..ec08244383 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -988,6 +988,8 @@ const StackIterator = union(enum) { // On LoongArch and RISC-V, the frame pointer points to the top of the saved register area, // in which the base pointer is the first word. if (native_arch.isLoongArch() or native_arch.isRISCV()) break :off -2 * @sizeOf(usize); + // On OpenRISC, the frame pointer is stored below the return address. + if (native_arch == .or1k) break :off -2 * @sizeOf(usize); // On SPARC, the frame pointer points to the save area which holds 16 slots for the local // and incoming registers. The base pointer (i6) is stored in its customary save slot. if (native_arch.isSPARC()) break :off 14 * @sizeOf(usize); @@ -999,7 +1001,9 @@ const StackIterator = union(enum) { const fp_to_ra_offset = off: { // On LoongArch and RISC-V, the frame pointer points to the top of the saved register area, // in which the return address is the second word. - if (native_arch.isRISCV() or native_arch.isLoongArch()) break :off -1 * @sizeOf(usize); + if (native_arch.isLoongArch() or native_arch.isRISCV()) break :off -1 * @sizeOf(usize); + // On OpenRISC, the return address is stored below the stack parameter area. + if (native_arch == .or1k) break :off -1 * @sizeOf(usize); if (native_arch.isPowerPC64()) break :off 2 * @sizeOf(usize); // On s390x, r14 is the link register and we need to grab it from its customary slot in the // register save area (ELF ABI s390x Supplement §1.2.2.2). |
