| author | |
| committer | |
| log | eda296c24a80f15b4f28b985fa7ff782bb6b731e |
| tree | e4581d0f81754f21dd90337e21c2ab65afc2eb6d |
| parent | 2085096f50fe235e9b6ddff8abc04daa4e5e7667 |
| signature |
Not really sure what this function was trying to do before, but it seems kind of
nonsensical. All it needs to do is perform an rt_sigreturn syscall, with the
gotcha that it needs two nop instructions at the beginning to accommodate the
way that ret instructions are done in the SPARC ABI (%i7 + 8 to skip the call
instruction and delay slot). The callconv(.c) is certainly not necessary and
probably caused bugs on its own.2 files changed, 16 insertions(+), 10 deletions(-)
lib/std/os/linux/sparc.zig+8-5| ... | @@ -260,13 +260,16 @@ pub fn clone() callconv(.naked) u32 { | ... | @@ -260,13 +260,16 @@ pub fn clone() callconv(.naked) u32 { |
| 260 | 260 | ||
| 261 | pub const restore = restore_rt; | 261 | pub const restore = restore_rt; |
| 262 | 262 | ||
| 263 | // Need to use C ABI here instead of naked | 263 | pub fn restore_rt() callconv(.naked) noreturn { |
| 264 | // to prevent an infinite loop when calling rt_sigreturn. | 264 | asm volatile ( |
| 265 | pub fn restore_rt() callconv(.c) void { | 265 | \\ nop |
| 266 | return asm volatile ("t 0x10" | 266 | \\ nop |
| 267 | ); | ||
| 268 | asm volatile ( | ||
| 269 | \\ t 0x10 | ||
| 267 | : | 270 | : |
| 268 | : [number] "{g1}" (@backingInt(SYS.rt_sigreturn)), | 271 | : [number] "{g1}" (@backingInt(SYS.rt_sigreturn)), |
| 269 | : .{ .memory = true, .xcc = true, .o0 = true, .o1 = true, .o2 = true, .o3 = true, .o4 = true, .o5 = true, .o7 = true }); | 272 | ); |
| 270 | } | 273 | } |
| 271 | 274 | ||
| 272 | pub const VDSO = struct { | 275 | pub const VDSO = struct { |
lib/std/os/linux/sparc64.zig+8-5| ... | @@ -259,13 +259,16 @@ pub fn clone() callconv(.naked) u64 { | ... | @@ -259,13 +259,16 @@ pub fn clone() callconv(.naked) u64 { |
| 259 | 259 | ||
| 260 | pub const restore = restore_rt; | 260 | pub const restore = restore_rt; |
| 261 | 261 | ||
| 262 | // Need to use C ABI here instead of naked | 262 | pub fn restore_rt() callconv(.naked) noreturn { |
| 263 | // to prevent an infinite loop when calling rt_sigreturn. | 263 | asm volatile ( |
| 264 | pub fn restore_rt() callconv(.c) void { | 264 | \\ nop |
| 265 | return asm volatile ("t 0x6d" | 265 | \\ nop |
| 266 | ); | ||
| 267 | asm volatile ( | ||
| 268 | \\ t 0x6d | ||
| 266 | : | 269 | : |
| 267 | : [number] "{g1}" (@backingInt(SYS.rt_sigreturn)), | 270 | : [number] "{g1}" (@backingInt(SYS.rt_sigreturn)), |
| 268 | : .{ .memory = true, .xcc = true, .o0 = true, .o1 = true, .o2 = true, .o3 = true, .o4 = true, .o5 = true, .o7 = true }); | 271 | ); |
| 269 | } | 272 | } |
| 270 | 273 | ||
| 271 | pub const VDSO = struct { | 274 | pub const VDSO = struct { |