3 # arch/alpha/sysstub.ph
5 # Script to generate system call stubs
8 # On Alpha, 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 # A few system calls are dual-return with the second return value in
15 sub make_sysstub($$$$$@) {
16 my($outputdir, $fname, $type, $sname, $stype, @args) = @_;
18 $stype = $stype || 'common';
19 $stype = 'common' if ( $stype eq 'dual0' );
21 open(OUT, '>', "${outputdir}/${fname}.S");
22 print OUT "#include <asm/unistd.h>\n";
23 print OUT "#include <machine/asm.h>\n";
25 print OUT "\t.text\n";
26 print OUT "\t.type ${fname},\@function\n";
27 print OUT "\t.ent\t${fname}, 0\n"; # What is this?
28 print OUT "\t.globl ${fname}\n";
29 print OUT "${fname}:\n";
30 print OUT "\tlda\tv0, __NR_${sname}(zero)\n";
31 print OUT "\tbr __syscall_${stype}\n";
32 print OUT "\t.size\t${fname},.-${fname}\n";
33 print OUT "\t.end\t${fname}\n";