ref: b1a932d399555b5980423a59c3f74e9f42872934
parent: 5cee3c5e3fdc511a468879104c08a1aa0e8c2b0f
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Sep 14 10:47:48 EDT 2021
libc: Update arch/arm/linux This code is being updated out of the tree of scc and it is time to synchroniza both copies now.
--- a/src/libc/arch/arm/linux/Makefile
+++ b/src/libc/arch/arm/linux/Makefile
@@ -5,16 +5,16 @@
include ../../../rules.mk
GENOBJS =\
- _Exit.$O\
_close.$O\
- _brk.$O\
+ _exit.$O\
_getpid.$O\
_kill.$O\
_lseek.$O\
_openat.$O\
_read.$O\
- _write.$O\
_sigaction.$O\
+ _sys_brk.$O\
+ _write.$O\
GENSRC = $(GENOBJS:.$O=.s)
--- a/src/libc/arch/arm/linux/syscall.lst
+++ b/src/libc/arch/arm/linux/syscall.lst
@@ -7,5 +7,5 @@
20 _getpid
37 _kill
19 _lseek
-45 _brk
+45 _sys_brk
134 _sigaction
--- a/src/libc/arch/arm64/linux/Makefile
+++ b/src/libc/arch/arm64/linux/Makefile
@@ -1,35 +1,37 @@
.POSIX:
-PROJECTDIR =../../../../..
+PROJECTDIR = ../../../../..
+
include $(PROJECTDIR)/scripts/rules.mk
include ../../../rules.mk
-GENOBJS =\
- _Exit.$O\
+GENOBJS =\
_close.$O\
- _brk.$O\
+ _exit.$O\
_getpid.$O\
_kill.$O\
_lseek.$O\
_openat.$O\
_read.$O\
- _write.$O\
_sigaction.$O\
+ _sys_brk.$O\
+ _write.$O\
-GENSRC = $(GENOBJS:.$O=.s)
-
OBJS =\
$(GENOBJS)\
_cerrno.$O\
_sys_errlist.$O\
+GENSRC = $(GENOBJS:.$O=.s)
+
all: $(OBJS) $(CRT)
-crt.$O: ../crt-posix.s
+$(CRT): ../crt-posix.s
$(GENSRC): syscall.lst
./gensys.sh $(@:.s=)
clean:
- rm -f $(GENSRC)
- rm -f syscall _sys_errlist.c
+ rm -f $(GENSRC) _sys_errlist.c
+
+include deps.mk
--- a/src/libc/arch/arm64/linux/gensys.sh
+++ b/src/libc/arch/arm64/linux/gensys.sh
@@ -1,12 +1,12 @@
#!/bin/sh
-#
# This job is very easy because app and kernel ABI are identical
# until the 4th parameter, so we only have to set the syscall
# number in rax
-sed 's/[ ]*#.*//
- /^$/d' syscall.lst |
+sed -n "
+ s/[ ]*#.*//
+ /$1/p" syscall.lst |
while read num name
do
cat <<EOF > $name.s
--- a/src/libc/arch/arm64/linux/syscall.lst
+++ b/src/libc/arch/arm64/linux/syscall.lst
@@ -1,11 +1,11 @@
#number name
56 _openat
57 _close
+62 _lseek
63 _read
64 _write
93 _Exit
-172 _getpid
129 _kill
-62 _lseek
134 _sigaction
-214 _brk
+172 _getpid
+214 _sys_brk