| ... | ... | @@ -148,13 +148,10 @@ fn _start() callconv(.Naked) noreturn { |
| 148 | 148 | ); |
| 149 | 149 | }, |
| 150 | 150 | .sparcv9 => { |
| 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]" |
| 151 | // argc is stored after a register window (16 registers) plus stack bias |
| 152 | starting_stack_ptr = asm ( |
| 153 | \\ mov %%g0, %%i6 |
| 154 | \\ add %%o6, 2175, %[argc] |
| 158 | 155 | : [argc] "=r" (-> [*]usize) |
| 159 | 156 | ); |
| 160 | 157 | }, |