Fix PowerPC restore_rt
Clang fails to compile the CBE translation of this code ("non-ASM
statement in naked function"). Similar to the implementations of
`restore_rt` on x86 and ARM, when the CBE is in use, this commit employs
alternative inline assembly that avoids using non-immediate input
operands.
This commit is contained in:
committed by
Alex Rønne Petersen
parent
a430be097b
commit
9f2a200a3f
@@ -247,11 +247,19 @@ pub fn clone() callconv(.naked) usize {
|
|||||||
pub const restore = restore_rt;
|
pub const restore = restore_rt;
|
||||||
|
|
||||||
pub fn restore_rt() callconv(.naked) noreturn {
|
pub fn restore_rt() callconv(.naked) noreturn {
|
||||||
asm volatile (
|
switch (@import("builtin").zig_backend) {
|
||||||
\\ sc
|
.stage2_c => asm volatile (
|
||||||
:
|
\\ li 0, %[number]
|
||||||
: [number] "{r0}" (@intFromEnum(SYS.rt_sigreturn)),
|
\\ sc
|
||||||
: .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true });
|
:
|
||||||
|
: [number] "i" (@intFromEnum(SYS.rt_sigreturn)),
|
||||||
|
: .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }),
|
||||||
|
else => _ = asm volatile (
|
||||||
|
\\ sc
|
||||||
|
:
|
||||||
|
: [number] "{r0}" (@intFromEnum(SYS.rt_sigreturn)),
|
||||||
|
: .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const F = struct {
|
pub const F = struct {
|
||||||
|
|||||||
@@ -232,11 +232,19 @@ pub fn clone() callconv(.naked) usize {
|
|||||||
pub const restore = restore_rt;
|
pub const restore = restore_rt;
|
||||||
|
|
||||||
pub fn restore_rt() callconv(.naked) noreturn {
|
pub fn restore_rt() callconv(.naked) noreturn {
|
||||||
asm volatile (
|
switch (@import("builtin").zig_backend) {
|
||||||
\\ sc
|
.stage2_c => asm volatile (
|
||||||
:
|
\\ li 0, %[number]
|
||||||
: [number] "{r0}" (@intFromEnum(SYS.rt_sigreturn)),
|
\\ sc
|
||||||
: .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true });
|
:
|
||||||
|
: [number] "i" (@intFromEnum(SYS.rt_sigreturn)),
|
||||||
|
: .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }),
|
||||||
|
else => _ = asm volatile (
|
||||||
|
\\ sc
|
||||||
|
:
|
||||||
|
: [number] "{r0}" (@intFromEnum(SYS.rt_sigreturn)),
|
||||||
|
: .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const F = struct {
|
pub const F = struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user