authorgravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2021-08-03 22:24:11+07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-08-24 14:08:54-04:00
logdd75302563f5cc0c67907b5c8a724e69379893f0
tree1d4748ce88315b41da661bfb872ddf36a3cc94c6
parente3840817d7a8a3e9e69a7b0e6f3c7f2ce8c8d029

Linux/SPARCv9: use C calling convention for restore_rt

This is needed to prevent infinite loop when calling rt_sigreturn.

1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/os/linux/sparc64.zig+3-1
...@@ -169,7 +169,9 @@ pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags:...@@ -169,7 +169,9 @@ pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags:
169169
170pub const restore = restore_rt;170pub const restore = restore_rt;
171171
172pub fn restore_rt() callconv(.Naked) void {172// Need to use C ABI here instead of naked
173// to prevent an infinite loop when calling rt_sigreturn.
174pub fn restore_rt() callconv(.C) void {
173 return asm volatile ("t 0x6d"175 return asm volatile ("t 0x6d"
174 :176 :
175 : [number] "{g1}" (@enumToInt(SYS.rt_sigreturn))177 : [number] "{g1}" (@enumToInt(SYS.rt_sigreturn))