aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-07-22 13:22:42 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-07-22 14:39:55 +0200
commit8ffc41f74705246e61f3c02c253d40b1464ea2bf (patch)
tree778d7f1a94ca07049cfdfb8925749b8fb1ece9eb /lib/std
parentc53673276be9de837add3a3c4e948b10cdd7e1a6 (diff)
downloadzig-8ffc41f74705246e61f3c02c253d40b1464ea2bf.tar.gz
zig-8ffc41f74705246e61f3c02c253d40b1464ea2bf.zip
start: Add POSIX s390x startup code.
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/start.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig
index ff524d5d64..caca4c7be3 100644
--- a/lib/std/start.zig
+++ b/lib/std/start.zig
@@ -363,6 +363,15 @@ fn _start() callconv(.Naked) noreturn {
\\ mtlr 0
\\ b %[posixCallMainAndExit]
,
+ .s390x =>
+ // Set up the stack frame (register save area and cleared back-chain slot).
+ // Note: Stack pointer is guaranteed by ABI to be 8-byte aligned as required.
+ \\ lgr %r2, %r15
+ \\ aghi %r15, -160
+ \\ lghi %r0, 0
+ \\ stg %r0, 0(%r15)
+ \\ jg %[posixCallMainAndExit]
+ ,
.sparc64 =>
// argc is stored after a register window (16 registers) plus stack bias
\\ mov %%g0, %%i6