#
# klibc files for mips64
#
+
+klib-y := ../mips/pipe.o ../mips/vfork.o setjmp.o ../mips/syscall.o
+
+klib-y += ../../libgcc/__clzsi2.o ../../libgcc/__ashldi3.o
+klib-y += ../../libgcc/__ashrdi3.o ../../libgcc/__lshrdi3.o
+klib-y += ../../libgcc/__divdi3.o ../../libgcc/__moddi3.o
+klib-y += ../../libgcc/__udivdi3.o ../../libgcc/__umoddi3.o
+klib-y += ../../libgcc/__udivmoddi4.o
+
+always := crt0.o
+targets := crt0.o
--- /dev/null
+# -*- perl -*-
+#
+# arch/mips64/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 <machine/asm.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;