Annotation of /trunk/mkinitrd-magellan/klibc/usr/klibc/arch/mips/sysstub.ph
Parent Directory | Revision Log
Revision 815 -
(hide annotations)
(download)
Fri Apr 24 18:32:46 2009 UTC (15 years ago) by niro
File size: 777 byte(s)
Fri Apr 24 18:32:46 2009 UTC (15 years ago) by niro
File size: 777 byte(s)
-updated to klibc-1.5.15
1 | niro | 532 | # -*- 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 | niro | 815 | print OUT "#include <machine/asm.h>\n"; |
18 | niro | 532 | print OUT "#include <asm/unistd.h>\n"; |
19 | print OUT "\n"; | ||
20 | print OUT "\t.set noreorder\n"; | ||
21 | print OUT "\n"; | ||
22 | print OUT "LEAF(${fname})\n"; | ||
23 | print OUT "\tj\t__syscall_${stype}\n"; | ||
24 | print OUT "\t li\tv0, __NR_${sname}\n"; | ||
25 | print OUT "\tEND(${fname})\n"; | ||
26 | close(OUT); | ||
27 | } | ||
28 | |||
29 | 1; |