Magellan Linux

Annotation of /trunk/mkinitrd-magellan/klibc/usr/klibc/arch/mips/sysstub.ph

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (hide annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File size: 816 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

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     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;