chiark / gitweb /
07af1227ca47ad0ed1afcafc19c75d09cadfe965
[elogind.git] / klibc / klibc / arch / x86_64 / sysstub.ph
1 # -*- perl -*-
2 #
3 # arch/x86_64/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.type ${fname},\@function\n";
15     print OUT "\t.globl ${fname}\n";
16     print OUT "${fname}:\n";
17     print OUT "\tmovl \$__NR_${sname},%eax\n"; # Zero-extends to 64 bits
18     print OUT "\tjmp __syscall_common\n";
19     print OUT "\t.size ${fname},.-${fname}\n";
20     close(OUT);
21 }
22
23 1;