| ... | ... | @@ -148,8 +148,14 @@ fn _start() callconv(.Naked) noreturn { |
| 148 | 148 | ); |
| 149 | 149 | }, |
| 150 | 150 | .sparcv9 => { |
| 151 | | starting_stack_ptr = asm ("" |
| 152 | | : [argc] "={o6}" (-> [*]usize) |
| 151 | // On sparc64, the stack pointer register points to a place |
| 152 | // 2047 bytes below the actual stack. Also, argc and friends are |
| 153 | // placed starting at [stack-start + 128], so we need to account for that too. |
| 154 | // Ref: System V Application Binary Interface: SPARC Version 9 Processor Supplement |
| 155 | // Version 1.35, figure 3-16. |
| 156 | // TODO: find a better way to do this. |
| 157 | starting_stack_ptr = asm ("add %%o6, 2175, %[argc]" |
| 158 | : [argc] "=r" (-> [*]usize) |
| 153 | 159 | ); |
| 154 | 160 | }, |
| 155 | 161 | else => @compileError("unsupported arch"), |