aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-10-20 17:59:00 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2025-10-23 09:27:17 +0200
commit3d1b7811d4a09a5f7377c2d4122aab9217ded4e0 (patch)
tree156aaa07add7d445bf878614ecb3829d8e5b6973 /lib/std/Thread.zig
parentf723d69a5825221a87221d946d23d6b1093d70ab (diff)
downloadzig-3d1b7811d4a09a5f7377c2d4122aab9217ded4e0.tar.gz
zig-3d1b7811d4a09a5f7377c2d4122aab9217ded4e0.zip
std.Thread: implement freeAndExit() for m68k-linux
Diffstat (limited to 'lib/std/Thread.zig')
-rw-r--r--lib/std/Thread.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig
index ce4abada7d..049ea9e8b7 100644
--- a/lib/std/Thread.zig
+++ b/lib/std/Thread.zig
@@ -1247,6 +1247,18 @@ const LinuxThreadImpl = struct {
: [ptr] "r" (@intFromPtr(self.mapped.ptr)),
[len] "r" (self.mapped.len),
: .{ .memory = true }),
+ .m68k => asm volatile (
+ \\ move.l #91, %%d0 // SYS_munmap
+ \\ move.l %[ptr], %%d1
+ \\ move.l %[len], %%d2
+ \\ trap #0
+ \\ move.l #1, %%d0 // SYS_exit
+ \\ move.l #0, %%d1
+ \\ trap #0
+ :
+ : [ptr] "r" (@intFromPtr(self.mapped.ptr)),
+ [len] "r" (self.mapped.len),
+ : .{ .memory = true }),
// We set `sp` to the address of the current function as a workaround for a Linux
// kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid.
// The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in