diff options
Diffstat (limited to 'usr/klibc/arch/m68k/sysstub.ph')
-rw-r--r-- | usr/klibc/arch/m68k/sysstub.ph | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/usr/klibc/arch/m68k/sysstub.ph b/usr/klibc/arch/m68k/sysstub.ph new file mode 100644 index 0000000..78c239d --- /dev/null +++ b/usr/klibc/arch/m68k/sysstub.ph @@ -0,0 +1,26 @@ +# -*- perl -*- +# +# arch/m68k/sysstub.ph +# +# Script to generate system call stubs +# + +sub make_sysstub($$$$$@) { + my($outputdir, $fname, $type, $sname, $stype, @args) = @_; + + open(OUT, '>', "${outputdir}/${fname}.S"); + print OUT "#include <asm/unistd.h>\n"; + print OUT "\n"; + print OUT "\t.type ${fname},\@function\n"; + print OUT "\t.globl ${fname}\n"; + print OUT "${fname}:\n"; + + $stype = 'common' if ( $stype eq '' ); + + print OUT "\tmove.l\t# __NR_${sname}, %d0\n"; + print OUT "\tbr\t__syscall_$stype\n"; + print OUT "\t.size ${fname},.-${fname}\n"; + close(OUT); +} + +1; |