scc

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

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

libc: Update arch/amd64/openbsd

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/openbsd/.gitignore | 4++--
Msrc/libc/arch/amd64/openbsd/Makefile | 6+++---
Msrc/libc/arch/amd64/openbsd/gensys.sh | 6+++++-
Msrc/libc/arch/amd64/openbsd/syscall.lst | 23++++++++++++-----------
4 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/src/libc/arch/amd64/openbsd/.gitignore b/src/libc/arch/amd64/openbsd/.gitignore @@ -1,12 +1,12 @@ -_Exit.s _brk.s _close.s +_exit.s _getpid.s _kill.s _lseek.s _open.s _read.s _sigaction.s +_sigaction2.s _sys_errlist.c _write.s -_sigaction2.s diff --git a/src/libc/arch/amd64/openbsd/Makefile b/src/libc/arch/amd64/openbsd/Makefile @@ -5,16 +5,16 @@ 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\ _sigaction2.$O\ + _write.$O\ GENSRC = $(GENOBJS:.$O=.s) diff --git a/src/libc/arch/amd64/openbsd/gensys.sh b/src/libc/arch/amd64/openbsd/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/openbsd/syscall.lst b/src/libc/arch/amd64/openbsd/syscall.lst @@ -1,11 +1,12 @@ -#number name -1 _Exit -3 _read -4 _write -5 _open -6 _close -17 _brk -20 _getpid -46 _sigaction2 -122 _kill -198 _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 +46 _sigaction2 5 +122 _kill 2 +198 _lseek 3