mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-05-30 21:07:34 +03:00
std.start: add xtensa support
This commit is contained in:
@@ -183,6 +183,7 @@ fn _start() callconv(.naked) noreturn {
|
||||
.sparc, .sparc64 => ".cfi_undefined %%i7",
|
||||
.x86 => ".cfi_undefined %%eip",
|
||||
.x86_64 => ".cfi_undefined %%rip",
|
||||
.xtensa, .xtensaeb => "", // No CFI support.
|
||||
else => @compileError("unsupported arch"),
|
||||
});
|
||||
|
||||
@@ -486,6 +487,15 @@ fn _start() callconv(.naked) noreturn {
|
||||
\\ sub %%sp, 2047, %%sp
|
||||
\\ ba,a %[posixCallMainAndExit]
|
||||
,
|
||||
.xtensa, .xtensaeb =>
|
||||
// a0 = LR, a7 = FP, a1 = SP
|
||||
\\ movi a0, 0
|
||||
\\ movi a7, 0
|
||||
\\ mov a2, sp
|
||||
\\ movi a8, -16
|
||||
\\ and sp, sp, a8
|
||||
\\ callx0 %[posixCallMainAndExit]
|
||||
,
|
||||
else => @compileError("unsupported arch"),
|
||||
}
|
||||
:
|
||||
|
||||
Reference in New Issue
Block a user