summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/m68k/sysstub.ph
blob: 78c239d45cfe9ea1f921342cbbf491f3abd94729 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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;