diff options
Diffstat (limited to 'klibc/klibc/arch/cris/sysstub.ph')
-rw-r--r-- | klibc/klibc/arch/cris/sysstub.ph | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/klibc/klibc/arch/cris/sysstub.ph b/klibc/klibc/arch/cris/sysstub.ph new file mode 100644 index 0000000000..6c894f62f5 --- /dev/null +++ b/klibc/klibc/arch/cris/sysstub.ph @@ -0,0 +1,29 @@ +# -*- perl -*- +# +# arch/cris/sysstub.ph +# +# Script to generate system call stubs +# + +sub make_sysstub($$$$@) { + my($fname, $type, $sname, $stype, @args) = @_; + + open(OUT, '>', "syscalls/${fname}.S"); + print OUT "#include <asm/unistd.h>\n"; + print OUT "\n"; + print OUT "\t.text\n"; + print OUT "\t.type\t${fname},\@function\n"; + print OUT "\t.globl\t${fname}\n"; + print OUT "\t.balign\t4\n"; + print OUT "${fname}:\n"; + print OUT "#if __NR_${sname} <= 31\n"; + print OUT "\t moveq\t__NR_${sname}, \$r9\n"; + print OUT "#else\n"; + print OUT "\t move.d\t__NR_${sname}, \$r9\n"; + print OUT "#endif\n"; + print OUT "\tjump\t__syscall_common\n"; + print OUT "\t.size ${fname},.-${fname}\n"; + close(OUT); +} + +1; |