scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit f07c5ce819795db22a97108a493e88ad1a0c4a82
parent 932bc4d2300493b9b8cbc1d4132e222d7c8c6129
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 14 Sep 2021 14:47:48 +0200

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.

Diffstat:
Msrc/libc/arch/amd64/dragonfly/.gitignore | 2+-
Msrc/libc/arch/amd64/dragonfly/Makefile | 11+++++------
Msrc/libc/arch/amd64/dragonfly/gensys.sh | 6+++++-
Msrc/libc/arch/amd64/dragonfly/syscall.lst | 21+++++++++++----------
4 files changed, 22 insertions(+), 18 deletions(-)

diff --git 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 diff --git a/src/libc/arch/amd64/dragonfly/Makefile b/src/libc/arch/amd64/dragonfly/Makefile @@ -5,22 +5,22 @@ include $(PROJECTDIR)/scripts/rules.mk include ../../../rules.mk GENOBJS =\ - _Exit.$O\ + _brk.$O\ _close.$O\ + _exit.$O\ _getpid.$O\ _kill.$O\ _lseek.$O\ _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 @@ $(GENSRC): syscall.lst ./gensys.sh $(@:.s=) clean: - rm -f $(GENSRC) - rm -f _sys_errlist.c + rm -f $(GENSRC) _sys_errlist.c include deps.mk diff --git a/src/libc/arch/amd64/dragonfly/gensys.sh b/src/libc/arch/amd64/dragonfly/gensys.sh @@ -8,13 +8,17 @@ sed -n " s/[ ]*#.*// /$1/p" syscall.lst | -while read num name +while read num name nargs do cat <<EOF > $name.s .file "$name.s" .globl $name $name: + `case $nargs in 4|5|6) + echo "movq %rcx,%r10" + ;; + esac` movq \$$num,%rax syscall jb 1f diff --git 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