mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-24 11:30:29 +00:00
aarch64 loader passes os (#1042)
* Reorder Launch arguments, pass aarch64 os Third and fourth arguments are now identical between cosmo and Launch. By passing sp as argument 4, we save a bit of register juggling. Fourth argument (os) is now always passed by the loader on aarch64. It is not yet processed by cosmo. Pushing this change separately, as the cosmo side turns out to be somewhat more involved. * cosmo2 receives os from loader FreeBSD aarch64 now traps early rather than pretending to be Linux. o/aarch64/examples/env.com still works on Linux and Xnu.
This commit is contained in:
parent
d8ad34686a
commit
14fe83facd
5 changed files with 30 additions and 20 deletions
|
@ -726,10 +726,10 @@ __attribute__((__noreturn__)) static void Spawn(const char *exe, int fd,
|
|||
|
||||
register long *x0 __asm__("x0") = sp;
|
||||
register char *x2 __asm__("x2") = path;
|
||||
register int x3 __asm__("x3") = 8; /* _HOSTXNU */
|
||||
register struct Syslib *x15 __asm__("x15") = lib;
|
||||
register long x16 __asm__("x16") = e->e_entry;
|
||||
__asm__ volatile("mov\tx1,#0\n\t"
|
||||
"mov\tx3,#0\n\t"
|
||||
"mov\tx4,#0\n\t"
|
||||
"mov\tx5,#0\n\t"
|
||||
"mov\tx6,#0\n\t"
|
||||
|
@ -758,7 +758,7 @@ __attribute__((__noreturn__)) static void Spawn(const char *exe, int fd,
|
|||
"mov\tx0,#0\n\t"
|
||||
"br\tx16"
|
||||
: /* no outputs */
|
||||
: "r"(x0), "r"(x2), "r"(x15), "r"(x16)
|
||||
: "r"(x0), "r"(x2), "r"(x3), "r"(x15), "r"(x16)
|
||||
: "memory");
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue