scc

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

gensys.sh (331B)


      1 #!/bin/sh
      2 #
      3 # This job is very easy because app and kernel ABI are identical
      4 # until the 4th parameter, so we only have to set the syscall
      5 # number in eax
      6 
      7 sed 's/[ 	]*#.*//
      8      /^$/d' syscall.lst |
      9 while read num name
     10 do
     11 cat <<EOF > $name.s
     12 	.file	"$name.s"
     13 
     14 	.globl	$name
     15 $name:
     16 	movl	\$$num,%eax
     17 	syscall
     18 	jmp	_cerrno
     19 EOF
     20 done