chiark / gitweb /
volume_id: provide libvolume_id.a file
[elogind.git] / klibc / klibc / arch / mips / sysstub.ph
1 # -*- perl -*-
2 #
3 # arch/mips/sysstub.ph
4 #
5 # Script to generate system call stubs
6 #
7
8 # On MIPS, most system calls follow the standard convention, with the
9 # system call number in r0 (v0), return an error value in r19 (a3) as
10 # well as the return value in r0 (v0).
11
12 sub make_sysstub($$$$$@) {
13     my($outputdir, $fname, $type, $sname, $stype, @args) = @_;
14
15     $stype = $stype || 'common';
16     open(OUT, '>', "${outputdir}/${fname}.S");
17     print OUT "#include <asm/asm.h>\n";
18     print OUT "#include <asm/regdef.h>\n";
19     print OUT "#include <asm/unistd.h>\n";
20     print OUT "\n";
21     print OUT "\t.set noreorder\n";
22     print OUT "\n";
23     print OUT "LEAF(${fname})\n";
24     print OUT "\tj\t__syscall_${stype}\n";
25     print OUT "\t  li\tv0, __NR_${sname}\n";
26     print OUT "\tEND(${fname})\n";
27     close(OUT);
28 }
29
30 1;