diff options
author | Dejan Latinovic <Dejan.Latinovic@imgtec.com> | 2015-03-05 16:51:44 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2015-03-05 16:51:44 -0800 |
commit | ccd50880175e79fb9bc544c96d72b8971303cc0a (patch) | |
tree | 89048160c6ac82f3f12cb4ee418934aef8e2cf9c | |
parent | 493f9a99220aed4eb7c6e3dd9018c037d45b13e2 (diff) | |
download | klibc-ccd50880175e79fb9bc544c96d72b8971303cc0a.tar.gz |
add-mips64-support-arch-mips32
Description: Add mips64 support, using existing mips32 code.
- using mips32 assembler source files: pipe.S vfork.S syscall.S
- sysstub.ph: copied over from klibc/arch/mips
-rw-r--r-- | usr/klibc/arch/mips64/Kbuild | 11 | ||||
-rw-r--r-- | usr/klibc/arch/mips64/sysstub.ph | 29 |
2 files changed, 40 insertions, 0 deletions
diff --git a/usr/klibc/arch/mips64/Kbuild b/usr/klibc/arch/mips64/Kbuild index 970c0f84f2f0d..6fe3b53fc62d4 100644 --- a/usr/klibc/arch/mips64/Kbuild +++ b/usr/klibc/arch/mips64/Kbuild @@ -1,3 +1,14 @@ # # 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 diff --git a/usr/klibc/arch/mips64/sysstub.ph b/usr/klibc/arch/mips64/sysstub.ph new file mode 100644 index 0000000000000..e8a02009ac4c3 --- /dev/null +++ b/usr/klibc/arch/mips64/sysstub.ph @@ -0,0 +1,29 @@ +# -*- 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; |