Skip to content

Commit 8ffc41f

Browse files
committed
start: Add POSIX s390x startup code.
1 parent c536732 commit 8ffc41f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/std/start.zig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,15 @@ fn _start() callconv(.Naked) noreturn {
363363
\\ mtlr 0
364364
\\ b %[posixCallMainAndExit]
365365
,
366+
.s390x =>
367+
// Set up the stack frame (register save area and cleared back-chain slot).
368+
// Note: Stack pointer is guaranteed by ABI to be 8-byte aligned as required.
369+
\\ lgr %r2, %r15
370+
\\ aghi %r15, -160
371+
\\ lghi %r0, 0
372+
\\ stg %r0, 0(%r15)
373+
\\ jg %[posixCallMainAndExit]
374+
,
366375
.sparc64 =>
367376
// argc is stored after a register window (16 registers) plus stack bias
368377
\\ mov %%g0, %%i6

0 commit comments

Comments
 (0)