aboutsummaryrefslogtreecommitdiff
path: root/lib/std/start.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-07-22 12:55:08 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-07-22 14:39:55 +0200
commit1fa5ca24feb7b931fdc5f4ff826048a87922ad10 (patch)
treeb34cbbebab53abf65ce7511ccd5aef1c25f62933 /lib/std/start.zig
parent142209444a52c5c44b19a984f25376173027da7e (diff)
downloadzig-1fa5ca24feb7b931fdc5f4ff826048a87922ad10.tar.gz
zig-1fa5ca24feb7b931fdc5f4ff826048a87922ad10.zip
start: Add POSIX m68k startup code.
Diffstat (limited to 'lib/std/start.zig')
-rw-r--r--lib/std/start.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig
index d927f74517..081e9d44f0 100644
--- a/lib/std/start.zig
+++ b/lib/std/start.zig
@@ -307,6 +307,14 @@ fn _start() callconv(.Naked) noreturn {
\\ andi sp, sp, -16
\\ tail %[posixCallMainAndExit]@plt
,
+ .m68k =>
+ // Note that the - 8 is needed because pc in the jsr instruction points into the middle
+ // of the jsr instruction. (The lea is 6 bytes, the jsr is 4 bytes.)
+ \\ suba.l %%fp, %%fp
+ \\ move.l %%sp, -(%%sp)
+ \\ lea %[posixCallMainAndExit] - . - 8, %%a0
+ \\ jsr (%%pc, %%a0)
+ ,
.mips, .mipsel =>
// The lr is already zeroed on entry, as specified by the ABI.
\\ addiu $fp, $zero, 0