mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 16:58:30 +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
|
@ -32,15 +32,15 @@
|
|||
// @param rdi is passed through as-is
|
||||
// @param rsi is address of entrypoint (becomes zero)
|
||||
// @param rdx is passed through as-is
|
||||
// @param rcx is stack pointer (becomes r8)
|
||||
// @param rcx is passed through as-is
|
||||
// @param r8 is stack pointer (becomes zero)
|
||||
// @noreturn
|
||||
Launch:
|
||||
#ifdef __aarch64__
|
||||
|
||||
mov x16,x1
|
||||
mov sp,x3
|
||||
mov sp,x4
|
||||
mov x1,0
|
||||
mov x3,x4
|
||||
mov x4,0
|
||||
mov x5,0
|
||||
mov x6,0
|
||||
|
@ -70,8 +70,7 @@ Launch:
|
|||
|
||||
#else
|
||||
|
||||
mov %rcx,%rsp
|
||||
mov %r8,%rcx
|
||||
mov %r8,%rsp
|
||||
xor %r8d,%r8d
|
||||
xor %r9d,%r9d
|
||||
xor %r10d,%r10d
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue