mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
x86_64: remove returns from naked functions
This commit is contained in:
parent
1980f5479b
commit
fde1ec5d0e
@ -125,36 +125,44 @@ pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *
|
||||
|
||||
pub fn restore() callconv(.Naked) void {
|
||||
switch (@import("builtin").zig_backend) {
|
||||
.stage2_c => return asm volatile (
|
||||
.stage2_c => asm volatile (
|
||||
\\ movl %[number], %%eax
|
||||
\\ int $0x80
|
||||
\\ ret
|
||||
:
|
||||
: [number] "i" (@enumToInt(SYS.sigreturn)),
|
||||
: "memory"
|
||||
),
|
||||
else => return asm volatile ("int $0x80"
|
||||
else => asm volatile (
|
||||
\\ int $0x80
|
||||
\\ ret
|
||||
:
|
||||
: [number] "{eax}" (@enumToInt(SYS.sigreturn)),
|
||||
: "memory"
|
||||
),
|
||||
}
|
||||
unreachable;
|
||||
}
|
||||
|
||||
pub fn restore_rt() callconv(.Naked) void {
|
||||
switch (@import("builtin").zig_backend) {
|
||||
.stage2_c => return asm volatile (
|
||||
.stage2_c => asm volatile (
|
||||
\\ movl %[number], %%eax
|
||||
\\ int $0x80
|
||||
\\ ret
|
||||
:
|
||||
: [number] "i" (@enumToInt(SYS.rt_sigreturn)),
|
||||
: "memory"
|
||||
),
|
||||
else => return asm volatile ("int $0x80"
|
||||
else => asm volatile (
|
||||
\\ int $0x80
|
||||
\\ ret
|
||||
:
|
||||
: [number] "{eax}" (@enumToInt(SYS.rt_sigreturn)),
|
||||
: "memory"
|
||||
),
|
||||
}
|
||||
unreachable;
|
||||
}
|
||||
|
||||
pub const O = struct {
|
||||
|
||||
@ -109,7 +109,7 @@ pub const restore = restore_rt;
|
||||
|
||||
pub fn restore_rt() callconv(.Naked) void {
|
||||
switch (@import("builtin").zig_backend) {
|
||||
.stage2_c => return asm volatile (
|
||||
.stage2_c => asm volatile (
|
||||
\\ movl %[number], %%eax
|
||||
\\ syscall
|
||||
\\ retq
|
||||
@ -117,12 +117,15 @@ pub fn restore_rt() callconv(.Naked) void {
|
||||
: [number] "i" (@enumToInt(SYS.rt_sigreturn)),
|
||||
: "rcx", "r11", "memory"
|
||||
),
|
||||
else => return asm volatile ("syscall"
|
||||
else => asm volatile (
|
||||
\\ syscall
|
||||
\\ retq
|
||||
:
|
||||
: [number] "{rax}" (@enumToInt(SYS.rt_sigreturn)),
|
||||
: "rcx", "r11", "memory"
|
||||
),
|
||||
}
|
||||
unreachable;
|
||||
}
|
||||
|
||||
pub const mode_t = usize;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user