shithub: scc

ref: 02d2ec7eb3137a12297f11cac8569cf489739ad9
dir: /libc/src/sys/qbe-linux/syscall.awk/

View raw version
# 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

/^#/	{next}
	{name=$2 ".s"
	 printf ".global %s\n" \
	        "%s:\n" \
	        "\tmovq\t$%d,%%rax\n" \
	        "\tsyscall\n" \
	        "\tret\n", $2, $2, $1 > name
	 close(name)}