aboutsummaryrefslogtreecommitdiff
path: root/lib/std/start.zig
diff options
context:
space:
mode:
authorJacob G-W <jacoblevgw@gmail.com>2021-06-21 13:10:31 -0400
committerAndrew Kelley <andrew@ziglang.org>2021-07-08 14:12:08 -0700
commit1c2facaf6b670863edf30d7c9d1d47368c4a90cc (patch)
treecf080a36769142ab4ebecbda0d9e4336402fad16 /lib/std/start.zig
parentf1aadfa77b2907f0cf93d03d362ee921b0313224 (diff)
downloadzig-1c2facaf6b670863edf30d7c9d1d47368c4a90cc.tar.gz
zig-1c2facaf6b670863edf30d7c9d1d47368c4a90cc.zip
stage2: include enough inline asm support for more plan9 syscalls
Also make the exit more correct by exiting 0 rather than random stuff on the stack.
Diffstat (limited to 'lib/std/start.zig')
-rw-r--r--lib/std/start.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig
index 608b3997f1..dbbab433d0 100644
--- a/lib/std/start.zig
+++ b/lib/std/start.zig
@@ -123,11 +123,15 @@ fn exit2(code: usize) noreturn {
},
else => @compileError("TODO"),
},
+ // exits(0)
.plan9 => switch (builtin.stage2_arch) {
.x86_64 => {
- asm volatile ("syscall"
+ asm volatile (
+ \\push $0
+ \\push $0
+ \\syscall
:
- : [number] "{rbp}" (8)
+ : [syscall_number] "{rbp}" (8)
: "rcx", "r11", "memory"
);
},