| ... | @@ -798,6 +798,32 @@ const LinuxThreadImpl = struct { | ... | @@ -798,6 +798,32 @@ const LinuxThreadImpl = struct { |
| 798 | [len] "r" (self.mapped.len) | 798 | [len] "r" (self.mapped.len) |
| 799 | : "memory" | 799 | : "memory" |
| 800 | ), | 800 | ), |
| | 801 | .sparcv9 => asm volatile ( |
| | 802 | \\ # SPARCs really don't like it when active stack frames |
| | 803 | \\ # is unmapped (it will result in a segfault), so we |
| | 804 | \\ # force-deactivate it by running `restore` until |
| | 805 | \\ # all frames are cleared. |
| | 806 | \\ 1: |
| | 807 | \\ cmp %%sp, 0 |
| | 808 | \\ beq 2f |
| | 809 | \\ restore |
| | 810 | \\ ba 1f |
| | 811 | \\ 2: |
| | 812 | \\ mov 73, %%g1 |
| | 813 | \\ mov %[ptr], %%o0 |
| | 814 | \\ mov %[len], %%o1 |
| | 815 | \\ # Flush register window contents to prevent background |
| | 816 | \\ # memory access before unmapping the stack. |
| | 817 | \\ flushw |
| | 818 | \\ t 0x6d |
| | 819 | \\ mov 1, %%g1 |
| | 820 | \\ mov 1, %%o0 |
| | 821 | \\ t 0x6d |
| | 822 | : |
| | 823 | : [ptr] "r" (@ptrToInt(self.mapped.ptr)), |
| | 824 | [len] "r" (self.mapped.len) |
| | 825 | : "memory" |
| | 826 | ), |
| 801 | else => |cpu_arch| @compileError("Unsupported linux arch: " ++ @tagName(cpu_arch)), | 827 | else => |cpu_arch| @compileError("Unsupported linux arch: " ++ @tagName(cpu_arch)), |
| 802 | } | 828 | } |
| 803 | unreachable; | 829 | unreachable; |