[hackers] [scc] [libc-amd64-linux] Add syscall script || Roberto E. Vargas Caballero
commit 8f703c5646e41a78a2b3ae9d305e479f765ae43c
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Mar 7 08:43:56 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Mar 7 08:43:56 2017 +0100
[libc-amd64-linux] Add syscall script
diff --git a/libc/src/sys/amd64-linux/Makefile b/libc/src/sys/amd64-linux/Makefile
new file mode 100644
index 0000000..c80234b
--- /dev/null
+++ b/libc/src/sys/amd64-linux/Makefile
_AT_@ -0,0 +1,14 @@
+
+OBJ = _brk.o _close.o _exit.o _lseek.o _open.o _read.o _write.o
+SRC = $(OBJ:.o=.s)
+
+all: $(OBJ)
+
+.s.o:
+ $(AS) $< -o $_AT_
+
+$(SRC):
+ awk -f syscall.awk < syscall.lst
+
+clean:
+ rm -f *.s *.o
diff --git a/libc/src/sys/amd64-linux/syscall.awk b/libc/src/sys/amd64-linux/syscall.awk
new file mode 100644
index 0000000..9a4110d
--- /dev/null
+++ b/libc/src/sys/amd64-linux/syscall.awk
_AT_@ -0,0 +1,4 @@
+/^#/ {next}
+ {name=$2 ".s"
+ printf "%s:\n\tmov\t%d,%%rax\n\tsyscall\n\tret\n",$2, $1 > name
+ close(name)}
diff --git a/libc/src/sys/amd64-linux/syscall.lst b/libc/src/sys/amd64-linux/syscall.lst
new file mode 100644
index 0000000..c80b4f2
--- /dev/null
+++ b/libc/src/sys/amd64-linux/syscall.lst
_AT_@ -0,0 +1,8 @@
+#number #name
+0 _read
+1 _write
+2 _open
+3 _close
+3 _lseek
+12 _brk
+60 _exit
Received on Tue Mar 07 2017 - 08:44:27 CET
This archive was generated by hypermail 2.3.0
: Tue Mar 07 2017 - 08:48:22 CET