aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-10-21 05:28:16 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2025-10-23 09:27:17 +0200
commit3777d3c25bb597998eea9cbc977519622e27eeab (patch)
tree35cbd5ffbee57ce9f8d2b27fe0ca6abb4bfedcd0 /lib/std/Thread.zig
parentf6c06d7069bd347528f388d39dfbd4b451560ff6 (diff)
downloadzig-3777d3c25bb597998eea9cbc977519622e27eeab.tar.gz
zig-3777d3c25bb597998eea9cbc977519622e27eeab.zip
std.Thread: implement freeAndExit() for microblaze-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 3c7536ea21..fdf1a6f4d8 100644
--- a/lib/std/Thread.zig
+++ b/lib/std/Thread.zig
@@ -1283,6 +1283,18 @@ const LinuxThreadImpl = struct {
: [ptr] "r" (@intFromPtr(self.mapped.ptr)),
[len] "r" (self.mapped.len),
: .{ .memory = true }),
+ .microblaze, .microblazeel => asm volatile (
+ \\ ori r12, r0, 91 # SYS_munmap
+ \\ ori r5, %[ptr], 0
+ \\ ori r6, %[len], 0
+ \\ brki r14, 0x8
+ \\ ori r12, r0, 1 # SYS_exit
+ \\ or r5, r0, r0
+ \\ brki r14, 0x8
+ :
+ : [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