authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-22 12:55:08+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-22 14:39:55+02:00
log1fa5ca24feb7b931fdc5f4ff826048a87922ad10
treeb34cbbebab53abf65ce7511ccd5aef1c25f62933
parent142209444a52c5c44b19a984f25376173027da7e
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

start: Add POSIX m68k startup code.


1 files changed, 8 insertions(+), 0 deletions(-)

lib/std/start.zig+8
...@@ -307,6 +307,14 @@ fn _start() callconv(.Naked) noreturn {...@@ -307,6 +307,14 @@ fn _start() callconv(.Naked) noreturn {
307 \\ andi sp, sp, -16307 \\ andi sp, sp, -16
308 \\ tail %[posixCallMainAndExit]@plt308 \\ tail %[posixCallMainAndExit]@plt
309 ,309 ,
310 .m68k =>
311 // Note that the - 8 is needed because pc in the jsr instruction points into the middle
312 // of the jsr instruction. (The lea is 6 bytes, the jsr is 4 bytes.)
313 \\ suba.l %%fp, %%fp
314 \\ move.l %%sp, -(%%sp)
315 \\ lea %[posixCallMainAndExit] - . - 8, %%a0
316 \\ jsr (%%pc, %%a0)
317 ,
310 .mips, .mipsel =>318 .mips, .mipsel =>
311 // The lr is already zeroed on entry, as specified by the ABI.319 // The lr is already zeroed on entry, as specified by the ABI.
312 \\ addiu $fp, $zero, 0320 \\ addiu $fp, $zero, 0