chiark / gitweb /
[PATCH] update klibc to version 0.181
[elogind.git] / klibc / klibc / arch / cris / sysstub.ph
1 # -*- perl -*-
2 #
3 # arch/cris/sysstub.ph
4 #
5 # Script to generate system call stubs
6 #
7
8 sub make_sysstub($$$$@) {
9     my($fname, $type, $sname, $stype, @args) = @_;
10
11     open(OUT, '>', "syscalls/${fname}.S");
12     print OUT "#include <asm/unistd.h>\n";
13     print OUT "\n";
14     print OUT "\t.text\n";
15     print OUT "\t.type\t${fname},\@function\n";
16     print OUT "\t.globl\t${fname}\n";
17     print OUT "\t.balign\t4\n";
18     print OUT "${fname}:\n";
19     print OUT "#if __NR_${sname} <= 31\n";
20     print OUT "\t  moveq\t__NR_${sname}, \$r9\n";
21     print OUT "#else\n";
22     print OUT "\t  move.d\t__NR_${sname}, \$r9\n";
23     print OUT "#endif\n";
24     print OUT "\tjump\t__syscall_common\n";
25     print OUT "\t.size ${fname},.-${fname}\n";
26     close(OUT);
27 }
28
29 1;