ref: 38d360b9a0c73d60a5e8e8df65854c53d6f145f5
parent: b9b8ac6cf7afbdcad2b2b725b09fdeddc63ba2b3
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Sep 14 10:47:48 EDT 2021
libc: Update arch/amd64/dragonfly This code is being updated out of the tree of scc and it is time to synchroniza both copies now.
--- a/src/libc/arch/amd64/dragonfly/.gitignore
+++ b/src/libc/arch/amd64/dragonfly/.gitignore
@@ -1,6 +1,6 @@
-_Exit.s
_brk.s
_close.s
+_exit.s
_getpid.s
_kill.s
_lseek.s
--- a/src/libc/arch/amd64/dragonfly/Makefile
+++ b/src/libc/arch/amd64/dragonfly/Makefile
@@ -5,8 +5,9 @@
include ../../../rules.mk
GENOBJS =\
- _Exit.$O\
+ _brk.$O\
_close.$O\
+ _exit.$O\
_getpid.$O\
_kill.$O\
_lseek.$O\
@@ -13,14 +14,13 @@
_open.$O\
_read.$O\
_write.$O\
- _brk.$O\
-GENSRC = $(GENOBJS:.$O=.s)
-
OBJS =\
$(GENOBJS)\
_sys_errlist.$O\
+GENSRC = $(GENOBJS:.$O=.s)
+
# Rules
all: $(OBJS) $(CRT)
@@ -31,7 +31,6 @@
./gensys.sh $(@:.s=)
clean:
- rm -f $(GENSRC)
- rm -f _sys_errlist.c
+ rm -f $(GENSRC) _sys_errlist.c
include deps.mk
--- a/src/libc/arch/amd64/dragonfly/gensys.sh
+++ b/src/libc/arch/amd64/dragonfly/gensys.sh
@@ -8,7 +8,7 @@
sed -n "
s/[ ]*#.*//
/$1/p" syscall.lst |
-while read num name
+while read num name nargs
do
cat <<EOF > $name.s
.file "$name.s"
@@ -15,6 +15,10 @@
.globl $name
$name:
+ `case $nargs in 4|5|6)
+ echo "movq %rcx,%r10"
+ ;;
+ esac`
movq \$$num,%rax
syscall
jb 1f
--- a/src/libc/arch/amd64/dragonfly/syscall.lst
+++ b/src/libc/arch/amd64/dragonfly/syscall.lst
@@ -1,10 +1,11 @@
-#number name
-1 _Exit
-3 _read
-4 _write
-5 _open
-6 _close
-17 _brk
-20 _getpid
-37 _kill
-199 _lseek
+#Tab 15
+#number name nargs
+1 _exit 1
+3 _read 3
+4 _write 3
+5 _open 3
+6 _close 1
+17 _brk 1
+20 _getpid 0
+37 _kill 2
+199 _lseek 4