authorgravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2020-08-22 16:30:17+07:00
committergravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2020-10-24 20:01:29+07:00
logc29da84c0e0793683904a32deb8a7eff1ba98b54
tree1165a72bd7d963eb160df468d5ca2d6bf366acd0
parent23433fb3172597b10d57d9dda49fcd0d13950fb4

Add sp loading


2 files changed, 8 insertions(+), 0 deletions(-)

lib/std/os/bits/linux/sparc64.zig+3
...@@ -544,6 +544,9 @@ pub const timezone = extern struct {...@@ -544,6 +544,9 @@ pub const timezone = extern struct {
544 tz_dsttime: i32,544 tz_dsttime: i32,
545};545};
546546
547// TODO I'm not sure if the code below is correct, need someone with more
548// knowledge about sparc64 linux internals to look into.
549
547pub const Elf_Symndx = u32;550pub const Elf_Symndx = u32;
548551
549pub const fpstate = extern struct {552pub const fpstate = extern struct {
lib/std/start.zig+5
...@@ -147,6 +147,11 @@ fn _start() callconv(.Naked) noreturn {...@@ -147,6 +147,11 @@ fn _start() callconv(.Naked) noreturn {
147 : "r0"147 : "r0"
148 );148 );
149 },149 },
150 .sparcv9 => {
151 starting_stack_ptr = asm (""
152 : [argc] "={o6}" (-> [*]usize)
153 );
154 },
150 else => @compileError("unsupported arch"),155 else => @compileError("unsupported arch"),
151 }156 }
152 // If LLVM inlines stack variables into _start, they will overwrite157 // If LLVM inlines stack variables into _start, they will overwrite