ref: 72d686424d6fccfdf180946efa3bdd9eb0746997
parent: 4886e44d6ea86d65f31eb6ecbfa8f82cac9c2fa0
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Sep 14 10:47:48 EDT 2021
libc: Update arch/arm64 This code is being updated out of the tree of scc and it is time to synchroniza both copies now.
--- a/src/libc/arch/arm64/Makefile
+++ b/src/libc/arch/arm64/Makefile
@@ -1,9 +1,9 @@
.POSIX:
-DIRS =\
+PROJECTDIR = ../../../..
+DIRS = \
linux\
-PROJECTDIR =../../../..
include $(PROJECTDIR)/scripts/rules.mk
include ../../rules.mk
--- a/src/libc/arch/arm64/crt-posix.s
+++ b/src/libc/arch/arm64/crt-posix.s
@@ -6,9 +6,10 @@
_start:
ldr x0,[sp] /* argc */
add x1,sp,#8 /* argv */
- add x2,x1,x0,lsl #3 /* argv = argc + 8*argc + 8 */
- add x2,x2,#8
- adr x3,_environ
- str x2,[x3]
+ adr x2,_environ
+ add x9,x1,x0,lsl #3 /* envp = argc + 8*argc + 8 */
+ add x9,x9,#8
+ ldr x9,[x9]
+ str x9,[x2]
bl main
b exit
--- a/src/libc/arch/arm64/longjmp.s
+++ b/src/libc/arch/arm64/longjmp.s
@@ -9,12 +9,12 @@
ldp x25, x26, [x0,#48]
ldp x27, x28, [x0,#64]
ldp x29, x30, [x0,#80]
- ldr x2, [x0,#104]
+ ldr x2, [x0,#96]
mov sp, x2
- ldp d8 , d9, [x0,#112]
- ldp d10, d11, [x0,#128]
- ldp d12, d13, [x0,#144]
- ldp d14, d15, [x0,#160]
+ ldp d8 , d9, [x0,#104]
+ ldp d10, d11, [x0,#120]
+ ldp d12, d13, [x0,#136]
+ ldp d14, d15, [x0,#152]
mov x0, x1
cbnz x1, 1f
--- a/src/libc/arch/arm64/setjmp.s
+++ b/src/libc/arch/arm64/setjmp.s
@@ -11,10 +11,10 @@
stp x27, x28, [x0,#64]
stp x29, x30, [x0,#80]
mov x2, sp
- str x2, [x0,#104]
- stp d8, d9, [x0,#112]
- stp d10, d11, [x0,#128]
- stp d12, d13, [x0,#144]
- stp d14, d15, [x0,#160]
+ str x2, [x0,#96]
+ stp d8, d9, [x0,#104]
+ stp d10, d11, [x0,#120]
+ stp d12, d13, [x0,#136]
+ stp d14, d15, [x0,#152]
mov x0, #0
ret