mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.Thread: implement freeAndExit() for m68k-linux
This commit is contained in:
parent
f723d69a58
commit
3d1b7811d4
1 changed files with 12 additions and 0 deletions
|
|
@ -1247,6 +1247,18 @@ const LinuxThreadImpl = struct {
|
||||||
: [ptr] "r" (@intFromPtr(self.mapped.ptr)),
|
: [ptr] "r" (@intFromPtr(self.mapped.ptr)),
|
||||||
[len] "r" (self.mapped.len),
|
[len] "r" (self.mapped.len),
|
||||||
: .{ .memory = true }),
|
: .{ .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
|
// 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.
|
// kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid.
|
||||||
// The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in
|
// The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue