mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
std.start: add sh support
This commit is contained in:
parent
c792ebfee2
commit
4193ea8239
@ -212,6 +212,7 @@ fn _start() callconv(.naked) noreturn {
|
||||
else
|
||||
".cfi_undefined ra",
|
||||
.s390x => ".cfi_undefined %%r14",
|
||||
.sh, .sheb => ".cfi_undefined pr",
|
||||
.sparc, .sparc64 => ".cfi_undefined %%i7",
|
||||
.x86 => ".cfi_undefined %%eip",
|
||||
.x86_64 => ".cfi_undefined %%rip",
|
||||
@ -455,6 +456,21 @@ fn _start() callconv(.naked) noreturn {
|
||||
\\ stg %%r0, 0(%%r15)
|
||||
\\ jg %[posixCallMainAndExit]
|
||||
,
|
||||
.sh, .sheb =>
|
||||
// r14 = FP, r15 = SP, pr = LR
|
||||
\\ mov #0, r0
|
||||
\\ lds r0, pr
|
||||
\\ mov r0, r14
|
||||
\\ mov r15, r4
|
||||
\\ mov #-4, r0
|
||||
\\ and r0, r15
|
||||
\\ mov.l 2f, r1
|
||||
\\1:
|
||||
\\ bsrf r1
|
||||
\\2:
|
||||
\\ .balign 4
|
||||
\\ .long %[posixCallMainAndExit]@PCREL - (1b + 4 - .)
|
||||
,
|
||||
.sparc =>
|
||||
// argc is stored after a register window (16 registers * 4 bytes).
|
||||
// i7 = LR
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user