5 # Script to generate system call stubs
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).
12 sub make_sysstub($$$$$@) {
13 my($outputdir, $fname, $type, $sname, $stype, @args) = @_;
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";
21 print OUT "\t.set noreorder\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";