authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-21 05:28:16+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-23 09:27:17+02:00
log3777d3c25bb597998eea9cbc977519622e27eeab
tree35cbd5ffbee57ce9f8d2b27fe0ca6abb4bfedcd0
parentf6c06d7069bd347528f388d39dfbd4b451560ff6
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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


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

lib/std/Thread.zig+12
...@@ -1283,6 +1283,18 @@ const LinuxThreadImpl = struct {...@@ -1283,6 +1283,18 @@ const LinuxThreadImpl = struct {
1283 : [ptr] "r" (@intFromPtr(self.mapped.ptr)),1283 : [ptr] "r" (@intFromPtr(self.mapped.ptr)),
1284 [len] "r" (self.mapped.len),1284 [len] "r" (self.mapped.len),
1285 : .{ .memory = true }),1285 : .{ .memory = true }),
1286 .microblaze, .microblazeel => asm volatile (
1287 \\ ori r12, r0, 91 # SYS_munmap
1288 \\ ori r5, %[ptr], 0
1289 \\ ori r6, %[len], 0
1290 \\ brki r14, 0x8
1291 \\ ori r12, r0, 1 # SYS_exit
1292 \\ or r5, r0, r0
1293 \\ brki r14, 0x8
1294 :
1295 : [ptr] "r" (@intFromPtr(self.mapped.ptr)),
1296 [len] "r" (self.mapped.len),
1297 : .{ .memory = true }),
1286 // We set `sp` to the address of the current function as a workaround for a Linux1298 // We set `sp` to the address of the current function as a workaround for a Linux
1287 // kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid.1299 // kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid.
1288 // The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in1300 // The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in