aboutsummaryrefslogtreecommitdiff
path: root/lib/std/start.zig
diff options
context:
space:
mode:
authorjoachimschmidt557 <joachim.schmidt557@outlook.com>2021-11-20 15:30:53 +0100
committerJakub Konka <kubkon@jakubkonka.com>2021-11-20 19:25:59 +0100
commite8112f774450be081cc210cf03c114f64b78731e (patch)
treea7dfe45c668d4539fb221f321ef90f334e091047 /lib/std/start.zig
parentc84147f90dd99af1352e69f698be48964573ee07 (diff)
downloadzig-e8112f774450be081cc210cf03c114f64b78731e.tar.gz
zig-e8112f774450be081cc210cf03c114f64b78731e.zip
stage2 RISCV64: implement basic function prologue and epilogue
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 cd2cf230af..d10b756160 100644
--- a/lib/std/start.zig
+++ b/lib/std/start.zig
@@ -130,6 +130,14 @@ fn exit2(code: usize) noreturn {
: "memory", "cc"
);
},
+ .riscv64 => {
+ asm volatile ("ecall"
+ :
+ : [number] "{a7}" (94),
+ [arg1] "{a0}" (0),
+ : "rcx", "r11", "memory"
+ );
+ },
else => @compileError("TODO"),
},
// exits(0)