sysstub.ph

来自「klibc精简化的c程序库」· PH 代码 · 共 31 行

PH
31
字号
# -*- perl -*-## arch/mips/sysstub.ph## Script to generate system call stubs## On MIPS, most system calls follow the standard convention, with the# system call number in r0 (v0), return an error value in r19 (a3) as# well as the return value in r0 (v0).sub make_sysstub($$$$$@) {    my($outputdir, $fname, $type, $sname, $stype, @args) = @_;    $stype = $stype || 'common';    open(OUT, '>', "${outputdir}/${fname}.S");    print OUT "#include <asm/asm.h>\n";    print OUT "#include <asm/regdef.h>\n";    print OUT "#include <asm/unistd.h>\n";    print OUT "\n";    print OUT "\t.set noreorder\n";    print OUT "\n";    print OUT "LEAF(${fname})\n";    print OUT "\tj\t__syscall_${stype}\n";    print OUT "\t  li\tv0, __NR_${sname}\n";    print OUT "\tEND(${fname})\n";    close(OUT);}1;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?