chiark / gitweb /
Make run_directory.c stat the place it is going to try to run.
[elogind.git] / klibc / klibc / arch / ppc64 / sysstub.ph
1 # -*- perl -*-
2 #
3 # arch/ppc64/sysstub.ph
4 #
5 # Script to generate system call stubs
6 #
7
8 sub make_sysstub($$$$$@) {
9     my($outputdir, $fname, $type, $sname, $stype, @args) = @_;
10
11     open(OUT, '>', "${outputdir}/${fname}.S");
12     print OUT "#include <asm/unistd.h>\n";
13     print OUT "\n";
14     print OUT "\t.globl ${fname}\n";
15     print OUT "\t.section \".opd\",\"aw\"\n";
16     print OUT "\t.align 3\n";
17     print OUT "${fname}:\n";
18     print OUT "\t.quad .${fname},.TOC.\@tocbase,0\n";
19     print OUT "\t.text\n";
20     print OUT "\t.type .${fname},\@function\n";
21     print OUT "\t.globl .${fname}\n";
22     print OUT ".${fname}:\n";
23     print OUT "\tli 0,__NR_${sname}\n";
24     print OUT "\tsc\n";
25     print OUT "\tbnslr\n";
26     print OUT "\tb .__syscall_error\n";
27     print OUT "\t.size .${fname},.-.${fname}\n";
28     close(OUT);
29 }
30
31 1;