authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-20 17:59:00+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-23 09:27:17+02:00
log3d1b7811d4a09a5f7377c2d4122aab9217ded4e0
tree156aaa07add7d445bf878614ecb3829d8e5b6973
parentf723d69a5825221a87221d946d23d6b1093d70ab
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Thread: implement freeAndExit() for m68k-linux


1 files changed, 12 insertions(+), 0 deletions(-)

lib/std/Thread.zig+12
...@@ -1247,6 +1247,18 @@ const LinuxThreadImpl = struct {...@@ -1247,6 +1247,18 @@ const LinuxThreadImpl = struct {
1247 : [ptr] "r" (@intFromPtr(self.mapped.ptr)),1247 : [ptr] "r" (@intFromPtr(self.mapped.ptr)),
1248 [len] "r" (self.mapped.len),1248 [len] "r" (self.mapped.len),
1249 : .{ .memory = true }),1249 : .{ .memory = true }),
1250 .m68k => asm volatile (
1251 \\ move.l #91, %%d0 // SYS_munmap
1252 \\ move.l %[ptr], %%d1
1253 \\ move.l %[len], %%d2
1254 \\ trap #0
1255 \\ move.l #1, %%d0 // SYS_exit
1256 \\ move.l #0, %%d1
1257 \\ trap #0
1258 :
1259 : [ptr] "r" (@intFromPtr(self.mapped.ptr)),
1260 [len] "r" (self.mapped.len),
1261 : .{ .memory = true }),
1250 // We set `sp` to the address of the current function as a workaround for a Linux1262 // We set `sp` to the address of the current function as a workaround for a Linux
1251 // kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid.1263 // kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid.
1252 // The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in1264 // The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in