| ... | ... | @@ -51,6 +51,16 @@ pub fn fromPosixSignalContext(ctx_ptr: ?*const anyopaque) ?Native { |
| 51 | 51 | std.mem.reverse(native.r[0..]); |
| 52 | 52 | |
| 53 | 53 | return native; |
| 54 | } else if (native_arch == .loongarch32 and native_os == .linux) { |
| 55 | // The 32-bit kABI (added later) kept the 64-bit layout. |
| 56 | return .{ |
| 57 | .r = s: { |
| 58 | var regs: [32]LoongArch.Gpr = undefined; |
| 59 | for (uc.mcontext.r, 0..) |r, i| regs[i] = @truncate(r); |
| 60 | break :s regs; |
| 61 | }, |
| 62 | .pc = @truncate(uc.mcontext.pc), |
| 63 | }; |
| 54 | 64 | } else if (native_arch.isMIPS32() and native_os == .linux) { |
| 55 | 65 | // The O32 kABI uses 64-bit fields for some reason. |
| 56 | 66 | return .{ |
| ... | ... | @@ -1754,6 +1764,7 @@ const signal_ucontext_t = switch (native_os) { |
| 1754 | 1764 | .aarch64, |
| 1755 | 1765 | .aarch64_be, |
| 1756 | 1766 | // https://github.com/torvalds/linux/blob/cd5a0afbdf8033dc83786315d63f8b325bdba2fd/arch/loongarch/include/uapi/asm/ucontext.h |
| 1767 | .loongarch32, |
| 1757 | 1768 | .loongarch64, |
| 1758 | 1769 | // https://github.com/torvalds/linux/blob/cd5a0afbdf8033dc83786315d63f8b325bdba2fd/arch/powerpc/include/uapi/asm/ucontext.h |
| 1759 | 1770 | .powerpc64, |
| ... | ... | @@ -1777,7 +1788,7 @@ const signal_ucontext_t = switch (native_os) { |
| 1777 | 1788 | pc: u64, |
| 1778 | 1789 | }, |
| 1779 | 1790 | // https://github.com/torvalds/linux/blob/cd5a0afbdf8033dc83786315d63f8b325bdba2fd/arch/loongarch/include/uapi/asm/sigcontext.h |
| 1780 | | .loongarch64 => extern struct { |
| 1791 | .loongarch32, .loongarch64 => extern struct { |
| 1781 | 1792 | pc: u64 align(16), |
| 1782 | 1793 | r: [32]u64, |
| 1783 | 1794 | }, |