mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std.os.linux: fix restore for powerpc/powerpc64
sigreturn and rt_sigreturn are distinct syscalls on PowerPC.
This commit is contained in:
parent
a7119d4269
commit
b2bc44e0d5
2 changed files with 30 additions and 2 deletions
|
|
@ -232,7 +232,21 @@ pub fn clone() callconv(.naked) u32 {
|
|||
);
|
||||
}
|
||||
|
||||
pub const restore = restore_rt;
|
||||
pub fn restore() callconv(.naked) noreturn {
|
||||
switch (builtin.zig_backend) {
|
||||
.stage2_c => asm volatile (
|
||||
\\ li 0, %[number]
|
||||
\\ sc
|
||||
:
|
||||
: [number] "i" (@intFromEnum(SYS.sigreturn)),
|
||||
),
|
||||
else => asm volatile (
|
||||
\\ sc
|
||||
:
|
||||
: [number] "{r0}" (@intFromEnum(SYS.sigreturn)),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn restore_rt() callconv(.naked) noreturn {
|
||||
switch (builtin.zig_backend) {
|
||||
|
|
|
|||
|
|
@ -217,7 +217,21 @@ pub fn clone() callconv(.naked) u64 {
|
|||
);
|
||||
}
|
||||
|
||||
pub const restore = restore_rt;
|
||||
pub fn restore() callconv(.naked) noreturn {
|
||||
switch (builtin.zig_backend) {
|
||||
.stage2_c => asm volatile (
|
||||
\\ li 0, %[number]
|
||||
\\ sc
|
||||
:
|
||||
: [number] "i" (@intFromEnum(SYS.sigreturn)),
|
||||
),
|
||||
else => asm volatile (
|
||||
\\ sc
|
||||
:
|
||||
: [number] "{r0}" (@intFromEnum(SYS.sigreturn)),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn restore_rt() callconv(.naked) noreturn {
|
||||
switch (builtin.zig_backend) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue