| ... | @@ -1130,6 +1130,19 @@ const LinuxThreadImpl = struct { | ... | @@ -1130,6 +1130,19 @@ const LinuxThreadImpl = struct { |
| 1130 | [len] "r" (self.mapped.len), | 1130 | [len] "r" (self.mapped.len), |
| 1131 | : "memory" | 1131 | : "memory" |
| 1132 | ), | 1132 | ), |
| | 1133 | .hexagon => asm volatile ( |
| | 1134 | \\ r6 = #215 // SYS_munmap |
| | 1135 | \\ r0 = %[ptr] |
| | 1136 | \\ r1 = %[len] |
| | 1137 | \\ trap0(#1) |
| | 1138 | \\ r6 = #93 // SYS_exit |
| | 1139 | \\ r0 = #0 |
| | 1140 | \\ trap0(#1) |
| | 1141 | : |
| | 1142 | : [ptr] "r" (@intFromPtr(self.mapped.ptr)), |
| | 1143 | [len] "r" (self.mapped.len), |
| | 1144 | : "memory" |
| | 1145 | ), |
| 1133 | // We set `sp` to the address of the current function as a workaround for a Linux | 1146 | // We set `sp` to the address of the current function as a workaround for a Linux |
| 1134 | // kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid. | 1147 | // kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid. |
| 1135 | // The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in | 1148 | // The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in |