diff options
| author | Koakuma <koachan@protonmail.com> | 2021-08-03 22:24:11 +0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-08-24 14:08:54 -0400 |
| commit | dd75302563f5cc0c67907b5c8a724e69379893f0 (patch) | |
| tree | 1d4748ce88315b41da661bfb872ddf36a3cc94c6 /lib/std/os/linux | |
| parent | e3840817d7a8a3e9e69a7b0e6f3c7f2ce8c8d029 (diff) | |
| download | zig-dd75302563f5cc0c67907b5c8a724e69379893f0.tar.gz zig-dd75302563f5cc0c67907b5c8a724e69379893f0.zip | |
Linux/SPARCv9: use C calling convention for restore_rt
This is needed to prevent infinite loop when calling rt_sigreturn.
Diffstat (limited to 'lib/std/os/linux')
| -rw-r--r-- | lib/std/os/linux/sparc64.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/std/os/linux/sparc64.zig b/lib/std/os/linux/sparc64.zig index f347a0e88e..1c08d39c05 100644 --- a/lib/std/os/linux/sparc64.zig +++ b/lib/std/os/linux/sparc64.zig @@ -169,7 +169,9 @@ pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: pub const restore = restore_rt; -pub fn restore_rt() callconv(.Naked) void { +// Need to use C ABI here instead of naked +// to prevent an infinite loop when calling rt_sigreturn. +pub fn restore_rt() callconv(.C) void { return asm volatile ("t 0x6d" : : [number] "{g1}" (@enumToInt(SYS.rt_sigreturn)) |
