diff options
Diffstat (limited to 'libc/arch-mips')
244 files changed, 8982 insertions, 0 deletions
diff --git a/libc/arch-mips/bionic/__dso_handle.S b/libc/arch-mips/bionic/__dso_handle.S new file mode 100644 index 0000000..3e80128 --- /dev/null +++ b/libc/arch-mips/bionic/__dso_handle.S @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +# The __dso_handle global variable is used by static +# C++ constructors and destructors in the binary. +# See http://www.codesourcery.com/public/cxx-abi/abi.html#dso-dtor +# + .section .bss + .align 4 + +#ifndef CRT_LEGACY_WORKAROUND + .hidden __dso_handle +#endif + + .globl __dso_handle +__dso_handle: + .long 0 diff --git a/libc/arch-mips/bionic/__dso_handle_so.S b/libc/arch-mips/bionic/__dso_handle_so.S new file mode 100644 index 0000000..77a5d7f --- /dev/null +++ b/libc/arch-mips/bionic/__dso_handle_so.S @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +# The __dso_handle global variable is used by static +# C++ constructors and destructors in the binary. +# See http://www.codesourcery.com/public/cxx-abi/abi.html#dso-dtor +# + .data + .align 4 + .hidden __dso_handle + .globl __dso_handle +__dso_handle: + .long __dso_handle diff --git a/libc/arch-mips/bionic/__get_sp.S b/libc/arch-mips/bionic/__get_sp.S new file mode 100644 index 0000000..834c89d --- /dev/null +++ b/libc/arch-mips/bionic/__get_sp.S @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + .text + +/* void *__get_sp(void) */ + + .type __get_sp, @function + .global __get_sp + .align 4 + .ent __get_sp +__get_sp: + move $v0, $sp + j $ra + .end __get_sp diff --git a/libc/arch-mips/bionic/__get_tls.c b/libc/arch-mips/bionic/__get_tls.c new file mode 100644 index 0000000..d1cdf0e --- /dev/null +++ b/libc/arch-mips/bionic/__get_tls.c @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +void* __get_tls(void) +{ + register void *tls asm("v1"); + asm (".set push\n\t" + ".set mips32r2\n\t" + "rdhwr %0,$29\n\t" + ".set pop" + : "=r"(tls)); + return tls; +} diff --git a/libc/arch-mips/bionic/__set_tls.c b/libc/arch-mips/bionic/__set_tls.c new file mode 100644 index 0000000..38e3a50 --- /dev/null +++ b/libc/arch-mips/bionic/__set_tls.c @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include <pthread.h> + +extern int __set_thread_area(void *u_info); + +int __set_tls(void *ptr) +{ + return __set_thread_area(ptr); +} diff --git a/libc/arch-mips/bionic/_exit_with_stack_teardown.S b/libc/arch-mips/bionic/_exit_with_stack_teardown.S new file mode 100644 index 0000000..9974e84 --- /dev/null +++ b/libc/arch-mips/bionic/_exit_with_stack_teardown.S @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <asm/unistd.h> + + .text + +/* void _exit_with_stack_teardown(void * stackBase, int stackSize, int retCode) */ + + .type _exit_with_stack_teardown, @function + .global _exit_with_stack_teardown + .align 4 + .ent _exit_with_stack_teardown +_exit_with_stack_teardown: + move $s0,$a2 /* preserve retCode for exit() call */ + + li $v0,__NR_munmap + syscall /* the stack is destroyed by this call */ + move $a0,$s0 + li $v0,__NR_exit + syscall + + /* exit() should never return, cause a crash if it does */ + move $a0,$0 + lw $a0,($a0) + .end _exit_with_stack_teardown diff --git a/libc/arch-mips/bionic/_setjmp.S b/libc/arch-mips/bionic/_setjmp.S new file mode 100644 index 0000000..e7083ae --- /dev/null +++ b/libc/arch-mips/bionic/_setjmp.S @@ -0,0 +1,188 @@ +/* $OpenBSD: _setjmp.S,v 1.4 2005/08/07 16:40:15 espie Exp $ */ + +/* + * Copyright (c) 2002 Opsycon AB (www.opsycon.se / www.opsycon.com) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Opsycon AB nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include <machine/asm.h> +#include <machine/regnum.h> +#include <machine/signal.h> + +/* + * _setjmp, _longjmp (not restoring signal state) + * + * XXX FPSET should probably be taken from SR setting. hmmm... + * GPOFF and FRAMESIZE must be the same for both _setjmp and _longjmp! + * + */ + +FRAMESZ= MKFSIZ(0,4) +GPOFF= FRAMESZ-2*REGSZ + +#define FPREG64_S(FPR, OFF, BASE) \ + swc1 FPR, OFF(BASE) ; \ + mfhc1 t0, FPR ; \ + sw t0, OFF+4(BASE) ; + +#define FPREG64_L(FPR, OFF, BASE) \ + lw t0, OFF+4(BASE) ; \ + lw t1, OFF(BASE) ; \ + mtc1 t1, FPR ; \ + mthc1 t0, FPR ; \ + +LEAF(_setjmp, FRAMESZ) + PTR_SUBU sp, FRAMESZ + SETUP_GP64(GPOFF, _setjmp) + SAVE_GP(GPOFF) + .set noreorder +#if defined(__mips64) + dli v0, 0xACEDBADE # sigcontext magic number +#else + li v0, 0xACEDBADE # sigcontext magic number +#endif + REG_S v0, SC_REGS+ZERO*REGSZ(a0) + REG_S s0, SC_REGS+S0*REGSZ(a0) + REG_S s1, SC_REGS+S1*REGSZ(a0) + REG_S s2, SC_REGS+S2*REGSZ(a0) + REG_S s3, SC_REGS+S3*REGSZ(a0) + REG_S s4, SC_REGS+S4*REGSZ(a0) + REG_S s5, SC_REGS+S5*REGSZ(a0) + REG_S s6, SC_REGS+S6*REGSZ(a0) + REG_S s7, SC_REGS+S7*REGSZ(a0) + REG_S s8, SC_REGS+S8*REGSZ(a0) + REG_L v0, GPOFF(sp) + REG_S v0, SC_REGS+GP*REGSZ(a0) + PTR_ADDU v0, sp, FRAMESZ + REG_S v0, SC_REGS+SP*REGSZ(a0) + REG_S ra, SC_PC(a0) + +#if !defined(SOFTFLOAT) + li v0, 1 # be nice if we could tell + REG_S v0, SC_FPUSED(a0) # sc_fpused = 1 + cfc1 v0, $31 +#if _MIPS_FPSET == 32 + FPREG64_S($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) + FPREG64_S($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) + FPREG64_S($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) + FPREG64_S($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) + FPREG64_S($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) + FPREG64_S($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) + FPREG64_S($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) + FPREG64_S($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) + FPREG64_S($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) + FPREG64_S($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) + FPREG64_S($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) + FPREG64_S($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) +#else + swc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + swc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + swc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + swc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + swc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + swc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + swc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + swc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + swc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + swc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + swc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) + swc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) +#endif + REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0) +#endif /* !SOFTFLOAT */ + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ + j ra + move v0, zero +END(_setjmp) + +LEAF(_longjmp, FRAMESZ) + PTR_SUBU sp, FRAMESZ + SETUP_GP64(GPOFF, _longjmp) + SAVE_GP(GPOFF) + .set noreorder + REG_L v0, SC_REGS+ZERO*REGSZ(a0) + bne v0, 0xACEDBADE, botch # jump if error + REG_L ra, SC_PC(a0) + REG_L v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0) + REG_L s0, SC_REGS+S0*REGSZ(a0) + REG_L s1, SC_REGS+S1*REGSZ(a0) + REG_L s2, SC_REGS+S2*REGSZ(a0) + REG_L s3, SC_REGS+S3*REGSZ(a0) + REG_L s4, SC_REGS+S4*REGSZ(a0) + REG_L s5, SC_REGS+S5*REGSZ(a0) + REG_L s6, SC_REGS+S6*REGSZ(a0) + REG_L s7, SC_REGS+S7*REGSZ(a0) + REG_L s8, SC_REGS+S8*REGSZ(a0) + REG_L gp, SC_REGS+GP*REGSZ(a0) + REG_L sp, SC_REGS+SP*REGSZ(a0) +#if !defined(SOFTFLOAT) + ctc1 v0, $31 +#if _MIPS_FPSET == 32 + FPREG64_L($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) + FPREG64_L($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) + FPREG64_L($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) + FPREG64_L($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) + FPREG64_L($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) + FPREG64_L($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) + FPREG64_L($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) + FPREG64_L($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) + FPREG64_L($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) + FPREG64_L($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) + FPREG64_L($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) + FPREG64_L($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) +#else + lwc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + lwc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + lwc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + lwc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + lwc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + lwc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + lwc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + lwc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + lwc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + lwc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + lwc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) + lwc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) +#endif +#endif /* !SOFTFLOAT */ + bne a1, zero, 1f + nop + li a1, 1 # never return 0! +1: + j ra + move v0, a1 + +botch: + jal longjmperror + nop + jal abort + nop + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ +END(_longjmp) + diff --git a/libc/arch-mips/bionic/atexit.S b/libc/arch-mips/bionic/atexit.S new file mode 100644 index 0000000..7f0c820 --- /dev/null +++ b/libc/arch-mips/bionic/atexit.S @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + .text + .globl atexit + .hidden atexit + .type atexit, @function + .align 4 + .ent atexit +atexit: + .set noreorder + .cpload $t9 + .set reorder + la $t9, __cxa_atexit + move $a1, $0 + la $a2, __dso_handle + j $t9 + .size atexit, .-atexit + .end atexit diff --git a/libc/arch-mips/bionic/bzero.S b/libc/arch-mips/bionic/bzero.S new file mode 100644 index 0000000..6739345 --- /dev/null +++ b/libc/arch-mips/bionic/bzero.S @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + .text + +/* + * void bzero(void *s, size_t n); + */ + .type bzero, @function + .global bzero + .align 4 + .ent bzero + .set noreorder +bzero: + .cpload $t9 + move $a2,$a1 + la $t9,memset + j $t9 + move $a1,$zero + .end bzero + diff --git a/libc/arch-mips/bionic/cacheflush.c b/libc/arch-mips/bionic/cacheflush.c new file mode 100644 index 0000000..05085b6 --- /dev/null +++ b/libc/arch-mips/bionic/cacheflush.c @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include <unistd.h> +#include <sys/cachectl.h> + +#ifdef DEBUG +#include <logd.h> +#define XLOG(...) \ + __libc_android_log_print(ANDROID_LOG_DEBUG,"libc-cacheflush",__VA_ARGS__) +#endif + +/* + * Linux historically defines a cacheflush(3) routine for MIPS + * with this signature: + * int cacheflush(char *addr, int nbytes, int cache); + * + * Android defines an alternate cacheflush routine which exposes the + * ARM system call interface: + * int cacheflush (long start, long end, long flags) + * + * This is an attempt to maintain compatibility between the historical MIPS + * usage for software previously ported to MIPS and Android specific + * uses of cacheflush() + * + * Use the gcc __clear_cache builtin if possible. This will generate inline synci + * instructions if available or call _flush_cache(start, len, BCACHE) directly + */ + +#if defined (__GNUC__) +#define GCC_VERSION ((__GNUC__*10000) + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) +#endif + +/* This is the Android signature */ +int cacheflush (long start, long end, long flags) +{ + if (end < start) { + /* + * It looks like this is really MIPS style cacheflush call + * start => addr + * end => nbytes + */ +#ifdef DEBUG + static int warned = 0; + if (!warned) { + XLOG("called with (start,len) instead of (start,end)"); + warned = 1; + } +#endif + end += start; + } + +#if !defined(ARCH_MIPS_USE_FLUSHCACHE_SYSCALL) && \ + defined(GCC_VERSION) && (GCC_VERSION >= 40300) + +#if (__mips_isa_rev >= 2) && (GCC_VERSION < 40403) + /* + * Modify "start" and "end" to avoid GCC 4.3.0-4.4.2 bug in + * mips_expand_synci_loop that may execute synci one more time. + * "start" points to the first byte of the cache line. + * "end" points to the last byte of the line before the last cache line. + * Because size is always a multiple of 4, this is safe to set + * "end" to the last byte. + */ + { + int lineSize; + asm("rdhwr %0, $1" : "=r" (lineSize)); + start = start & (-lineSize); + end = (end & (-lineSize)) - 1; + } +#endif + __builtin___clear_cache((char *)start, (char *)end); +#else + _flush_cache((char *)start, end-start, BCACHE); +#endif + return 0; +} diff --git a/libc/arch-mips/bionic/clone.S b/libc/arch-mips/bionic/clone.S new file mode 100644 index 0000000..30fef8d --- /dev/null +++ b/libc/arch-mips/bionic/clone.S @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include <linux/sched.h> +#include <sys/linux-syscalls.h> +#include <linux/errno.h> + + .text + .type __pthread_clone, @function + .global __pthread_clone + .align 4 + .ent __pthread_clone + +/* + * int __pthread_clone(int (*fn)(void*), void *child_stack, + * int flags, void *arg); + */ + +__pthread_clone: + .set noreorder + .cpload $t9 + .set reorder + + # set up child stack + subu $a1,16 + sw $a0,0($a1) # fn + sw $a3,4($a1) # arg +# sw $a1+16,8($a1) # tls + + /* + * int sys_clone(int flags, void *child_stack, int *parent_tidptr, + * struct user_desc *newtls, int *child_tidptr); + */ + + move $a0,$a2 # flags +# move $a1,$a1 # child_stack + move $a2,$0 # parent_tidptr + move $a3,$0 # user_desc + and $a0,~(CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID) + # make sure the kernel doesn't access child_tidptr + + li $v0,__NR_clone + syscall + + bnez $a3,.L__error + + beqz $v0,.L__thread_start + + j $ra + +.L__thread_start: + lw $a0,0($sp) # fn + lw $a1,4($sp) # arg + addu $a2,$sp,16 # tls + + # void __thread_entry(int (*func)(void*), void *arg, void *tls) + la $t9, __thread_entry + j $t9 + +.L__error: + move $a0,$v0 + la $t9,__set_errno + j $t9 + + .end __pthread_clone + + + # + # This function is defined as: + # + # pid_t __bionic_clone( int flags, void *child_stack, + # pid_t *pid, void *tls, pid_t *ctid, + # int (*fn)(void *), void* arg ); + # + # NOTE: This is not the same signature than the GLibc + # __clone function here !! Placing 'fn' and 'arg' + # at the end of the parameter list makes the + # implementation much simpler. + # + .text + .type __bionic_clone, @function + .global __bionic_clone + .align 4 + .ent __bionic_clone +__bionic_clone: + .set noreorder + .cpload $t9 + .set reorder + + # set up child stack + subu $a1,16 + lw $t0,20($sp) # fn + lw $t1,24($sp) # arg + sw $t0,0($a1) # fn + sw $t1,4($a1) # arg + + # remainder of arguments are correct for clone system call + li $v0,__NR_clone + syscall + + bnez $a3,.L__error_bc + + beqz $v0,.L__thread_start_bc + + j $ra + +.L__thread_start_bc: + lw $a0,0($sp) # fn + lw $a1,4($sp) # arg + + # void __bionic_clone_entry(int (*func)(void*), void *arg) + la $t9,__bionic_clone_entry + j $t9 + +.L__error_bc: + move $a0,$v0 + la $t9,__set_errno + j $t9 + + .end __bionic_clone + diff --git a/libc/arch-mips/bionic/crtbegin.S b/libc/arch-mips/bionic/crtbegin.S new file mode 100644 index 0000000..40b689e --- /dev/null +++ b/libc/arch-mips/bionic/crtbegin.S @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + .text + .align 4 + .type __start,@function + .globl __start + .globl _start + +# this is the small startup code that is first run when +# any executable that is statically-linked with Bionic +# runs. +# +# it's purpose is to call __libc_init with appropriate +# arguments, which are: +# +# - the address of the raw data block setup by the Linux +# kernel ELF loader +# +# - address of an "onexit" function, not used on any +# platform supported by Bionic +# +# - address of the "main" function of the program. +# +# - address of the constructor list +# + + .ent __start +__start: +_start: + bal 1f +1: + .set noreorder + .cpload $ra + .set reorder + + move $a0, $sp + move $a1, $0 + la $a2, main + la $a3, 1f + subu $sp, 32 + la $t9, __libc_init + j $t9 + .end __start + +1: .long __PREINIT_ARRAY__ + .long __INIT_ARRAY__ + .long __FINI_ARRAY__ + + .section .preinit_array, "aw" + .type __PREINIT_ARRAY__, @object + .globl __PREINIT_ARRAY__ +__PREINIT_ARRAY__: + .long -1 + + .section .init_array, "aw" + .type __INIT_ARRAY__, @object + .globl __INIT_ARRAY__ +__INIT_ARRAY__: + .long -1 + + .section .fini_array, "aw" + .type __FINI_ARRAY__, @object + .globl __FINI_ARRAY__ +__FINI_ARRAY__: + .long -1 + .long __do_global_dtors_aux + + .abicalls + .text + .align 2 + .set nomips16 + .ent __do_global_dtors_aux + .type __do_global_dtors_aux, @function +__do_global_dtors_aux: + .frame $sp,32,$31 # vars= 0, regs= 1/0, args= 16, gp= 8 + .mask 0x80000000,-4 + .fmask 0x00000000,0 + .set noreorder + .cpload $25 + .set nomacro + addiu $sp,$sp,-32 + sw $31,28($sp) + .cprestore 16 + lw $2,%got(completed.1269)($28) + lbu $2,%lo(completed.1269)($2) + bne $2,$0,$L8 + nop + +$L4: + lw $2,%got(__cxa_finalize)($28) + beq $2,$0,$L6 + nop + + lw $2,%got(__dso_handle)($28) + lw $4,0($2) + lw $25,%call16(__cxa_finalize)($28) + .reloc 1f,R_MIPS_JALR,__cxa_finalize +1: jalr $25 + nop + + lw $28,16($sp) +$L6: + lw $2,%got(completed.1269)($28) + li $3,1 # 0x1 + sb $3,%lo(completed.1269)($2) +$L8: + lw $31,28($sp) + addiu $sp,$sp,32 + j $31 + nop + + .set macro + .set reorder + .end __do_global_dtors_aux + .size __do_global_dtors_aux, .-__do_global_dtors_aux + .local completed.1269 + .comm completed.1269,1,1 + .weak __cxa_finalize + +#include "__dso_handle.S" +#include "atexit.S" diff --git a/libc/arch-mips/bionic/crtbegin_so.S b/libc/arch-mips/bionic/crtbegin_so.S new file mode 100644 index 0000000..377888a --- /dev/null +++ b/libc/arch-mips/bionic/crtbegin_so.S @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + .section .init_array, "aw" + .type __INIT_ARRAY__, @object + .globl __INIT_ARRAY__ +__INIT_ARRAY__: + .long -1 + + .section .fini_array, "aw" + .type __FINI_ARRAY__, @object + .globl __FINI_ARRAY__ +__FINI_ARRAY__: + .long -1 + .long __do_global_dtors_aux + + .abicalls + .text + .align 2 + .set nomips16 + .ent __do_global_dtors_aux + .type __do_global_dtors_aux, @function +__do_global_dtors_aux: + .frame $sp,32,$31 # vars= 0, regs= 1/0, args= 16, gp= 8 + .mask 0x80000000,-4 + .fmask 0x00000000,0 + .set noreorder + .cpload $25 + .set nomacro + addiu $sp,$sp,-32 + sw $31,28($sp) + .cprestore 16 + lw $2,%got(completed.1269)($28) + lbu $2,%lo(completed.1269)($2) + bne $2,$0,$L8 + nop + +$L4: + lw $2,%got(__cxa_finalize)($28) + beq $2,$0,$L6 + nop + + lw $2,%got(__dso_handle)($28) + lw $4,0($2) + lw $25,%call16(__cxa_finalize)($28) + .reloc 1f,R_MIPS_JALR,__cxa_finalize +1: jalr $25 + nop + + lw $28,16($sp) +$L6: + lw $2,%got(completed.1269)($28) + li $3,1 # 0x1 + sb $3,%lo(completed.1269)($2) +$L8: + lw $31,28($sp) + addiu $sp,$sp,32 + j $31 + nop + + .set macro + .set reorder + .end __do_global_dtors_aux + .size __do_global_dtors_aux, .-__do_global_dtors_aux + .local completed.1269 + .comm completed.1269,1,1 + .weak __cxa_finalize + +#include "__dso_handle_so.S" +#include "atexit.S" diff --git a/libc/arch-mips/bionic/crtend.S b/libc/arch-mips/bionic/crtend.S new file mode 100644 index 0000000..6984d0e --- /dev/null +++ b/libc/arch-mips/bionic/crtend.S @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + .section .preinit_array, "aw" + .long 0 + + .section .init_array, "aw" + .long 0 + + .section .fini_array, "aw" + .long 0 + diff --git a/libc/arch-mips/bionic/crtend_so.S b/libc/arch-mips/bionic/crtend_so.S new file mode 100644 index 0000000..f09c427 --- /dev/null +++ b/libc/arch-mips/bionic/crtend_so.S @@ -0,0 +1,5 @@ + .section .init_array, "aw" + .long 0 + + .section .fini_array, "aw" + .long 0 diff --git a/libc/arch-mips/bionic/ffs.S b/libc/arch-mips/bionic/ffs.S new file mode 100644 index 0000000..ef38b2a --- /dev/null +++ b/libc/arch-mips/bionic/ffs.S @@ -0,0 +1,92 @@ +/* $NetBSD: ffs.S,v 1.5 2003/04/05 23:08:52 bjh21 Exp $ */ +/* + * Copyright (c) 2001 Christopher Gilbert + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * ffs - find first set bit, this algorithm isolates the first set + * bit, then multiplies the number by 0x0450fbaf which leaves the top + * 6 bits as an index into the table. This algorithm should be a win + * over the checking each bit in turn as per the C compiled version. + * + * This is the ffs algorithm devised by d.seal and posted to comp.sys.arm on + * 16 Feb 1994. + */ + + .text + + .ent ffs + .type ffs, @function + .global ffs + .align 4 + .set noreorder +ffs: +#if (__mips==32) + subu $t0,$0,$a0 + and $a0,$t0 + clz $t0,$a0 + li $v0,32 + j $ra + subu $v0,$t0 +#else +/* Size of the ffs routine in bytes + * This is used to index .L_ffs_table from $t9 + * FIXME: there must be a better way to do this + */ +#define FFSSIZE 12*4 + subu $t0,$0,$a0 + and $a0,$t0 + /* + * now a0 has at most one set bit, call this X + * if X = 0, all further instructions are skipped + */ + sll $t0,$a0,4 /* t0 = X * 0x00000010 */ + or $a0,$t0 /* a0 = X * 0x00000011 */ + sll $t0,$a0,6 /* t0 = X * 0x00000440 */ + or $a0,$t0 /* a0 = X * 0x00000451 */ + sll $t0,$a0,16 /* t0 = X * 0x04510000 */ + subu $a0,$t0,$a0 /* a0 = X * 0x0450fbaf */ + + /* now lookup in table indexed on top 6 bits of a0 */ + srl $a0,25 + addu $t9,$a0 + j $ra + lbu $v0,FFSSIZE($t9) +.L_ffs_table: +/* 0 1 2 3 4 5 6 7 */ + .byte 0, 1, 2, 13, 3, 7, 0, 14 /* 0- 7 */ + .byte 4, 0, 8, 0, 0, 0, 0, 15 /* 8-15 */ + .byte 11, 5, 0, 0, 9, 0, 0, 26 /* 16-23 */ + .byte 0, 0, 0, 0, 0, 22, 28, 16 /* 24-31 */ + .byte 32, 12, 6, 0, 0, 0, 0, 0 /* 32-39 */ + .byte 10, 0, 0, 25, 0, 0, 21, 27 /* 40-47 */ + .byte 31, 0, 0, 0, 0, 24, 0, 20 /* 48-55 */ + .byte 30, 0, 23, 19, 29, 18, 17, 0 /* 56-63 */ + +#endif + .end ffs diff --git a/libc/arch-mips/bionic/futex_mips.S b/libc/arch-mips/bionic/futex_mips.S new file mode 100644 index 0000000..2a953ca --- /dev/null +++ b/libc/arch-mips/bionic/futex_mips.S @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <asm/unistd.h> + +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 + +/* + * __futex_wait(*ftx, val, *timespec) + * futex_syscall(*ftx, op, val, *timespec, *addr2, val3) + */ + .type __futex_wait, @function + .global __futex_wait + .align 4 + .ent __futex_wait +__futex_wait: + subu $sp,4*6 + sw $0,20($sp) /* val3 */ + sw $0,16($sp) /* addr2 */ + move $a3,$a2 /* timespec */ + move $a2,$a1 /* val */ + li $a1,FUTEX_WAIT /* op */ +# move $a0,$a0 /* ftx */ + li $v0,__NR_futex + syscall + .set noreorder + bnez $a3, 1f /* Check for error */ + neg $v0 /* Negate error number if it's valid */ + move $v0,$0 /* Otherwise return 0 */ +1: + .set reorder + addu $sp,4*6 + j $ra + .end __futex_wait + +/* + * int __futex_wake(volatile void *ftx, int count) + * int futex_syscall(*ftx, op, val, *timespec, *addr2, val3) + */ + .type __futex_wake, @function + .globl __futex_wake + .align 4 + .ent __futex_wake +__futex_wake: + subu $sp,4*6 + sw $0,20($sp) /* val3 */ + sw $0,16($sp) /* addr2 */ + move $a3,$0 /* timespec */ + move $a2,$a1 /* val */ + li $a1,FUTEX_WAKE /* op */ +# move $a0,$a0 /* ftx */ + li $v0,__NR_futex + syscall + .set noreorder + bnez $a3, 1f /* Check for error */ + neg $v0 /* Negate error number if it's valid */ + move $v0,$0 /* Otherwise return 0 */ +1: + .set reorder + addu $sp,4*6 + j $ra + .end __futex_wake + +/* __futex_syscall3(*ftx, op, val) + * futex_syscall(*ftx, op, val, *timespec, *addr2, val3) + */ + .type __futex_syscall3, @function + .global __futex_syscall3 + .align 4 + .ent __futex_syscall3 +__futex_syscall3: + subu $sp,4*6 + sw $0,20($sp) /* val3 */ + sw $0,16($sp) /* addr2 */ + move $a3,$0 /* timespec */ +# move $a2,$a2 /* val */ +# li $a1,$a1 /* op */ +# move $a0,$a0 /* ftx */ + li $v0,__NR_futex + syscall + .set noreorder + bnez $a3, 1f /* Check for error */ + neg $v0 /* Negate error number if it's valid */ + move $v0,$0 /* Otherwise return 0 */ +1: + .set reorder + addu $sp,4*6 + j $ra + .end __futex_syscall3 + +/* __futex_syscall4(*ftx, op, val) + * futex_syscall(*ftx, op, val, *timespec, *addr2, val3) + */ + .type __futex_syscall4, @function + .global __futex_syscall4 + .align 4 + .ent __futex_syscall4 +__futex_syscall4: + subu $sp,4*6 + sw $0,20($sp) /* val3 */ + sw $0,16($sp) /* addr2 */ +# move $a3,$a3 /* timespec */ +# move $a2,$a2 /* val */ +# li $a1,$a1 /* op */ +# move $a0,$a0 /* ftx */ + li $v0,__NR_futex + syscall + .set noreorder + bnez $a3, 1f /* Check for error */ + neg $v0 /* Negate error number if it's valid */ + move $v0,$0 /* Otherwise return 0 */ +1: + .set reorder + addu $sp,4*6 + j $ra + .end __futex_syscall4 diff --git a/libc/arch-mips/bionic/memcmp16.S b/libc/arch-mips/bionic/memcmp16.S new file mode 100644 index 0000000..a2b2544 --- /dev/null +++ b/libc/arch-mips/bionic/memcmp16.S @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + .text + +/* + * u4 __memcmp16(const u2* s0, const u2* s1, size_t count); + */ + .type __memcmp16, @function + .global __memcmp16 + .align 4 + .ent __memcmp16 +__memcmp16: + li $t0,0 + li $t1,0 + beqz $a2,done /* 0 length string */ + beq $a0,$a1,done /* strings are identical */ + + /* Unoptimised... */ +1: lhu $t0,0($a0) + lhu $t1,0($a1) + addu $a1,2 + bne $t0,$t1,done + addu $a0,2 + subu $a2,1 + bnez $a2,1b + +done: + subu $v0,$t0,$t1 + j $ra + .end __memcmp16 diff --git a/libc/arch-mips/bionic/memmove.c b/libc/arch-mips/bionic/memmove.c new file mode 100644 index 0000000..1f4522b --- /dev/null +++ b/libc/arch-mips/bionic/memmove.c @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include <string.h> +#include <strings.h> + +void *memmove(void *dst, const void *src, size_t n) +{ + const char *p = src; + char *q = dst; + /* We can use the optimized memcpy if the destination is completely below the + * source (i.e. q + n <= p), or if it is completely over it (i.e. q >= p+n). + */ + if (__builtin_expect((q + n < p) || (q >= p + n), 1)) { + return memcpy(dst, src, n); + } else { + bcopy(src, dst, n); + return dst; + } +} diff --git a/libc/arch-mips/bionic/pipe.S b/libc/arch-mips/bionic/pipe.S new file mode 100644 index 0000000..0baf246 --- /dev/null +++ b/libc/arch-mips/bionic/pipe.S @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * The MIPS pipe syscall returns results in two registers, which + * we have to copy into the supplied array. This prevents us from + * using an auto-generated stub. + */ + +#include <asm/unistd.h> + + .text + +/* int pipe(int[]) */ + + .type pipe,@function + .global pipe + .align 4 + .ent pipe +pipe: + .set noreorder + .cpload $t9 + li $v0,__NR_pipe + syscall /* syscall returns results in v0,v1 */ + bnez $a3, 1f /* check errno */ + nop + sw $v0, 0($a0) + sw $v1, 4($a0) + j $ra + move $v0, $zero +1: + la $t9, __set_errno + j $t9 + move $a0, $v0 /* delay slot, prepare args for __set_errno */ + .end pipe diff --git a/libc/arch-mips/bionic/setjmp.S b/libc/arch-mips/bionic/setjmp.S new file mode 100644 index 0000000..7c21195 --- /dev/null +++ b/libc/arch-mips/bionic/setjmp.S @@ -0,0 +1,211 @@ +/* $OpenBSD: setjmp.S,v 1.5 2005/08/07 16:40:15 espie Exp $ */ + +/* + * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Opsycon AB nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include <machine/asm.h> +#include <machine/regnum.h> +#include <machine/signal.h> + +/* + * setjmp, longjmp implementation for libc. this code depends + * on the layout of the struct sigcontext in machine/signal.h. + * + */ + +FRAMESZ= MKFSIZ(2,6) +A1OFF= FRAMESZ-4*REGSZ +A0OFF= FRAMESZ-3*REGSZ +GPOFF= FRAMESZ-2*REGSZ +RAOFF= FRAMESZ-1*REGSZ + +#define FPREG64_S(FPR, OFF, BASE) \ + swc1 FPR, OFF(BASE) ; \ + mfhc1 t0, FPR ; \ + sw t0, OFF+4(BASE) ; + +#define FPREG64_L(FPR, OFF, BASE) \ + lw t0, OFF+4(BASE) ; \ + lw t1, OFF(BASE) ; \ + mtc1 t1, FPR ; \ + mthc1 t0, FPR ; \ + +NON_LEAF(setjmp, FRAMESZ, ra) + .mask 0x80000000, RAOFF + PTR_SUBU sp, FRAMESZ # allocate stack frame + SETUP_GP64(GPOFF, setjmp) + SAVE_GP(GPOFF) + .set reorder + REG_S ra, RAOFF(sp) # save state + REG_S a0, A0OFF(sp) + + move a0, zero # get current signal mask + jal sigblock + + REG_L v1, A0OFF(sp) # v1 = jmpbuf + REG_S v0, SC_MASK(v1) # save sc_mask = sigblock(0) + + REG_L a0, A0OFF(sp) # restore jmpbuf + REG_L ra, RAOFF(sp) + REG_S ra, SC_PC(a0) # sc_pc = return address +#if defined(__mips64) + dli v0, 0xACEDBADE # sigcontext magic number +#else + li v0, 0xACEDBADE # sigcontext magic number +#endif + REG_S v0, SC_REGS+ZERO*REGSZ(a0) + REG_S s0, SC_REGS+S0*REGSZ(a0) + REG_S s1, SC_REGS+S1*REGSZ(a0) + REG_S s2, SC_REGS+S2*REGSZ(a0) + REG_S s3, SC_REGS+S3*REGSZ(a0) + REG_S s4, SC_REGS+S4*REGSZ(a0) + REG_S s5, SC_REGS+S5*REGSZ(a0) + REG_S s6, SC_REGS+S6*REGSZ(a0) + REG_S s7, SC_REGS+S7*REGSZ(a0) + REG_S s8, SC_REGS+S8*REGSZ(a0) + REG_L v0, GPOFF(sp) + REG_S v0, SC_REGS+GP*REGSZ(a0) + PTR_ADDU v0, sp, FRAMESZ + REG_S v0, SC_REGS+SP*REGSZ(a0) + +#if !defined(SOFTFLOAT) + li v0, 1 # be nice if we could tell + REG_S v0, SC_FPUSED(a0) # sc_fpused = 1 + cfc1 v0, $31 +#if _MIPS_FPSET == 32 + FPREG64_S($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) + FPREG64_S($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) + FPREG64_S($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) + FPREG64_S($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) + FPREG64_S($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) + FPREG64_S($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) + FPREG64_S($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) + FPREG64_S($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) + FPREG64_S($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) + FPREG64_S($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) + FPREG64_S($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) + FPREG64_S($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) +#else + swc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + swc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + swc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + swc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + swc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + swc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + swc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + swc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + swc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + swc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + swc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) + swc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) +#endif + REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0) +#endif /* !SOFTFLOAT */ + move v0, zero + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ + j ra + +botch: + jal longjmperror + jal abort + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ +END(setjmp) + + +LEAF(longjmp, FRAMESZ) + PTR_SUBU sp, FRAMESZ + SETUP_GP64(GPOFF, longjmp) + SAVE_GP(GPOFF) + .set reorder + sw a1, A1OFF(sp) + sw a0, A0OFF(sp) + + lw a0, SC_MASK(a0) + jal sigsetmask + + lw a0, A0OFF(sp) + lw a1, A1OFF(sp) + + .set noreorder + REG_L v0, SC_REGS+ZERO*REGSZ(a0) + bne v0, 0xACEDBADE, botch # jump if error + REG_L ra, SC_PC(a0) + REG_L s0, SC_REGS+S0*REGSZ(a0) + REG_L s1, SC_REGS+S1*REGSZ(a0) + REG_L s2, SC_REGS+S2*REGSZ(a0) + REG_L s3, SC_REGS+S3*REGSZ(a0) + REG_L s4, SC_REGS+S4*REGSZ(a0) + REG_L s5, SC_REGS+S5*REGSZ(a0) + REG_L s6, SC_REGS+S6*REGSZ(a0) + REG_L s7, SC_REGS+S7*REGSZ(a0) + REG_L s8, SC_REGS+S8*REGSZ(a0) + REG_L gp, SC_REGS+GP*REGSZ(a0) + REG_L sp, SC_REGS+SP*REGSZ(a0) + +#if !defined(SOFTFLOAT) + REG_L v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0) + ctc1 v0, $31 +#if _MIPS_FPSET == 32 + FPREG64_L($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) + FPREG64_L($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) + FPREG64_L($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) + FPREG64_L($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) + FPREG64_L($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) + FPREG64_L($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) + FPREG64_L($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) + FPREG64_L($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) + FPREG64_L($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) + FPREG64_L($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) + FPREG64_L($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) + FPREG64_L($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) +#else + lwc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + lwc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + lwc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + lwc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + lwc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + lwc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + lwc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + lwc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + lwc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + lwc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + lwc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) + lwc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) +#endif +#endif /* !SOFTFLOAT */ + bne a1, zero, 1f + nop + li a1, 1 # never return 0! +1: + j ra + move v0, a1 + +END(longjmp) diff --git a/libc/arch-mips/bionic/sigsetjmp.S b/libc/arch-mips/bionic/sigsetjmp.S new file mode 100644 index 0000000..b05454c --- /dev/null +++ b/libc/arch-mips/bionic/sigsetjmp.S @@ -0,0 +1,77 @@ +/* $OpenBSD: sigsetjmp.S,v 1.5 2005/08/07 16:40:15 espie Exp $ */ +/*- + * Copyright (c) 1991, 1993, 1995, + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Havard Eidnes. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <machine/asm.h> +#include <machine/regnum.h> +#include <machine/setjmp.h> + +/* + * trampolines for sigsetjmp and siglongjmp save and restore mask. + * + */ +FRAMESZ= MKFSIZ(1,1) +GPOFF= FRAMESZ-2*REGSZ + +LEAF(sigsetjmp, FRAMESZ) + PTR_SUBU sp, FRAMESZ + SETUP_GP64(GPOFF, sigsetjmp) + .set reorder + REG_S a1, (_JBLEN*REGSZ)(a0) # save "savemask" + bne a1, 0x0, 1f # do saving of signal mask? + LA t9, _setjmp + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ + jr t9 + +1: LA t9, setjmp + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ + jr t9 +END(sigsetjmp) + +LEAF(siglongjmp, FRAMESZ) + PTR_SUBU sp, FRAMESZ + SETUP_GP64(GPOFF, siglongjmp) + .set reorder + REG_L t0, (_JBLEN*REGSZ)(a0) # get "savemask" + bne t0, 0x0, 1f # restore signal mask? + LA t9, _longjmp + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ + jr t9 +1: + LA t9, longjmp + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ + jr t9 +END(siglongjmp) diff --git a/libc/arch-mips/bionic/vfork.S b/libc/arch-mips/bionic/vfork.S new file mode 100644 index 0000000..2e2e4ff --- /dev/null +++ b/libc/arch-mips/bionic/vfork.S @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <asm/unistd.h> + + .text + +/* int vfork() implemented using clone() */ + + .type vfork, @function + .global vfork + .align 4 + .ent vfork +vfork: + .set noreorder + .cpload $t9 + + li $a0, 0x4112 /* CLONE_VM | CLONE_VFORK | SIGCHLD */ + move $a1, $sp + li $v0, __NR_clone + syscall + bnez $a3,1f + nop + + j $ra + nop +1: + la $t9,__set_errno + j $t9 + move $a0,$v0 + .end vfork diff --git a/libc/arch-mips/include/endian.h b/libc/arch-mips/include/endian.h new file mode 100644 index 0000000..6d4ca4e --- /dev/null +++ b/libc/arch-mips/include/endian.h @@ -0,0 +1,77 @@ +/* $OpenBSD: endian.h,v 1.5 2006/02/27 23:35:59 miod Exp $ */ + +/* + * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#ifndef _MIPS64_ENDIAN_H_ +#define _MIPS64_ENDIAN_H_ + +#if defined(__MIPSEL__) +#define _BYTE_ORDER _LITTLE_ENDIAN +#endif +#if defined(__MIPSEB__) +#define _BYTE_ORDER _BIG_ENDIAN +#endif + +#if !defined(_BYTE_ORDER) && !defined(lint) +#error "__MIPSEL__ or __MIPSEB__ must be defined to define BYTE_ORDER!!!" +#endif + +#ifdef __GNUC__ + +#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) +#define __swap16md(x) ({ \ + register uint16_t _x = (x); \ + register uint16_t _r; \ + __asm volatile ("wsbh %0, %1" : "=r" (_r) : "r" (_x)); \ + _r; \ +}) + +#define __swap32md(x) ({ \ + register uint32_t _x = (x); \ + register uint32_t _r; \ + __asm volatile ("wsbh %0, %1; rotr %0, %0, 16" : "=r" (_r) : "r" (_x)); \ + _r; \ +}) + +#define __swap64md(x) ({ \ + uint64_t _swap64md_x = (x); \ + (uint64_t) __swap32md(_swap64md_x >> 32) | \ + (uint64_t) __swap32md(_swap64md_x & 0xffffffff) << 32; \ +}) + +/* Tell sys/endian.h we have MD variants of the swap macros. */ +#define MD_SWAP + +#endif /* __mips32r2__ */ +#endif /* __GNUC__ */ + + +#include <sys/endian.h> + +#define __STRICT_ALIGNMENT + +#endif /* _MIPS64_ENDIAN_H_ */ diff --git a/libc/arch-mips/include/machine/_types.h b/libc/arch-mips/include/machine/_types.h new file mode 100644 index 0000000..1cc6c21 --- /dev/null +++ b/libc/arch-mips/include/machine/_types.h @@ -0,0 +1,145 @@ +/* $OpenBSD: _types.h,v 1.5 2008/07/21 20:50:54 martynas Exp $ */ + +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)types.h 8.3 (Berkeley) 1/5/94 + * @(#)ansi.h 8.2 (Berkeley) 1/4/94 + */ + +#ifndef _MIPS64__TYPES_H_ +#define _MIPS64__TYPES_H_ + +/* + * We need to handle the various ISA levels for sizes. + */ +#define _MIPS_ISA_MIPS1 1 /* R2000/R3000 */ +#define _MIPS_ISA_MIPS2 2 /* R4000/R6000 */ +#define _MIPS_ISA_MIPS3 3 /* R4000 */ +#define _MIPS_ISA_MIPS4 4 /* TFP (R1x000) */ + +/* 7.18.1.1 Exact-width integer types */ +typedef __signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +/* LONGLONG */ +typedef long long __int64_t; +/* LONGLONG */ +typedef unsigned long long __uint64_t; + +/* 7.18.1.2 Minimum-width integer types */ +typedef __int8_t __int_least8_t; +typedef __uint8_t __uint_least8_t; +typedef __int16_t __int_least16_t; +typedef __uint16_t __uint_least16_t; +typedef __int32_t __int_least32_t; +typedef __uint32_t __uint_least32_t; +typedef __int64_t __int_least64_t; +typedef __uint64_t __uint_least64_t; + +/* 7.18.1.3 Fastest minimum-width integer types */ +typedef __int32_t __int_fast8_t; +typedef __uint32_t __uint_fast8_t; +typedef __int32_t __int_fast16_t; +typedef __uint32_t __uint_fast16_t; +typedef __int32_t __int_fast32_t; +typedef __uint32_t __uint_fast32_t; +typedef __int64_t __int_fast64_t; +typedef __uint64_t __uint_fast64_t; + +/* 7.18.1.4 Integer types capable of holding object pointers */ +typedef long __intptr_t; +typedef unsigned long __uintptr_t; + +/* 7.18.1.5 Greatest-width integer types */ +typedef __int64_t __intmax_t; +typedef __uint64_t __uintmax_t; + +/* Register size */ +#if (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4) +typedef __int64_t __register_t; +typedef __int64_t f_register_t; /* XXX */ +#else +typedef __int32_t __register_t; +typedef __int32_t f_register_t; /* XXX */ +#endif + +/* VM system types */ +typedef unsigned long __vaddr_t; +typedef unsigned long __paddr_t; +typedef unsigned long __vsize_t; +typedef unsigned long __psize_t; + +/* Standard system types */ +typedef int __clock_t; +typedef int __clockid_t; +typedef double __double_t; +typedef float __float_t; +typedef long long __off_t; +typedef long __ptrdiff_t; +/*typedef unsigned long __size_t;*/ +typedef long __ssize_t; +typedef int __time_t; +typedef int __timer_t; +#if defined(__GNUC__) && __GNUC__ >= 3 +typedef __builtin_va_list __va_list; +#else +typedef char * __va_list; +#endif + +/* Wide character support types */ +#ifndef __cplusplus +typedef int __wchar_t; +#endif +typedef int __wint_t; +typedef int __rune_t; +typedef void * __wctrans_t; +typedef void * __wctype_t; + +#ifdef __MIPSEB__ +#define _BYTE_ORDER _BIG_ENDIAN +#else +#define _BYTE_ORDER _LITTLE_ENDIAN +#endif + +#if defined(_KERNEL) +typedef struct label_t { + __register_t val[14]; +} label_t; +#endif + +/* XXX check why this still has to be defined. pmap.c issue? */ +#define __SWAP_BROKEN + +/* Feature test macros */ +#define __HAVE_TIMECOUNTER + +#endif /* _MIPS64__TYPES_H_ */ diff --git a/libc/arch-mips/include/machine/asm.h b/libc/arch-mips/include/machine/asm.h new file mode 100644 index 0000000..43dbc09 --- /dev/null +++ b/libc/arch-mips/include/machine/asm.h @@ -0,0 +1,305 @@ +/* $OpenBSD: asm.h,v 1.7 2004/10/20 12:49:15 pefo Exp $ */ + +/* + * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#ifndef _MIPS64_ASM_H +#define _MIPS64_ASM_H + +#include <machine/regdef.h> + +#ifdef NEED_OLD_RM7KFIX +#define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; +#else +#define ITLBNOPFIX nop;nop;nop;nop +#endif + +#define _MIPS_ISA_MIPS1 1 /* R2000/R3000 */ +#define _MIPS_ISA_MIPS2 2 /* R4000/R6000 */ +#define _MIPS_ISA_MIPS3 3 /* R4000 */ +#define _MIPS_ISA_MIPS4 4 /* TFP (R1x000) */ +#ifdef __linux__ +#define _MIPS_ISA_MIPS5 5 +#define _MIPS_ISA_MIPS32 6 +#define _MIPS_ISA_MIPS64 7 +#else +#define _MIPS_ISA_MIPS32 32 /* MIPS32 */ +#endif + +#if !defined(ABICALLS) && !defined(_NO_ABICALLS) +#define ABICALLS .abicalls +#endif + +#if defined(ABICALLS) && !defined(_KERNEL) + ABICALLS +#endif + +#define _C_LABEL(x) x /* XXX Obsolete but keep for a while */ + +#if !defined(__MIPSEL__) && !defined(__MIPSEB__) +#error "__MIPSEL__ or __MIPSEB__ must be defined" +#endif +/* + * Define how to access unaligned data word + */ +#if defined(__MIPSEL__) +#define LWLO lwl +#define LWHI lwr +#define SWLO swl +#define SWHI swr +#define LDLO ldl +#define LDHI ldr +#define SDLO sdl +#define SDHI sdr +#endif +#if defined(__MIPSEB__) +#define LWLO lwr +#define LWHI lwl +#define SWLO swr +#define SWHI swl +#define LDLO ldr +#define LDHI ldl +#define SDLO sdr +#define SDHI sdl +#endif + +/* + * Define programming environment for ABI. + */ +#if defined(ABICALLS) && !defined(_KERNEL) && !defined(_STANDALONE) + +#ifndef _MIPS_SIM +#define _MIPS_SIM 1 +#define _ABIO32 1 +#endif +#ifndef _MIPS_ISA +#define _MIPS_ISA 2 +#define _MIPS_ISA_MIPS2 2 +#endif + +#if (_MIPS_SIM == _ABIO32) || (_MIPS_SIM == _ABI32) +#define NARGSAVE 4 + +#define SETUP_GP \ + .set noreorder; \ + .cpload t9; \ + .set reorder; + +#define SAVE_GP(x) \ + .cprestore x + +#define SETUP_GP64(gpoff, name) +#define RESTORE_GP64 +#endif + +#if (_MIPS_SIM == _ABI64) || (_MIPS_SIM == _ABIN32) +#define NARGSAVE 0 + +#define SETUP_GP +#define SAVE_GP(x) +#define SETUP_GP64(gpoff, name) \ + .cpsetup t9, gpoff, name +#define RESTORE_GP64 \ + .cpreturn +#endif + +#define MKFSIZ(narg,locals) (((narg+locals)*REGSZ+31)&(~31)) + +#else /* defined(ABICALLS) && !defined(_KERNEL) */ + +#define NARGSAVE 4 +#define SETUP_GP +#define SAVE_GP(x) + +#define ALIGNSZ 16 /* Stack layout alignment */ +#define FRAMESZ(sz) (((sz) + (ALIGNSZ-1)) & ~(ALIGNSZ-1)) + +#endif + +/* + * Basic register operations based on selected ISA + */ +#if (_MIPS_ISA == _MIPS_ISA_MIPS1 || _MIPS_ISA == _MIPS_ISA_MIPS2 || _MIPS_ISA == _MIPS_ISA_MIPS32) +#define REGSZ 4 /* 32 bit mode register size */ +#define LOGREGSZ 2 /* log rsize */ +#define REG_S sw +#define REG_L lw +#define CF_SZ 24 /* Call frame size */ +#define CF_ARGSZ 16 /* Call frame arg size */ +#define CF_RA_OFFS 20 /* Call ra save offset */ +#endif + +#if (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4) +#define REGSZ 8 /* 64 bit mode register size */ +#define LOGREGSZ 3 /* log rsize */ +#define REG_S sd +#define REG_L ld +#define CF_SZ 48 /* Call frame size (multiple of ALIGNSZ) */ +#define CF_ARGSZ 32 /* Call frame arg size */ +#define CF_RA_OFFS 40 /* Call ra save offset */ +#endif + +#define REGSZ_FP 8 /* 64 bit FP register size */ + +#ifndef __LP64__ +#define PTR_L lw +#define PTR_S sw +#define PTR_SUB sub +#define PTR_ADD add +#define PTR_SUBU subu +#define PTR_ADDU addu +#define LI li +#define LA la +#define PTR_SLL sll +#define PTR_SRL srl +#define PTR_VAL .word +#else +#define PTR_L ld +#define PTR_S sd +#define PTR_ADD dadd +#define PTR_SUB dsub +#define PTR_SUBU dsubu +#define PTR_ADDU daddu +#define LI dli +#define LA dla +#define PTR_SLL dsll +#define PTR_SRL dsrl +#define PTR_VAL .dword +#endif + +/* + * Define -pg profile entry code. + */ +#if defined(XGPROF) || defined(XPROF) +#define MCOUNT \ + PTR_SUBU sp, sp, 32; \ + SAVE_GP(16); \ + sw ra, 28(sp); \ + sw gp, 24(sp); \ + .set noat; \ + .set noreorder; \ + move AT, ra; \ + jal _mcount; \ + PTR_SUBU sp, sp, 8; \ + lw ra, 28(sp); \ + PTR_ADDU sp, sp, 32; \ + .set reorder; \ + .set at; +#else +#define MCOUNT +#endif + +/* + * LEAF(x, fsize) + * + * Declare a leaf routine. + */ +#define LEAF(x, fsize) \ + .align 3; \ + .globl x; \ + .ent x, 0; \ +x: ; \ + .frame sp, fsize, ra; \ + SETUP_GP \ + MCOUNT + +#define ALEAF(x) \ + .globl x; \ +x: + +/* + * NLEAF(x) + * + * Declare a non-profiled leaf routine. + */ +#define NLEAF(x, fsize) \ + .align 3; \ + .globl x; \ + .ent x, 0; \ +x: ; \ + .frame sp, fsize, ra; \ + SETUP_GP + +/* + * NON_LEAF(x) + * + * Declare a non-leaf routine (a routine that makes other C calls). + */ +#define NON_LEAF(x, fsize, retpc) \ + .align 3; \ + .globl x; \ + .ent x, 0; \ +x: ; \ + .frame sp, fsize, retpc; \ + SETUP_GP \ + MCOUNT + +/* + * NNON_LEAF(x) + * + * Declare a non-profiled non-leaf routine + * (a routine that makes other C calls). + */ +#define NNON_LEAF(x, fsize, retpc) \ + .align 3; \ + .globl x; \ + .ent x, 0; \ +x: ; \ + .frame sp, fsize, retpc \ + SETUP_GP + +/* + * END(x) + * + * Mark end of a procedure. + */ +#define END(x) \ + .end x + +/* + * Macros to panic and printf from assembly language. + */ +#define PANIC(msg) \ + LA a0, 9f; \ + jal panic; \ + nop ; \ + MSG(msg) + +#define PRINTF(msg) \ + la a0, 9f; \ + jal printf; \ + nop ; \ + MSG(msg) + +#define MSG(msg) \ + .rdata; \ +9: .asciiz msg; \ + .text + +#define ASMSTR(str) \ + .asciiz str; \ + .align 3 + +#endif /* !_MIPS_ASM_H */ diff --git a/libc/arch-mips/include/machine/cdefs.h b/libc/arch-mips/include/machine/cdefs.h new file mode 100644 index 0000000..d52376a --- /dev/null +++ b/libc/arch-mips/include/machine/cdefs.h @@ -0,0 +1,47 @@ +/* $OpenBSD: cdefs.h,v 1.4 2006/01/10 00:04:04 millert Exp $ */ + +/* + * Copyright (c) 2002-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + + +#ifndef _MIPS_CDEFS_H_ +#define _MIPS_CDEFS_H_ + +#if defined(lint) +#define __indr_reference(sym,alias) __lint_equal__(sym,alias) +#define __warn_references(sym,msg) +#define __weak_alias(alias,sym) __lint_equal__(sym,alias) +#elif defined(__GNUC__) && defined(__STDC__) +#define __weak_alias(alias,sym) \ + __asm__(".weak " __STRING(alias) " ; " \ + __STRING(alias) " = " __STRING(sym)) +#define __warn_references(sym,msg) \ + __asm__(".section .gnu.warning." __STRING(sym) \ + " ; .ascii \"" msg "\" ; .text") +#define __indr_references(sym,msg) /* nothing */ +#endif + +#endif /* !_MIPS_CDEFS_H_ */ diff --git a/libc/arch-mips/include/machine/exec.h b/libc/arch-mips/include/machine/exec.h new file mode 100644 index 0000000..3c63f74 --- /dev/null +++ b/libc/arch-mips/include/machine/exec.h @@ -0,0 +1,188 @@ +/* $OpenBSD: exec.h,v 1.1 2004/10/18 19:05:36 grange Exp $ */ + +/* + * Copyright (c) 1996-2004 Per Fogelstrom, Opsycon AB + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#ifndef _MIPS64_EXEC_H_ +#define _MIPS64_EXEC_H_ + +#define __LDPGSZ 4096 + +/* + * Define what exec "formats" we should handle. + */ +#define NATIVE_EXEC_ELF +#define NATIVE_ELFSIZE 64 +#define EXEC_SCRIPT + +/* + * If included from sys/exec.h define kernels ELF format. + */ +#ifdef __LP64__ +#define ARCH_ELFSIZE 64 +#define DB_ELFSIZE 64 +#define ELF_TARG_CLASS ELFCLASS64 +#else +#define ARCH_ELFSIZE 32 +#define DB_ELFSIZE 32 +#define ELF_TARG_CLASS ELFCLASS32 +#endif + +#if defined(__MIPSEB__) +#define ELF_TARG_DATA ELFDATA2MSB +#else +#define ELF_TARG_DATA ELFDATA2LSB +#endif +#define ELF_TARG_MACH EM_MIPS + +#define _NLIST_DO_ELF + +#if defined(_LP64) +#define _KERN_DO_ELF64 +#if defined(COMPAT_O32) +#define _KERN_DO_ELF +#endif +#else +#define _KERN_DO_ELF +#endif + +/* Information taken from MIPS ABI supplemental */ + +/* Architecture dependent Segment types - p_type */ +#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */ + +/* Architecture dependent d_tag field for Elf32_Dyn. */ +#define DT_MIPS_RLD_VERSION 0x70000001 /* Runtime Linker Interface ID */ +#define DT_MIPS_TIME_STAMP 0x70000002 /* Timestamp */ +#define DT_MIPS_ICHECKSUM 0x70000003 /* Cksum of ext. str. and com. sizes */ +#define DT_MIPS_IVERSION 0x70000004 /* Version string (string tbl index) */ +#define DT_MIPS_FLAGS 0x70000005 /* Flags */ +#define DT_MIPS_BASE_ADDRESS 0x70000006 /* Segment base address */ +#define DT_MIPS_CONFLICT 0x70000008 /* Adr of .conflict section */ +#define DT_MIPS_LIBLIST 0x70000009 /* Address of .liblist section */ +#define DT_MIPS_LOCAL_GOTNO 0x7000000a /* Number of local .GOT entries */ +#define DT_MIPS_CONFLICTNO 0x7000000b /* Number of .conflict entries */ +#define DT_MIPS_LIBLISTNO 0x70000010 /* Number of .liblist entries */ +#define DT_MIPS_SYMTABNO 0x70000011 /* Number of .dynsym entries */ +#define DT_MIPS_UNREFEXTNO 0x70000012 /* First external DYNSYM */ +#define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in .dynsym */ +#define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */ +#define DT_MIPS_RLD_MAP 0x70000016 /* Address of debug map pointer */ + +#define DT_PROCNUM (DT_MIPS_RLD_MAP - DT_LOPROC + 1) + +/* + * Legal values for e_flags field of Elf32_Ehdr. + */ +#define EF_MIPS_NOREORDER 0x00000001 /* .noreorder was used */ +#define EF_MIPS_PIC 0x00000002 /* Contains PIC code */ +#define EF_MIPS_CPIC 0x00000004 /* Uses PIC calling sequence */ +#define EF_MIPS_ABI2 0x00000020 /* -n32 on Irix 6 */ +#define EF_MIPS_32BITMODE 0x00000100 /* 64 bit in 32 bit mode... */ +#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */ +#define E_MIPS_ARCH_1 0x00000000 +#define E_MIPS_ARCH_2 0x10000000 +#define E_MIPS_ARCH_3 0x20000000 +#define E_MIPS_ARCH_4 0x30000000 +#define EF_MIPS_ABI 0x0000f000 /* ABI level */ +#define E_MIPS_ABI_NONE 0x00000000 /* ABI level not set */ +#define E_MIPS_ABI_O32 0x00001000 +#define E_MIPS_ABI_O64 0x00002000 +#define E_MIPS_ABI_EABI32 0x00004000 +#define E_MIPS_ABI_EABI64 0x00004000 + +/* + * Mips special sections. + */ +#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */ +#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */ +#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */ + +/* + * Legal values for sh_type field of Elf32_Shdr. + */ +#define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link */ +#define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols */ +#define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes */ +#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */ +#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information */ +#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */ + +/* + * Legal values for sh_flags field of Elf32_Shdr. + */ +#define SHF_MIPS_GPREL 0x10000000 /* Must be part of global data area */ + +#if 0 +/* + * Entries found in sections of type SHT_MIPS_GPTAB. + */ +typedef union { + struct { + Elf32_Word gt_current_g_value; /* -G val used in compilation */ + Elf32_Word gt_unused; /* Not used */ + } gt_header; /* First entry in section */ + struct { + Elf32_Word gt_g_value; /* If this val were used for -G */ + Elf32_Word gt_bytes; /* This many bytes would be used */ + } gt_entry; /* Subsequent entries in section */ +} Elf32_gptab; + +/* + * Entry found in sections of type SHT_MIPS_REGINFO. + */ +typedef struct { + Elf32_Word ri_gprmask; /* General registers used */ + Elf32_Word ri_cprmask[4]; /* Coprocessor registers used */ + Elf32_Sword ri_gp_value; /* $gp register value */ +} Elf32_RegInfo; +#endif + + +/* + * Mips relocations. + */ + +#define R_MIPS_NONE 0 /* No reloc */ +#define R_MIPS_16 1 /* Direct 16 bit */ +#define R_MIPS_32 2 /* Direct 32 bit */ +#define R_MIPS_REL32 3 /* PC relative 32 bit */ +#define R_MIPS_26 4 /* Direct 26 bit shifted */ +#define R_MIPS_HI16 5 /* High 16 bit */ +#define R_MIPS_LO16 6 /* Low 16 bit */ +#define R_MIPS_GPREL16 7 /* GP relative 16 bit */ +#define R_MIPS_LITERAL 8 /* 16 bit literal entry */ +#define R_MIPS_GOT16 9 /* 16 bit GOT entry */ +#define R_MIPS_PC16 10 /* PC relative 16 bit */ +#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */ +#define R_MIPS_GPREL32 12 /* GP relative 32 bit */ + +#define R_MIPS_64 18 + +#define R_MIPS_REL32_64 ((R_MIPS_64 << 8) | R_MIPS_REL32) + + +#endif /* !_MIPS64_EXEC_H_ */ diff --git a/libc/arch-mips/include/machine/ieee.h b/libc/arch-mips/include/machine/ieee.h new file mode 100644 index 0000000..520a77b --- /dev/null +++ b/libc/arch-mips/include/machine/ieee.h @@ -0,0 +1,169 @@ +/* $OpenBSD: ieee.h,v 1.4 2010/01/23 19:11:21 miod Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Lawrence Berkeley Laboratory. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ieee.h 8.1 (Berkeley) 6/11/93 + */ + +/* + * ieee.h defines the machine-dependent layout of the machine's IEEE + * floating point. It does *not* define (yet?) any of the rounding + * mode bits, exceptions, and so forth. + */ + +/* + * Define the number of bits in each fraction and exponent. + * + * k k+1 + * Note that 1.0 x 2 == 0.1 x 2 and that denorms are represented + * + * (-exp_bias+1) + * as fractions that look like 0.fffff x 2 . This means that + * + * -126 + * the number 0.10000 x 2 , for instance, is the same as the normalized + * + * -127 -128 + * float 1.0 x 2 . Thus, to represent 2 , we need one leading zero + * + * -129 + * in the fraction; to represent 2 , we need two, and so on. This + * + * (-exp_bias-fracbits+1) + * implies that the smallest denormalized number is 2 + * + * for whichever format we are talking about: for single precision, for + * + * -126 -149 + * instance, we get .00000000000000000000001 x 2 , or 1.0 x 2 , and + * + * -149 == -127 - 23 + 1. + */ +#define SNG_EXPBITS 8 +#define SNG_FRACBITS 23 + +#define DBL_EXPBITS 11 +#define DBL_FRACHBITS 20 +#define DBL_FRACLBITS 32 +#define DBL_FRACBITS 52 + +#define EXT_EXPBITS 15 +#define EXT_FRACHBITS 16 +#define EXT_FRACHMBITS 32 +#define EXT_FRACLMBITS 32 +#define EXT_FRACLBITS 32 +#define EXT_FRACBITS 112 + +#define EXT_IMPLICIT_NBIT + +#define EXT_TO_ARRAY32(p, a) do { \ + (a)[0] = (uint32_t)(p)->ext_fracl; \ + (a)[1] = (uint32_t)(p)->ext_fraclm; \ + (a)[2] = (uint32_t)(p)->ext_frachm; \ + (a)[3] = (uint32_t)(p)->ext_frach; \ +} while(0) + +struct ieee_single { +#ifdef __MIPSEB__ + u_int sng_sign:1; + u_int sng_exp:8; + u_int sng_frac:23; +#else + u_int sng_frac:23; + u_int sng_exp:8; + u_int sng_sign:1; +#endif +}; + +struct ieee_double { +#ifdef __MIPSEB__ + u_int dbl_sign:1; + u_int dbl_exp:11; + u_int dbl_frach:20; + u_int dbl_fracl; +#else + u_int dbl_fracl; + u_int dbl_frach:20; + u_int dbl_exp:11; + u_int dbl_sign:1; +#endif +}; + +struct ieee_ext { +#ifdef __MIPSEB__ + u_int ext_sign:1; + u_int ext_exp:15; + u_int ext_frach:16; + u_int ext_frachm; + u_int ext_fraclm; + u_int ext_fracl; +#else + u_int ext_fracl; + u_int ext_fraclm; + u_int ext_frachm; + u_int ext_frach:16; + u_int ext_exp:15; + u_int ext_sign:1; +#endif +}; + +/* + * Floats whose exponent is in [1..INFNAN) (of whatever type) are + * `normal'. Floats whose exponent is INFNAN are either Inf or NaN. + * Floats whose exponent is zero are either zero (iff all fraction + * bits are zero) or subnormal values. + * + * A NaN is a `signalling NaN' if its QUIETNAN bit is clear in its + * high fraction; if the bit is set, it is a `quiet NaN'. + */ +#define SNG_EXP_INFNAN 255 +#define DBL_EXP_INFNAN 2047 +#define EXT_EXP_INFNAN 32767 + +#if 0 +#define SNG_QUIETNAN (1 << 22) +#define DBL_QUIETNAN (1 << 19) +#define EXT_QUIETNAN (1 << 15) +#endif + +/* + * Exponent biases. + */ +#define SNG_EXP_BIAS 127 +#define DBL_EXP_BIAS 1023 +#define EXT_EXP_BIAS 16383 diff --git a/libc/arch-mips/include/machine/internal_types.h b/libc/arch-mips/include/machine/internal_types.h new file mode 100644 index 0000000..529079f --- /dev/null +++ b/libc/arch-mips/include/machine/internal_types.h @@ -0,0 +1,8 @@ +/* $OpenBSD: internal_types.h,v 1.1 2004/08/06 20:56:02 pefo Exp $ */ +/* Public domain */ +#ifndef _MIPS64_INTERNAL_TYPES_H_ +#define _MIPS64_INTERNAL_TYPES_H_ + +/* Machine special type definitions */ + +#endif diff --git a/libc/arch-mips/include/machine/kernel.h b/libc/arch-mips/include/machine/kernel.h new file mode 100644 index 0000000..69ad40c --- /dev/null +++ b/libc/arch-mips/include/machine/kernel.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _ARCH_MIPS_KERNEL_H +#define _ARCH_MIPS_KERNEL_H + +/* this file contains kernel-specific definitions that were optimized out of + our processed kernel headers, but still useful nonetheless... */ + +typedef unsigned long __kernel_blkcnt_t; +typedef unsigned long __kernel_blksize_t; + +/* these aren't really defined by the kernel headers though... */ +typedef unsigned long __kernel_fsblkcnt_t; +typedef unsigned long __kernel_fsfilcnt_t; +typedef unsigned int __kernel_id_t; + +#endif /* _ARCH_MIPS_KERNEL_H */ diff --git a/libc/arch-mips/include/machine/limits.h b/libc/arch-mips/include/machine/limits.h new file mode 100644 index 0000000..339444d --- /dev/null +++ b/libc/arch-mips/include/machine/limits.h @@ -0,0 +1,62 @@ +/* $OpenBSD: limits.h,v 1.5 2007/05/07 20:51:07 kettenis Exp $ */ + +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)limits.h 8.3 (Berkeley) 1/4/94 + */ + +#ifndef _MIPS_LIMITS_H_ +#define _MIPS_LIMITS_H_ + +#include <sys/cdefs.h> + +#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */ + +#ifndef SIZE_MAX +#define SIZE_MAX ULONG_MAX /* max value for a size_t */ +#endif +#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ + +#if __BSD_VISIBLE +#define SIZE_T_MAX ULONG_MAX /* max value for a size_t (historic) */ + +/* Quads and longs are the same on mips64 */ +#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */ +#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */ +#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */ + +#endif /* __BSD_VISIBLE */ + + +#define LONGLONG_BIT 64 +#define LONGLONG_MIN (-9223372036854775807LL-1) +#define LONGLONG_MAX 9223372036854775807LL +#define ULONGLONG_MAX 18446744073709551615ULL + +#endif /* !_MIPS_LIMITS_H_ */ diff --git a/libc/arch-mips/include/machine/regdef.h b/libc/arch-mips/include/machine/regdef.h new file mode 100644 index 0000000..ae18392 --- /dev/null +++ b/libc/arch-mips/include/machine/regdef.h @@ -0,0 +1,92 @@ +/* $OpenBSD: regdef.h,v 1.3 2005/08/07 07:29:44 miod Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Ralph Campbell. This file is derived from the MIPS RISC + * Architecture book by Gerry Kane. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)regdef.h 8.1 (Berkeley) 6/10/93 + */ +#ifndef _MIPS_REGDEF_H_ +#define _MIPS_REGDEF_H_ + +#define zero $0 /* always zero */ +#define AT $at /* assembler temp */ +#define v0 $2 /* return value */ +#define v1 $3 +#define a0 $4 /* argument registers */ +#define a1 $5 +#define a2 $6 +#define a3 $7 +#if defined(__mips_n32) || defined(__mips_n64) +#define a4 $8 /* expanded register arguments */ +#define a5 $9 +#define a6 $10 +#define a7 $11 +#define ta0 $8 /* alias */ +#define ta1 $9 +#define ta2 $10 +#define ta3 $11 +#define t0 $12 /* temp registers (not saved across subroutine calls) */ +#define t1 $13 +#define t2 $14 +#define t3 $15 +#else +#define t0 $8 /* temp registers (not saved across subroutine calls) */ +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#define ta0 $12 /* alias */ +#define ta1 $13 +#define ta2 $14 +#define ta3 $15 +#endif +#define s0 $16 /* saved across subroutine calls (callee saved) */ +#define s1 $17 +#define s2 $18 +#define s3 $19 +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +#define t8 $24 /* two more temp registers */ +#define t9 $25 +#define k0 $26 /* kernel temporary */ +#define k1 $27 +#define gp $28 /* global pointer */ +#define sp $29 /* stack pointer */ +#define s8 $30 /* one more callee saved */ +#define ra $31 /* return address */ + +#endif /* !_MIPS_REGDEF_H_ */ diff --git a/libc/arch-mips/include/machine/regnum.h b/libc/arch-mips/include/machine/regnum.h new file mode 100644 index 0000000..bfe1280 --- /dev/null +++ b/libc/arch-mips/include/machine/regnum.h @@ -0,0 +1,119 @@ +/* $OpenBSD: regnum.h,v 1.3 2004/08/10 20:28:13 deraadt Exp $ */ + +/* + * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#ifndef _MIPS64_REGNUM_H_ +#define _MIPS64_REGNUM_H_ + +/* + * Location of the saved registers relative to ZERO. + * Usage is p->p_regs[XX]. + */ +#define ZERO 0 +#define AST 1 +#define V0 2 +#define V1 3 +#define A0 4 +#define A1 5 +#define A2 6 +#define A3 7 +#define T0 8 +#define T1 9 +#define T2 10 +#define T3 11 +#define T4 12 +#define T5 13 +#define T6 14 +#define T7 15 +#define S0 16 +#define S1 17 +#define S2 18 +#define S3 19 +#define S4 20 +#define S5 21 +#define S6 22 +#define S7 23 +#define T8 24 +#define T9 25 +#define K0 26 +#define K1 27 +#define GP 28 +#define SP 29 +#define S8 30 +#define RA 31 +#define SR 32 +#define PS SR /* alias for SR */ +#define MULLO 33 +#define MULHI 34 +#define BADVADDR 35 +#define CAUSE 36 +#define PC 37 +#define IC 38 +#define CPL 39 + +#define NUMSAVEREGS 40 /* Number of registers saved in trap */ + +#define FPBASE NUMSAVEREGS +#define F0 (FPBASE+0) +#define F1 (FPBASE+1) +#define F2 (FPBASE+2) +#define F3 (FPBASE+3) +#define F4 (FPBASE+4) +#define F5 (FPBASE+5) +#define F6 (FPBASE+6) +#define F7 (FPBASE+7) +#define F8 (FPBASE+8) +#define F9 (FPBASE+9) +#define F10 (FPBASE+10) +#define F11 (FPBASE+11) +#define F12 (FPBASE+12) +#define F13 (FPBASE+13) +#define F14 (FPBASE+14) +#define F15 (FPBASE+15) +#define F16 (FPBASE+16) +#define F17 (FPBASE+17) +#define F18 (FPBASE+18) +#define F19 (FPBASE+19) +#define F20 (FPBASE+20) +#define F21 (FPBASE+21) +#define F22 (FPBASE+22) +#define F23 (FPBASE+23) +#define F24 (FPBASE+24) +#define F25 (FPBASE+25) +#define F26 (FPBASE+26) +#define F27 (FPBASE+27) +#define F28 (FPBASE+28) +#define F29 (FPBASE+29) +#define F30 (FPBASE+30) +#define F31 (FPBASE+31) +#define FSR (FPBASE+32) + +#define NUMFPREGS 33 + +#define NREGS (NUMSAVEREGS + NUMFPREGS) + +#endif /* !_MIPS64_REGNUM_H_ */ diff --git a/libc/arch-mips/include/machine/setjmp.h b/libc/arch-mips/include/machine/setjmp.h new file mode 100644 index 0000000..55ba7be --- /dev/null +++ b/libc/arch-mips/include/machine/setjmp.h @@ -0,0 +1,10 @@ +/* $OpenBSD: setjmp.h,v 1.2 2004/08/10 21:10:56 pefo Exp $ */ + +/* Public domain */ + +#ifndef _MIPS_SETJMP_H_ +#define _MIPS_SETJMP_H_ + +#define _JBLEN 157 /* size, in longs, of a jmp_buf */ + +#endif /* !_MIPS_SETJMP_H_ */ diff --git a/libc/arch-mips/include/machine/signal.h b/libc/arch-mips/include/machine/signal.h new file mode 100644 index 0000000..4efb856 --- /dev/null +++ b/libc/arch-mips/include/machine/signal.h @@ -0,0 +1,147 @@ +/* $OpenBSD: signal.h,v 1.8 2006/01/09 18:18:37 millert Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Ralph Campbell. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)signal.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _MIPS_SIGNAL_H_ +#define _MIPS_SIGNAL_H_ + +#include <sys/cdefs.h> + +#if !defined(__LANGUAGE_ASSEMBLY) +#include <sys/types.h> + +/* + * Machine-dependent signal definitions + */ +typedef int sig_atomic_t; + +#if __BSD_VISIBLE || __XPG_VISIBLE >= 420 + +/* + * Information pushed on stack when a signal is delivered. + * This is used by the kernel to restore state following + * execution of the signal handler. It is also made available + * to the handler to allow it to restore state properly if + * a non-standard exit is performed. + */ + +#if defined(__ANDROID__) + +/* + * The Linux and OpenBSD sigcontext structures are slightly different + * This is the Linux O32 ABI compatible sigcontext + */ + +struct sigcontext { + unsigned int sc_regmask; + unsigned int sc_status; + unsigned long long sc_pc; + unsigned long long sc_regs[32]; + unsigned long long sc_fpregs[32]; + unsigned int sc_acx; + unsigned int sc_fpc_csr; + unsigned int sc_fpc_eir; + unsigned int sc_used_math; + unsigned int sc_dsp; + unsigned long long sc_mdhi; + unsigned long long sc_mdlo; + unsigned long sc_hi1; + unsigned long sc_lo1; + unsigned long sc_hi2; + unsigned long sc_lo2; + unsigned long sc_hi3; + unsigned long sc_lo3; +}; + +#else + +struct sigcontext { + long sc_onstack; /* sigstack state to restore */ + long sc_mask; /* signal mask to restore */ + __register_t sc_pc; /* pc at time of signal */ + __register_t sc_regs[32]; /* processor regs 0 to 31 */ + __register_t mullo; /* mullo and mulhi registers... */ + __register_t mulhi; /* mullo and mulhi registers... */ + f_register_t sc_fpregs[33]; /* fp regs 0 to 31 and csr */ + long sc_fpused; /* fp has been used */ + long sc_fpc_eir; /* floating point exception instruction reg */ + long xxx[8]; /* XXX reserved */ +}; +#endif +#endif /* __BSD_VISIBLE || __XPG_VISIBLE >= 420 */ + +#else /* __LANGUAGE_ASSEMBLY */ + +#ifdef __ANDROID__ + +#define SC_REGMASK (0*REGSZ) +#define SC_STATUS (1*REGSZ) +#define SC_PC (2*REGSZ) +#define SC_REGS (SC_PC+8) +#define SC_FPREGS (SC_REGS+32*8) +#define SC_ACX (SC_FPREGS+32*REGSZ_FP) +#define SC_FPC_CSR (SC_ACX+1*REGSZ) +#define SC_FPC_EIR (SC_ACX+2*REGSZ) +#define SC_USED_MATH (SC_ACX+3*REGSZ) +#define SC_DSP (SC_ACX+4*REGSZ) +#define SC_MDHI (SC_ACX+5*REGSZ) +#define SC_MDLO (SC_MDHI+8) +#define SC_HI1 (SC_MDLO+8) +#define SC_LO1 (SC_HI1+1*REGSZ) +#define SC_HI2 (SC_HI1+2*REGSZ) +#define SC_LO2 (SC_HI1+3*REGSZ) +#define SC_HI3 (SC_HI1+4*REGSZ) +#define SC_LO3 (SC_HI1+5*REGSZ) +/* OpenBSD compatibility */ +#define SC_MASK SC_REGMASK +#define SC_FPUSED SC_USED_MATH + +#else + +#define SC_ONSTACK (0 * REGSZ) +#define SC_MASK (1 * REGSZ) +#define SC_PC (2 * REGSZ) +#define SC_REGS (3 * REGSZ) +#define SC_MULLO (35 * REGSZ) +#define SC_MULHI (36 * REGSZ) +#define SC_FPREGS (37 * REGSZ) +#define SC_FPUSED (70 * REGSZ) +#define SC_FPC_EIR (71 * REGSZ) + +#endif /* __ANDROID__ */ + +#endif /* __LANGUAGE_ASSEMBLY */ + +#endif /* !_MIPS_SIGNAL_H_ */ diff --git a/libc/arch-mips/string/memcpy.S b/libc/arch-mips/string/memcpy.S new file mode 100644 index 0000000..aabdfcf --- /dev/null +++ b/libc/arch-mips/string/memcpy.S @@ -0,0 +1,423 @@ +/* + * Copyright (c) 2009 + * MIPS Technologies, Inc., California. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/************************************************************************ + * + * memcpy.S + * Version: "043009" + * + ************************************************************************/ + + +/************************************************************************ + * Include files + ************************************************************************/ + +#include "machine/asm.h" + + +/* + * This routine could be optimized for MIPS64. The current code only + * uses MIPS32 instructions. + */ +#if defined(__MIPSEB__) +# define LWHI lwl /* high part is left in big-endian */ +# define SWHI swl /* high part is left in big-endian */ +# define LWLO lwr /* low part is right in big-endian */ +# define SWLO swr /* low part is right in big-endian */ +#endif + +#if defined(__MIPSEL__) +# define LWHI lwr /* high part is right in little-endian */ +# define SWHI swr /* high part is right in little-endian */ +# define LWLO lwl /* low part is left in big-endian */ +# define SWLO swl /* low part is left in big-endian */ +#endif + +LEAF(memcpy,0) + + .set noreorder + .set noat +/* + * Below we handle the case where memcpy is called with overlapping src and dst. + * Although memcpy is not required to handle this case, some parts of Android like Skia + * rely on such usage. We call memmove to handle such cases. + */ + subu t0,a0,a1 + sra AT,t0,31 + xor t1,t0,AT + subu t0,t1,AT + sltu AT,t0,a2 + beq AT,zero,.Lmemcpy + la t9,memmove + jr t9 + nop +.Lmemcpy: + slti AT,a2,8 + bne AT,zero,.Llast8 + move v0,a0 # memcpy returns the dst pointer + +# Test if the src and dst are word-aligned, or can be made word-aligned + xor t8,a1,a0 + andi t8,t8,0x3 # t8 is a0/a1 word-displacement + + bne t8,zero,.Lunaligned + negu a3,a0 + + andi a3,a3,0x3 # we need to copy a3 bytes to make a0/a1 aligned + beq a3,zero,.Lchk16w # when a3=0 then the dst (a0) is word-aligned + subu a2,a2,a3 # now a2 is the remining bytes count + + LWHI t8,0(a1) + addu a1,a1,a3 + SWHI t8,0(a0) + addu a0,a0,a3 + +# Now the dst/src are mutually word-aligned with word-aligned addresses +.Lchk16w: + andi t8,a2,0x3f # any whole 64-byte chunks? + # t8 is the byte count after 64-byte chunks + + beq a2,t8,.Lchk8w # if a2==t8, no 64-byte chunks + # There will be at most 1 32-byte chunk after it + subu a3,a2,t8 # subtract from a2 the reminder + # Here a3 counts bytes in 16w chunks + addu a3,a0,a3 # Now a3 is the final dst after 64-byte chunks + + addu t0,a0,a2 # t0 is the "past the end" address + +# When in the loop we exercise "pref 30,x(a0)", the a0+x should not be past +# the "t0-32" address +# This means: for x=128 the last "safe" a0 address is "t0-160" +# Alternatively, for x=64 the last "safe" a0 address is "t0-96" +# In the current version we will use "pref 30,128(a0)", so "t0-160" is the limit + subu t9,t0,160 # t9 is the "last safe pref 30,128(a0)" address + + pref 0,0(a1) # bring the first line of src, addr 0 + pref 0,32(a1) # bring the second line of src, addr 32 + pref 0,64(a1) # bring the third line of src, addr 64 + pref 30,32(a0) # safe, as we have at least 64 bytes ahead +# In case the a0 > t9 don't use "pref 30" at all + sgtu v1,a0,t9 + bgtz v1,.Lloop16w # skip "pref 30,64(a0)" for too short arrays + nop +# otherwise, start with using pref30 + pref 30,64(a0) +.Lloop16w: + pref 0,96(a1) + lw t0,0(a1) + bgtz v1,.Lskip_pref30_96 # skip "pref 30,96(a0)" + lw t1,4(a1) + pref 30,96(a0) # continue setting up the dest, addr 96 +.Lskip_pref30_96: + lw t2,8(a1) + lw t3,12(a1) + lw t4,16(a1) + lw t5,20(a1) + lw t6,24(a1) + lw t7,28(a1) + pref 0,128(a1) # bring the next lines of src, addr 128 + + sw t0,0(a0) + sw t1,4(a0) + sw t2,8(a0) + sw t3,12(a0) + sw t4,16(a0) + sw t5,20(a0) + sw t6,24(a0) + sw t7,28(a0) + + lw t0,32(a1) + bgtz v1,.Lskip_pref30_128 # skip "pref 30,128(a0)" + lw t1,36(a1) + pref 30,128(a0) # continue setting up the dest, addr 128 +.Lskip_pref30_128: + lw t2,40(a1) + lw t3,44(a1) + lw t4,48(a1) + lw t5,52(a1) + lw t6,56(a1) + lw t7,60(a1) + pref 0, 160(a1) # bring the next lines of src, addr 160 + + sw t0,32(a0) + sw t1,36(a0) + sw t2,40(a0) + sw t3,44(a0) + sw t4,48(a0) + sw t5,52(a0) + sw t6,56(a0) + sw t7,60(a0) + + addiu a0,a0,64 # adding 64 to dest + sgtu v1,a0,t9 + bne a0,a3,.Lloop16w + addiu a1,a1,64 # adding 64 to src + move a2,t8 + +# Here we have src and dest word-aligned but less than 64-bytes to go + +.Lchk8w: + pref 0, 0x0(a1) + andi t8,a2,0x1f # is there a 32-byte chunk? + # the t8 is the reminder count past 32-bytes + beq a2,t8,.Lchk1w # when a2=t8, no 32-byte chunk + nop + + lw t0,0(a1) + lw t1,4(a1) + lw t2,8(a1) + lw t3,12(a1) + lw t4,16(a1) + lw t5,20(a1) + lw t6,24(a1) + lw t7,28(a1) + addiu a1,a1,32 + + sw t0,0(a0) + sw t1,4(a0) + sw t2,8(a0) + sw t3,12(a0) + sw t4,16(a0) + sw t5,20(a0) + sw t6,24(a0) + sw t7,28(a0) + addiu a0,a0,32 + +.Lchk1w: + andi a2,t8,0x3 # now a2 is the reminder past 1w chunks + beq a2,t8,.Llast8 + subu a3,t8,a2 # a3 is count of bytes in 1w chunks + addu a3,a0,a3 # now a3 is the dst address past the 1w chunks + +# copying in words (4-byte chunks) +.LwordCopy_loop: + lw t3,0(a1) # the first t3 may be equal t0 ... optimize? + addiu a1,a1,4 + addiu a0,a0,4 + bne a0,a3,.LwordCopy_loop + sw t3,-4(a0) + +# For the last (<8) bytes +.Llast8: + blez a2,.Lleave + addu a3,a0,a2 # a3 is the last dst address +.Llast8loop: + lb v1,0(a1) + addiu a1,a1,1 + addiu a0,a0,1 + bne a0,a3,.Llast8loop + sb v1,-1(a0) + +.Lleave: + j ra + nop + +# +# UNALIGNED case +# + +.Lunaligned: + # got here with a3="negu a0" + andi a3,a3,0x3 # test if the a0 is word aligned + beqz a3,.Lua_chk16w + subu a2,a2,a3 # bytes left after initial a3 bytes + + LWHI v1,0(a1) + LWLO v1,3(a1) + addu a1,a1,a3 # a3 may be here 1, 2 or 3 + SWHI v1,0(a0) + addu a0,a0,a3 # below the dst will be word aligned (NOTE1) + +.Lua_chk16w: + andi t8,a2,0x3f # any whole 64-byte chunks? + # t8 is the byte count after 64-byte chunks + beq a2,t8,.Lua_chk8w # if a2==t8, no 64-byte chunks + # There will be at most 1 32-byte chunk after it + subu a3,a2,t8 # subtract from a2 the reminder + # Here a3 counts bytes in 16w chunks + addu a3,a0,a3 # Now a3 is the final dst after 64-byte chunks + + addu t0,a0,a2 # t0 is the "past the end" address + + subu t9,t0,160 # t9 is the "last safe pref 30,128(a0)" address + + pref 0,0(a1) # bring the first line of src, addr 0 + pref 0,32(a1) # bring the second line of src, addr 32 + pref 0,64(a1) # bring the third line of src, addr 64 + pref 30,32(a0) # safe, as we have at least 64 bytes ahead +# In case the a0 > t9 don't use "pref 30" at all + sgtu v1,a0,t9 + bgtz v1,.Lua_loop16w # skip "pref 30,64(a0)" for too short arrays + nop +# otherwise, start with using pref30 + pref 30,64(a0) +.Lua_loop16w: + pref 0,96(a1) + LWHI t0,0(a1) + LWLO t0,3(a1) + LWHI t1,4(a1) + bgtz v1,.Lua_skip_pref30_96 + LWLO t1,7(a1) + pref 30,96(a0) # continue setting up the dest, addr 96 +.Lua_skip_pref30_96: + LWHI t2,8(a1) + LWLO t2,11(a1) + LWHI t3,12(a1) + LWLO t3,15(a1) + LWHI t4,16(a1) + LWLO t4,19(a1) + LWHI t5,20(a1) + LWLO t5,23(a1) + LWHI t6,24(a1) + LWLO t6,27(a1) + LWHI t7,28(a1) + LWLO t7,31(a1) + pref 0,128(a1) # bring the next lines of src, addr 128 + + sw t0,0(a0) + sw t1,4(a0) + sw t2,8(a0) + sw t3,12(a0) + sw t4,16(a0) + sw t5,20(a0) + sw t6,24(a0) + sw t7,28(a0) + + LWHI t0,32(a1) + LWLO t0,35(a1) + LWHI t1,36(a1) + bgtz v1,.Lua_skip_pref30_128 + LWLO t1,39(a1) + pref 30,128(a0) # continue setting up the dest, addr 128 +.Lua_skip_pref30_128: + LWHI t2,40(a1) + LWLO t2,43(a1) + LWHI t3,44(a1) + LWLO t3,47(a1) + LWHI t4,48(a1) + LWLO t4,51(a1) + LWHI t5,52(a1) + LWLO t5,55(a1) + LWHI t6,56(a1) + LWLO t6,59(a1) + LWHI t7,60(a1) + LWLO t7,63(a1) + pref 0, 160(a1) # bring the next lines of src, addr 160 + + sw t0,32(a0) + sw t1,36(a0) + sw t2,40(a0) + sw t3,44(a0) + sw t4,48(a0) + sw t5,52(a0) + sw t6,56(a0) + sw t7,60(a0) + + addiu a0,a0,64 # adding 64 to dest + sgtu v1,a0,t9 + bne a0,a3,.Lua_loop16w + addiu a1,a1,64 # adding 64 to src + move a2,t8 + +# Here we have src and dest word-aligned but less than 64-bytes to go + +.Lua_chk8w: + pref 0, 0x0(a1) + andi t8,a2,0x1f # is there a 32-byte chunk? + # the t8 is the reminder count + beq a2,t8,.Lua_chk1w # when a2=t8, no 32-byte chunk + nop + + LWHI t0,0(a1) + LWLO t0,3(a1) + LWHI t1,4(a1) + LWLO t1,7(a1) + LWHI t2,8(a1) + LWLO t2,11(a1) + LWHI t3,12(a1) + LWLO t3,15(a1) + LWHI t4,16(a1) + LWLO t4,19(a1) + LWHI t5,20(a1) + LWLO t5,23(a1) + LWHI t6,24(a1) + LWLO t6,27(a1) + LWHI t7,28(a1) + LWLO t7,31(a1) + addiu a1,a1,32 + + sw t0,0(a0) + sw t1,4(a0) + sw t2,8(a0) + sw t3,12(a0) + sw t4,16(a0) + sw t5,20(a0) + sw t6,24(a0) + sw t7,28(a0) + addiu a0,a0,32 + +.Lua_chk1w: + andi a2,t8,0x3 # now a2 is the reminder past 1w chunks + beq a2,t8,.Lua_smallCopy + subu a3,t8,a2 # a3 is count of bytes in 1w chunks + addu a3,a0,a3 # now a3 is the dst address past the 1w chunks + +# copying in words (4-byte chunks) +.Lua_wordCopy_loop: + LWHI v1,0(a1) + LWLO v1,3(a1) + addiu a1,a1,4 + addiu a0,a0,4 # note: dst=a0 is word aligned here, see NOTE1 + bne a0,a3,.Lua_wordCopy_loop + sw v1,-4(a0) + +# Now less than 4 bytes (value in a2) left to copy +.Lua_smallCopy: + beqz a2,.Lleave + addu a3,a0,a2 # a3 is the last dst address +.Lua_smallCopy_loop: + lb v1,0(a1) + addiu a1,a1,1 + addiu a0,a0,1 + bne a0,a3,.Lua_smallCopy_loop + sb v1,-1(a0) + + j ra + nop + + .set at + .set reorder + +END(memcpy) + + +/************************************************************************ + * Implementation : Static functions + ************************************************************************/ diff --git a/libc/arch-mips/string/memset.S b/libc/arch-mips/string/memset.S new file mode 100644 index 0000000..a1c5055 --- /dev/null +++ b/libc/arch-mips/string/memset.S @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2009 + * MIPS Technologies, Inc., California. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/************************************************************************ + * + * memset.S, version "64h" with 1 cache line horizon for "pref 30" and 14 nops + * Version: "043009" + * + ************************************************************************/ + + +/************************************************************************ + * Include files + ************************************************************************/ + +#include "machine/asm.h" + +/* + * This routine could be optimized for MIPS64. The current code only + * uses MIPS32 instructions. + */ + +#if defined(__MIPSEB__) +# define SWHI swl /* high part is left in big-endian */ +# define SWLO swr /* low part is right in big-endian */ +#endif + +#if defined(__MIPSEL__) +# define SWHI swr /* high part is right in little-endian */ +# define SWLO swl /* low part is left in little-endian */ +#endif + +#if !(defined(XGPROF) || defined(XPROF)) +#undef SETUP_GP +#define SETUP_GP +#endif + +#ifdef NDEBUG +#define DBG # +#else +#define DBG +#endif + +/* + * void _memset16(uint16_t* dst, uint16_t value, size_t size); + */ + +LEAF(_memset16,0) + .set noreorder +DBG /* Check parameters */ +DBG andi t0,a0,1 # a0 must be halfword aligned +DBG tne t0,zero +DBG andi t2,a2,1 # a2 must be even +DBG tne t2,zero + +#ifdef FIXARGS + # ensure count is even +#if (__mips==32) && (__mips_isa_rev>=2) + ins a2,zero,0,1 +#else + ori a2,1 + xori a2,1 +#endif +#endif + +#if (__mips==32) && (__mips_isa_rev>=2) + ins a1,a1,16,16 +#else + andi a1,0xffff + sll t3,a1,16 + or a1,t3 +#endif + + beqz a2,.Ldone + andi t1,a0,2 + beqz t1,.Lalignok + addu t0,a0,a2 # t0 is the "past the end" address + sh a1,0(a0) # store one halfword to get aligned + addu a0,2 + subu a2,2 +.Lalignok: + slti t1,a2,4 # .Laligned for 4 or more bytes + beqz t1,.Laligned + sne t1,a2,2 # one more halfword? + bnez t1,.Ldone + nop + sh a1,0(a0) +.Ldone: + j ra + nop + .set reorder +END(_memset16) + +/* + * void _memset32(uint32_t* dst, uint32_t value, size_t size); + */ + +LEAF(_memset32,0) + .set noreorder +DBG /* Check parameters */ +DBG andi t0,a0,3 # a0 must be word aligned +DBG tne t0,zero +DBG andi t2,a2,3 # a2 must be a multiple of 4 bytes +DBG tne t2,zero + +#ifdef FIXARGS + # ensure count is a multiple of 4 +#if (__mips==32) && (__mips_isa_rev>=2) + ins $a2,$0,0,2 +#else + ori a2,3 + xori a2,3 +#endif +#endif + + bnez a2,.Laligned # any work to do? + addu t0,a0,a2 # t0 is the "past the end" address + + j ra + nop + .set reorder +END(_memset32) + +LEAF(memset,0) + + .set noreorder + .set noat + + addu t0,a0,a2 # t0 is the "past the end" address + slti AT,a2,4 # is a2 less than 4? + bne AT,zero,.Llast4 # if yes, go to last4 + move v0,a0 # memset returns the dst pointer + + beq a1,zero,.Lset0 + subu v1,zero,a0 + + # smear byte into 32 bit word +#if (__mips==32) && (__mips_isa_rev>=2) + ins a1, a1, 8, 8 # Replicate fill byte into half-word. + ins a1, a1, 16, 16 # Replicate fill byte into word. +#else + and a1,0xff + sll AT,a1,8 + or a1,AT + sll AT,a1,16 + or a1,AT +#endif + +.Lset0: + andi v1,v1,0x3 # word-unaligned address? + beq v1,zero,.Laligned # v1 is the unalignment count + subu a2,a2,v1 + SWHI a1,0(a0) + addu a0,a0,v1 + +# Here we have the "word-aligned" a0 (until the "last4") +.Laligned: + andi t8,a2,0x3f # any 64-byte chunks? + # t8 is the byte count past 64-byte chunks + beq a2,t8,.Lchk8w # when a2==t8, no 64-byte chunks + # There will be at most 1 32-byte chunk then + subu a3,a2,t8 # subtract from a2 the reminder + # Here a3 counts bytes in 16w chunks + addu a3,a0,a3 # Now a3 is the final dst after 64-byte chunks + +# Find out, if there are any 64-byte chunks after which will be still at least +# 96 bytes left. The value "96" is calculated as needed buffer for +# "pref 30,64(a0)" prefetch, which can be used as "pref 30,0(a0)" after +# incrementing "a0" by 64. +# For "a2" below 160 there will be no such "pref 30 safe" 64-byte chunk. +# + sltiu v1,a2,160 + bgtz v1,.Lloop16w_nopref30 # skip "pref 30,0(a0)" + subu t7,a2,96 # subtract "pref 30 unsafe" region + # below we have at least 1 64-byte chunk which is "pref 30 safe" + andi t6,t7,0x3f # t6 is past "64-byte safe chunks" reminder + subu t5,t7,t6 # subtract from t7 the reminder + # Here t5 counts bytes in 16w "safe" chunks + addu t4,a0,t5 # Now t4 is the dst after 64-byte "safe" chunks + +# Don't use "pref 30,0(a0)" for a0 in a "middle" of a cache line +# pref 30,0(a0) +# Here we are in the region, where it is safe to use "pref 30,64(a0)" +.Lloop16w: + addiu a0,a0,64 + pref 30,-32(a0) # continue setting up the dest, addr 64-32 + sw a1,-64(a0) + sw a1,-60(a0) + sw a1,-56(a0) + sw a1,-52(a0) + sw a1,-48(a0) + sw a1,-44(a0) + sw a1,-40(a0) + sw a1,-36(a0) + nop + nop # the extra nop instructions help to balance + nop # cycles needed for "store" + "fill" + "evict" + nop # For 64byte store there are needed 8 fill + nop # and 8 evict cycles, i.e. at least 32 instr. + nop + nop + pref 30,0(a0) # continue setting up the dest, addr 64-0 + sw a1,-32(a0) + sw a1,-28(a0) + sw a1,-24(a0) + sw a1,-20(a0) + sw a1,-16(a0) + sw a1,-12(a0) + sw a1,-8(a0) + sw a1,-4(a0) + nop + nop + nop + nop # NOTE: adding 14 nop-s instead of 12 nop-s + nop # gives better results for "fast" memory + nop + bne a0,t4,.Lloop16w + nop + + beq a0,a3,.Lchk8w # maybe no more 64-byte chunks? + nop # this "delayed slot" is useless ... + +.Lloop16w_nopref30: # there could be up to 3 "64-byte nopref30" chunks + addiu a0,a0,64 + sw a1,-64(a0) + sw a1,-60(a0) + sw a1,-56(a0) + sw a1,-52(a0) + sw a1,-48(a0) + sw a1,-44(a0) + sw a1,-40(a0) + sw a1,-36(a0) + sw a1,-32(a0) + sw a1,-28(a0) + sw a1,-24(a0) + sw a1,-20(a0) + sw a1,-16(a0) + sw a1,-12(a0) + sw a1,-8(a0) + bne a0,a3,.Lloop16w_nopref30 + sw a1,-4(a0) + +.Lchk8w: # t8 here is the byte count past 64-byte chunks + + andi t7,t8,0x1f # is there a 32-byte chunk? + # the t7 is the reminder count past 32-bytes + beq t8,t7,.Lchk1w # when t8==t7, no 32-byte chunk + move a2,t7 + + sw a1,0(a0) + sw a1,4(a0) + sw a1,8(a0) + sw a1,12(a0) + sw a1,16(a0) + sw a1,20(a0) + sw a1,24(a0) + sw a1,28(a0) + addiu a0,a0,32 + +.Lchk1w: + andi t8,a2,0x3 # now t8 is the reminder past 1w chunks + beq a2,t8,.Llast4aligned + subu a3,a2,t8 # a3 is the count of bytes in 1w chunks + addu a3,a0,a3 # now a3 is the dst address past the 1w chunks + +# copying in words (4-byte chunks) +.LwordCopy_loop: + addiu a0,a0,4 + bne a0,a3,.LwordCopy_loop + sw a1,-4(a0) + +# store last 0-3 bytes +# this will repeat the last store if the memset finishes on a word boundary +.Llast4aligned: + j ra + SWLO a1,-1(t0) + +.Llast4: + beq a0,t0,.Llast4e +.Llast4l: + addiu a0,a0,1 + bne a0,t0,.Llast4l + sb a1,-1(a0) +.Llast4e: + j ra + nop + + .set at + .set reorder + +END(memset) + + +/************************************************************************ + * Implementation : Static functions + ************************************************************************/ + diff --git a/libc/arch-mips/string/mips-string-ops.h b/libc/arch-mips/string/mips-string-ops.h new file mode 100644 index 0000000..50f7e3a --- /dev/null +++ b/libc/arch-mips/string/mips-string-ops.h @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2010 MIPS Technologies, Inc. + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with + * the distribution. + * * Neither the name of MIPS Technologies Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __MIPS_STRING_OPS_H +#define __MIPS_STRING_OPS_H + /* This definition of the byte bitfields uses the + assumption that the layout of the bitfields is + equivalent to the layout in memory. Generally, + for the MIPS ABIs, this is true. If you compile + the strcmp.c file with -DSMOKE_TEST_NEW_STRCMP, + this assumption will be tested. + + Also, regardless of char signedness, ANSI C dictates that + strcmp() treats each character as unsigned char. For + strlen and the like, signedness doesn't matter. + + Also, this code assumes that there are 8-bits per 'char'. */ + +#if __mips64 +typedef struct bits +{ + unsigned B0:8, B1:8, B2:8, B3:8, B4:8, B5:8, B6:8, B7:8; +} bits_t; +#else +typedef struct bits +{ + unsigned B0:8, B1:8, B2:8, B3:8; +} bits_t; +#endif + +#ifndef _ULW + /* for MIPS GCC, there is no unaligned builtins - so this code forces + the compiler to treat the pointer access as unaligned. */ +struct ulw +{ + unsigned b; +} __attribute__ ((packed)); + +#define _ULW(__x) ((struct ulw *) ((char *)(&__x)))->b; +#endif + +/* This union assumes that small structures can be in registers. If + not, then memory accesses will be done - not optimal, but ok. */ +typedef union +{ + unsigned v; + bits_t b; +} bitfields_t; + +#ifndef detect_zero +/* __mips_dsp, __mips_dspr2, and __mips64 are predefined by + the compiler, based on command line options. */ +#if (__mips_dsp || __mips_dspr2) && !__mips64 +#define __mips_using_dsp 1 + +/* DSP 4-lane (8 unsigned bits per line) subtract and saturate + * Intrinsic operation. How this works: + * Given a 4-byte string of "ABC\0", subtract this as + * an unsigned integer from 0x01010101: + * 0x01010101 + * - 0x41424300 + * ----------- + ( 0xbfbebe01 <-- answer without saturation + * 0x00000001 <-- answer with saturation + * When this 4-lane vector is treated as an unsigned int value, + * a non-zero answer indicates the presence of a zero in the + * original 4-byte argument. */ + +typedef signed char v4i8 __attribute__ ((vector_size (4))); + +#define detect_zero(__x,__y,__01s,__80s)\ + ((unsigned) __builtin_mips_subu_s_qb((v4i8) __01s,(v4i8) __x)) + + /* sets all 4 lanes to requested byte. */ +#define set_byte_lanes(__x) ((unsigned) __builtin_mips_repl_qb(__x)) + + /* sets all 4 lanes to 0x01. */ +#define def_and_set_01(__x) unsigned __x = (unsigned) __builtin_mips_repl_qb(0x01) + + /* sets all 4 lanes to 0x80. Not needed when subu_s.qb used. */ +#define def_and_set_80(__x) /* do nothing */ + +#else + /* this version, originally published in the 80's, uses + a reverse-carry-set like determination of the zero byte. + The steps are, for __x = 0x31ff0001: + __x - _01s = 0x30fdff00 + ~__x = 0xce00fffe + ((__x - _01s) & ~__x) = 0x0000ff00 + x & _80s = 0x00008000 <- byte 3 was zero + Some implementaions naively assume that characters are + always 7-bit unsigned ASCII. With that assumption, the + "& ~x" is usually discarded. Since character strings + are 8-bit, the and is needed to catch the case of + a false positive when the byte is 0x80. */ + +#define detect_zero(__x,__y,_01s,_80s)\ + ((unsigned) (((__x) - _01s) & ~(__x)) & _80s) + +#if __mips64 +#define def_and_set_80(__x) unsigned __x = 0x8080808080808080ul +#define def_and_set_01(__x) unsigned __x = 0x0101010101010101ul +#else +#define def_and_set_80(__x) unsigned __x = 0x80808080ul +#define def_and_set_01(__x) unsigned __x = 0x01010101ul +#endif + +#endif +#endif + +/* dealing with 'void *' conversions without using extra variables. */ +#define get_byte(__x,__idx) (((unsigned char *) (__x))[__idx]) +#define set_byte(__x,__idx,__fill) ((unsigned char *) (__x))[__idx] = (__fill) +#define get_word(__x,__idx) (((unsigned *) (__x))[__idx]) +#define set_word(__x,__idx,__fill) ((unsigned *) (__x))[__idx] = (__fill) +#define inc_ptr_as(__type,__x,__inc) __x = (void *) (((__type) __x) + (__inc)) +#define cvt_ptr_to(__type,__x) ((__type) (__x)) + +#endif diff --git a/libc/arch-mips/string/mips_strlen.c b/libc/arch-mips/string/mips_strlen.c new file mode 100644 index 0000000..9fb7e6a --- /dev/null +++ b/libc/arch-mips/string/mips_strlen.c @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2010 MIPS Technologies, Inc. + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with + * the distribution. + * * Neither the name of MIPS Technologies Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mips-string-ops.h" + +#define do_strlen_word(__av) {\ + if (detect_zero(x,x,_01s,_80s)) break;\ + x = __av;\ + cnt += sizeof (unsigned);\ + } + +#define do_strlen_byte(__x) {\ + if ((bx.b.B##__x) == 0) break;\ + ++cnt;\ + } + +#if SMOKE_TEST_MIPS_STRLEN +#define strlen my_strlen +#endif + +int +strlen (const void *_a) +{ + int cnt = 0; + unsigned x; + + /* align the string to word boundary so we can do word at a time. */ + if ((cvt_ptr_to (unsigned, _a) & (sizeof (unsigned) - 1)) != 0) + { + if ((cvt_ptr_to (unsigned, _a) & 1) != 0) + { + if (get_byte (_a, 0) == 0) + return cnt; + /* set bit 1 so 2-bytes are checked and incremented. */ + inc_ptr_as (char *, _a, 1); + ++cnt; + } + if ((cvt_ptr_to (unsigned, _a) & 2) != 0) + { + if (get_byte (_a, 0) == 0) + return cnt + 0; + if (get_byte (_a, 1) == 0) + return cnt + 1; + inc_ptr_as (char *, _a, 2); + cnt += 2; + } + } + +#if __mips64 +#error strlen: mips64 check for 4-byte alignment not implemented. +#endif + + if (1) + { + def_and_set_01 (_01s); + def_and_set_80 (_80s); + + /* as advantagous as it is to performance, this code cannot pre-load + the following word, nor can it prefetch the next line at the start + of the loop since the string can be at the end of a page with the + following page unmapped. There are tests in the suite to catch + any attempt to go beyond the current word. */ + x = get_word (_a, 0); + while (1) + { + /* doing 8 words should cover most strings. */ + do_strlen_word (get_word (_a, 1)); + do_strlen_word (get_word (_a, 2)); + do_strlen_word (get_word (_a, 3)); + do_strlen_word (get_word (_a, 4)); + do_strlen_word (get_word (_a, 5)); + do_strlen_word (get_word (_a, 6)); + do_strlen_word (get_word (_a, 7)); + do_strlen_word (get_word (_a, 8)); + inc_ptr_as (unsigned *, _a, 8); + } + } + while (1) + { + /* pull apart the last word processed and find the zero. */ + bitfields_t bx; + bx.v = x; +#if __mips64 + do_strlen_byte (0); + do_strlen_byte (1); + do_strlen_byte (2); + do_strlen_byte (3); + do_strlen_byte (4); + do_strlen_byte (5); + do_strlen_byte (6); +#else + do_strlen_byte (0); + do_strlen_byte (1); + do_strlen_byte (2); +#endif + /* last byte is zero */ + break; + } + return cnt; +} + +#undef do_strlen_byte +#undef do_strlen_word + +#if SMOKE_TEST_MIPS_STRLEN +#include <stdio.h> +char str1[] = "DHRYSTONE PROGRAM, 1'ST STRING"; +char str2[] = "DHRYSTONE PROGRAM, 2'ST STRING"; + +char str3[] = "another string"; +char str4[] = "another"; + +char str5[] = "somes tring"; +char str6[] = "somes_tring"; + +char str7[16], str8[16]; + +static char * +chk (unsigned mine, unsigned libs, int *errors) +{ + static char answer[1024]; + char *result = mine == libs ? "PASS" : "FAIL"; + sprintf (answer, "new_strlen=%d: lib_strlen=%d: %s!", mine, libs, result); + if (mine != libs) + (*errors)++; + return answer; +} + +int +main (int argc, char **argv) +{ + int errors = 0; + /* set -1 in one position */ + str6[5] = 0xff; + /* set zero in same position with junk in following 3 */ + str7[0] = str8[0] = 0; + str7[1] = 0xff; + str7[2] = 'a'; + str7[3] = 2; + str8[1] = 's'; + str8[2] = -2; + str8[3] = 0; + + fprintf (stderr, "========== mips_strlen%s test...\n", + argv[0] ? argv[0] : "unknown strlen"); +#define P(__x,__y) {\ + int a = my_strlen(__x + __y);\ + int b = (strlen)(__x + __y) /* library version */;\ + fprintf(stderr,"%s+%d: %s\n",#__x,__y,chk(a,b,&errors));\ + } + + P (str1, 0); + P (str1, 1); + P (str1, 2); + P (str1, 3); + + P (str2, 0); + P (str2, 1); + P (str2, 2); + P (str2, 3); + + P (str3, 0); + P (str3, 1); + P (str3, 2); + P (str3, 3); + + P (str4, 0); + P (str4, 1); + P (str4, 2); + P (str4, 3); + + P (str5, 0); + P (str5, 1); + P (str5, 2); + P (str5, 3); + + P (str6, 0); + P (str6, 1); + P (str6, 2); + P (str6, 3); + + P (str7, 0); + P (str7, 1); + P (str7, 2); + P (str7, 3); + + P (str8, 0); + P (str8, 1); + P (str8, 2); + P (str8, 3); + + return errors; +} +#endif diff --git a/libc/arch-mips/syscalls.mk b/libc/arch-mips/syscalls.mk new file mode 100644 index 0000000..263f307 --- /dev/null +++ b/libc/arch-mips/syscalls.mk @@ -0,0 +1,205 @@ +# auto-generated by gensyscalls.py, do not touch +syscall_src := +syscall_src += arch-mips/syscalls/_exit.S +syscall_src += arch-mips/syscalls/_exit_thread.S +syscall_src += arch-mips/syscalls/__fork.S +syscall_src += arch-mips/syscalls/_waitpid.S +syscall_src += arch-mips/syscalls/__waitid.S +syscall_src += arch-mips/syscalls/__sys_clone.S +syscall_src += arch-mips/syscalls/execve.S +syscall_src += arch-mips/syscalls/__setuid.S +syscall_src += arch-mips/syscalls/getuid.S +syscall_src += arch-mips/syscalls/getgid.S +syscall_src += arch-mips/syscalls/geteuid.S +syscall_src += arch-mips/syscalls/getegid.S +syscall_src += arch-mips/syscalls/getresuid.S +syscall_src += arch-mips/syscalls/getresgid.S +syscall_src += arch-mips/syscalls/gettid.S +syscall_src += arch-mips/syscalls/readahead.S +syscall_src += arch-mips/syscalls/getgroups.S +syscall_src += arch-mips/syscalls/getpgid.S +syscall_src += arch-mips/syscalls/getppid.S +syscall_src += arch-mips/syscalls/getsid.S +syscall_src += arch-mips/syscalls/setsid.S +syscall_src += arch-mips/syscalls/setgid.S +syscall_src += arch-mips/syscalls/__setreuid.S +syscall_src += arch-mips/syscalls/__setresuid.S +syscall_src += arch-mips/syscalls/setresgid.S +syscall_src += arch-mips/syscalls/__brk.S +syscall_src += arch-mips/syscalls/kill.S +syscall_src += arch-mips/syscalls/tkill.S +syscall_src += arch-mips/syscalls/tgkill.S +syscall_src += arch-mips/syscalls/__ptrace.S +syscall_src += arch-mips/syscalls/__set_thread_area.S +syscall_src += arch-mips/syscalls/__getpriority.S +syscall_src += arch-mips/syscalls/setpriority.S +syscall_src += arch-mips/syscalls/setrlimit.S +syscall_src += arch-mips/syscalls/getrlimit.S +syscall_src += arch-mips/syscalls/getrusage.S +syscall_src += arch-mips/syscalls/setgroups.S +syscall_src += arch-mips/syscalls/setpgid.S +syscall_src += arch-mips/syscalls/setregid.S +syscall_src += arch-mips/syscalls/chroot.S +syscall_src += arch-mips/syscalls/prctl.S +syscall_src += arch-mips/syscalls/capget.S +syscall_src += arch-mips/syscalls/capset.S +syscall_src += arch-mips/syscalls/sigaltstack.S +syscall_src += arch-mips/syscalls/acct.S +syscall_src += arch-mips/syscalls/read.S +syscall_src += arch-mips/syscalls/write.S +syscall_src += arch-mips/syscalls/pread64.S +syscall_src += arch-mips/syscalls/pwrite64.S +syscall_src += arch-mips/syscalls/__open.S +syscall_src += arch-mips/syscalls/__openat.S +syscall_src += arch-mips/syscalls/close.S +syscall_src += arch-mips/syscalls/lseek.S +syscall_src += arch-mips/syscalls/__llseek.S +syscall_src += arch-mips/syscalls/getpid.S +syscall_src += arch-mips/syscalls/__mmap2.S +syscall_src += arch-mips/syscalls/munmap.S +syscall_src += arch-mips/syscalls/mremap.S +syscall_src += arch-mips/syscalls/msync.S +syscall_src += arch-mips/syscalls/mprotect.S +syscall_src += arch-mips/syscalls/madvise.S +syscall_src += arch-mips/syscalls/mlock.S +syscall_src += arch-mips/syscalls/munlock.S +syscall_src += arch-mips/syscalls/mlockall.S +syscall_src += arch-mips/syscalls/munlockall.S +syscall_src += arch-mips/syscalls/mincore.S +syscall_src += arch-mips/syscalls/__ioctl.S +syscall_src += arch-mips/syscalls/readv.S +syscall_src += arch-mips/syscalls/writev.S +syscall_src += arch-mips/syscalls/__fcntl.S +syscall_src += arch-mips/syscalls/flock.S +syscall_src += arch-mips/syscalls/fchmod.S +syscall_src += arch-mips/syscalls/dup.S +syscall_src += arch-mips/syscalls/pipe2.S +syscall_src += arch-mips/syscalls/dup2.S +syscall_src += arch-mips/syscalls/select.S +syscall_src += arch-mips/syscalls/ftruncate.S +syscall_src += arch-mips/syscalls/ftruncate64.S +syscall_src += arch-mips/syscalls/getdents.S +syscall_src += arch-mips/syscalls/fsync.S +syscall_src += arch-mips/syscalls/fdatasync.S +syscall_src += arch-mips/syscalls/fchown.S +syscall_src += arch-mips/syscalls/sync.S +syscall_src += arch-mips/syscalls/__fcntl64.S +syscall_src += arch-mips/syscalls/__fstatfs64.S +syscall_src += arch-mips/syscalls/sendfile.S +syscall_src += arch-mips/syscalls/fstatat.S +syscall_src += arch-mips/syscalls/mkdirat.S +syscall_src += arch-mips/syscalls/fchownat.S +syscall_src += arch-mips/syscalls/fchmodat.S +syscall_src += arch-mips/syscalls/renameat.S +syscall_src += arch-mips/syscalls/fsetxattr.S +syscall_src += arch-mips/syscalls/fgetxattr.S +syscall_src += arch-mips/syscalls/flistxattr.S +syscall_src += arch-mips/syscalls/fremovexattr.S +syscall_src += arch-mips/syscalls/link.S +syscall_src += arch-mips/syscalls/unlink.S +syscall_src += arch-mips/syscalls/unlinkat.S +syscall_src += arch-mips/syscalls/chdir.S +syscall_src += arch-mips/syscalls/mknod.S +syscall_src += arch-mips/syscalls/chmod.S +syscall_src += arch-mips/syscalls/chown.S +syscall_src += arch-mips/syscalls/lchown.S +syscall_src += arch-mips/syscalls/mount.S +syscall_src += arch-mips/syscalls/umount2.S +syscall_src += arch-mips/syscalls/fstat.S +syscall_src += arch-mips/syscalls/stat.S +syscall_src += arch-mips/syscalls/lstat.S +syscall_src += arch-mips/syscalls/mkdir.S +syscall_src += arch-mips/syscalls/readlink.S +syscall_src += arch-mips/syscalls/rmdir.S +syscall_src += arch-mips/syscalls/rename.S +syscall_src += arch-mips/syscalls/__getcwd.S +syscall_src += arch-mips/syscalls/access.S +syscall_src += arch-mips/syscalls/faccessat.S +syscall_src += arch-mips/syscalls/symlink.S +syscall_src += arch-mips/syscalls/fchdir.S +syscall_src += arch-mips/syscalls/truncate.S +syscall_src += arch-mips/syscalls/setxattr.S +syscall_src += arch-mips/syscalls/lsetxattr.S +syscall_src += arch-mips/syscalls/getxattr.S +syscall_src += arch-mips/syscalls/lgetxattr.S +syscall_src += arch-mips/syscalls/listxattr.S +syscall_src += arch-mips/syscalls/llistxattr.S +syscall_src += arch-mips/syscalls/removexattr.S +syscall_src += arch-mips/syscalls/lremovexattr.S +syscall_src += arch-mips/syscalls/__statfs64.S +syscall_src += arch-mips/syscalls/unshare.S +syscall_src += arch-mips/syscalls/pause.S +syscall_src += arch-mips/syscalls/gettimeofday.S +syscall_src += arch-mips/syscalls/settimeofday.S +syscall_src += arch-mips/syscalls/times.S +syscall_src += arch-mips/syscalls/nanosleep.S +syscall_src += arch-mips/syscalls/clock_gettime.S +syscall_src += arch-mips/syscalls/clock_settime.S +syscall_src += arch-mips/syscalls/clock_getres.S +syscall_src += arch-mips/syscalls/clock_nanosleep.S +syscall_src += arch-mips/syscalls/getitimer.S +syscall_src += arch-mips/syscalls/setitimer.S +syscall_src += arch-mips/syscalls/__timer_create.S +syscall_src += arch-mips/syscalls/__timer_settime.S +syscall_src += arch-mips/syscalls/__timer_gettime.S +syscall_src += arch-mips/syscalls/__timer_getoverrun.S +syscall_src += arch-mips/syscalls/__timer_delete.S +syscall_src += arch-mips/syscalls/utimes.S +syscall_src += arch-mips/syscalls/utimensat.S +syscall_src += arch-mips/syscalls/sigaction.S +syscall_src += arch-mips/syscalls/sigprocmask.S +syscall_src += arch-mips/syscalls/__sigsuspend.S +syscall_src += arch-mips/syscalls/__rt_sigaction.S +syscall_src += arch-mips/syscalls/__rt_sigprocmask.S +syscall_src += arch-mips/syscalls/__rt_sigtimedwait.S +syscall_src += arch-mips/syscalls/sigpending.S +syscall_src += arch-mips/syscalls/socket.S +syscall_src += arch-mips/syscalls/socketpair.S +syscall_src += arch-mips/syscalls/bind.S +syscall_src += arch-mips/syscalls/connect.S +syscall_src += arch-mips/syscalls/listen.S +syscall_src += arch-mips/syscalls/accept.S +syscall_src += arch-mips/syscalls/getsockname.S +syscall_src += arch-mips/syscalls/getpeername.S +syscall_src += arch-mips/syscalls/sendto.S +syscall_src += arch-mips/syscalls/recvfrom.S +syscall_src += arch-mips/syscalls/shutdown.S +syscall_src += arch-mips/syscalls/setsockopt.S +syscall_src += arch-mips/syscalls/getsockopt.S +syscall_src += arch-mips/syscalls/sendmsg.S +syscall_src += arch-mips/syscalls/recvmsg.S +syscall_src += arch-mips/syscalls/sched_setscheduler.S +syscall_src += arch-mips/syscalls/sched_getscheduler.S +syscall_src += arch-mips/syscalls/sched_yield.S +syscall_src += arch-mips/syscalls/sched_setparam.S +syscall_src += arch-mips/syscalls/sched_getparam.S +syscall_src += arch-mips/syscalls/sched_get_priority_max.S +syscall_src += arch-mips/syscalls/sched_get_priority_min.S +syscall_src += arch-mips/syscalls/sched_rr_get_interval.S +syscall_src += arch-mips/syscalls/sched_setaffinity.S +syscall_src += arch-mips/syscalls/__sched_getaffinity.S +syscall_src += arch-mips/syscalls/__getcpu.S +syscall_src += arch-mips/syscalls/ioprio_set.S +syscall_src += arch-mips/syscalls/ioprio_get.S +syscall_src += arch-mips/syscalls/uname.S +syscall_src += arch-mips/syscalls/__wait4.S +syscall_src += arch-mips/syscalls/umask.S +syscall_src += arch-mips/syscalls/__reboot.S +syscall_src += arch-mips/syscalls/__syslog.S +syscall_src += arch-mips/syscalls/init_module.S +syscall_src += arch-mips/syscalls/delete_module.S +syscall_src += arch-mips/syscalls/klogctl.S +syscall_src += arch-mips/syscalls/sysinfo.S +syscall_src += arch-mips/syscalls/personality.S +syscall_src += arch-mips/syscalls/perf_event_open.S +syscall_src += arch-mips/syscalls/futex.S +syscall_src += arch-mips/syscalls/epoll_create.S +syscall_src += arch-mips/syscalls/epoll_ctl.S +syscall_src += arch-mips/syscalls/epoll_wait.S +syscall_src += arch-mips/syscalls/inotify_init.S +syscall_src += arch-mips/syscalls/inotify_add_watch.S +syscall_src += arch-mips/syscalls/inotify_rm_watch.S +syscall_src += arch-mips/syscalls/poll.S +syscall_src += arch-mips/syscalls/eventfd.S +syscall_src += arch-mips/syscalls/_flush_cache.S +syscall_src += arch-mips/syscalls/syscall.S diff --git a/libc/arch-mips/syscalls/__brk.S b/libc/arch-mips/syscalls/__brk.S new file mode 100644 index 0000000..1f09772 --- /dev/null +++ b/libc/arch-mips/syscalls/__brk.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __brk + .align 4 + .ent __brk + +__brk: + .set noreorder + .cpload $t9 + li $v0, __NR_brk + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __brk diff --git a/libc/arch-mips/syscalls/__fcntl.S b/libc/arch-mips/syscalls/__fcntl.S new file mode 100644 index 0000000..6dd76e3 --- /dev/null +++ b/libc/arch-mips/syscalls/__fcntl.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __fcntl + .align 4 + .ent __fcntl + +__fcntl: + .set noreorder + .cpload $t9 + li $v0, __NR_fcntl + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __fcntl diff --git a/libc/arch-mips/syscalls/__fcntl64.S b/libc/arch-mips/syscalls/__fcntl64.S new file mode 100644 index 0000000..e82e382 --- /dev/null +++ b/libc/arch-mips/syscalls/__fcntl64.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __fcntl64 + .align 4 + .ent __fcntl64 + +__fcntl64: + .set noreorder + .cpload $t9 + li $v0, __NR_fcntl64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __fcntl64 diff --git a/libc/arch-mips/syscalls/__fork.S b/libc/arch-mips/syscalls/__fork.S new file mode 100644 index 0000000..db30472 --- /dev/null +++ b/libc/arch-mips/syscalls/__fork.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __fork + .align 4 + .ent __fork + +__fork: + .set noreorder + .cpload $t9 + li $v0, __NR_fork + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __fork diff --git a/libc/arch-mips/syscalls/__fstatfs64.S b/libc/arch-mips/syscalls/__fstatfs64.S new file mode 100644 index 0000000..6485d10 --- /dev/null +++ b/libc/arch-mips/syscalls/__fstatfs64.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __fstatfs64 + .align 4 + .ent __fstatfs64 + +__fstatfs64: + .set noreorder + .cpload $t9 + li $v0, __NR_fstatfs64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __fstatfs64 diff --git a/libc/arch-mips/syscalls/__getcpu.S b/libc/arch-mips/syscalls/__getcpu.S new file mode 100644 index 0000000..90d59f4 --- /dev/null +++ b/libc/arch-mips/syscalls/__getcpu.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __getcpu + .align 4 + .ent __getcpu + +__getcpu: + .set noreorder + .cpload $t9 + li $v0, __NR_getcpu + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __getcpu diff --git a/libc/arch-mips/syscalls/__getcwd.S b/libc/arch-mips/syscalls/__getcwd.S new file mode 100644 index 0000000..e8fa340 --- /dev/null +++ b/libc/arch-mips/syscalls/__getcwd.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __getcwd + .align 4 + .ent __getcwd + +__getcwd: + .set noreorder + .cpload $t9 + li $v0, __NR_getcwd + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __getcwd diff --git a/libc/arch-mips/syscalls/__getpriority.S b/libc/arch-mips/syscalls/__getpriority.S new file mode 100644 index 0000000..7cabd31 --- /dev/null +++ b/libc/arch-mips/syscalls/__getpriority.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __getpriority + .align 4 + .ent __getpriority + +__getpriority: + .set noreorder + .cpload $t9 + li $v0, __NR_getpriority + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __getpriority diff --git a/libc/arch-mips/syscalls/__ioctl.S b/libc/arch-mips/syscalls/__ioctl.S new file mode 100644 index 0000000..2524e02 --- /dev/null +++ b/libc/arch-mips/syscalls/__ioctl.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __ioctl + .align 4 + .ent __ioctl + +__ioctl: + .set noreorder + .cpload $t9 + li $v0, __NR_ioctl + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __ioctl diff --git a/libc/arch-mips/syscalls/__llseek.S b/libc/arch-mips/syscalls/__llseek.S new file mode 100644 index 0000000..fbfd583 --- /dev/null +++ b/libc/arch-mips/syscalls/__llseek.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __llseek + .align 4 + .ent __llseek + +__llseek: + .set noreorder + .cpload $t9 + li $v0, __NR__llseek + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __llseek diff --git a/libc/arch-mips/syscalls/__mmap2.S b/libc/arch-mips/syscalls/__mmap2.S new file mode 100644 index 0000000..98f97eb --- /dev/null +++ b/libc/arch-mips/syscalls/__mmap2.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __mmap2 + .align 4 + .ent __mmap2 + +__mmap2: + .set noreorder + .cpload $t9 + li $v0, __NR_mmap2 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __mmap2 diff --git a/libc/arch-mips/syscalls/__open.S b/libc/arch-mips/syscalls/__open.S new file mode 100644 index 0000000..0ccb286 --- /dev/null +++ b/libc/arch-mips/syscalls/__open.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __open + .align 4 + .ent __open + +__open: + .set noreorder + .cpload $t9 + li $v0, __NR_open + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __open diff --git a/libc/arch-mips/syscalls/__openat.S b/libc/arch-mips/syscalls/__openat.S new file mode 100644 index 0000000..04399b4 --- /dev/null +++ b/libc/arch-mips/syscalls/__openat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __openat + .align 4 + .ent __openat + +__openat: + .set noreorder + .cpload $t9 + li $v0, __NR_openat + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __openat diff --git a/libc/arch-mips/syscalls/__ptrace.S b/libc/arch-mips/syscalls/__ptrace.S new file mode 100644 index 0000000..0bcba9f --- /dev/null +++ b/libc/arch-mips/syscalls/__ptrace.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __ptrace + .align 4 + .ent __ptrace + +__ptrace: + .set noreorder + .cpload $t9 + li $v0, __NR_ptrace + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __ptrace diff --git a/libc/arch-mips/syscalls/__reboot.S b/libc/arch-mips/syscalls/__reboot.S new file mode 100644 index 0000000..5e8e57a --- /dev/null +++ b/libc/arch-mips/syscalls/__reboot.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __reboot + .align 4 + .ent __reboot + +__reboot: + .set noreorder + .cpload $t9 + li $v0, __NR_reboot + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __reboot diff --git a/libc/arch-mips/syscalls/__rt_sigaction.S b/libc/arch-mips/syscalls/__rt_sigaction.S new file mode 100644 index 0000000..43a571a --- /dev/null +++ b/libc/arch-mips/syscalls/__rt_sigaction.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __rt_sigaction + .align 4 + .ent __rt_sigaction + +__rt_sigaction: + .set noreorder + .cpload $t9 + li $v0, __NR_rt_sigaction + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __rt_sigaction diff --git a/libc/arch-mips/syscalls/__rt_sigprocmask.S b/libc/arch-mips/syscalls/__rt_sigprocmask.S new file mode 100644 index 0000000..59a8894 --- /dev/null +++ b/libc/arch-mips/syscalls/__rt_sigprocmask.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __rt_sigprocmask + .align 4 + .ent __rt_sigprocmask + +__rt_sigprocmask: + .set noreorder + .cpload $t9 + li $v0, __NR_rt_sigprocmask + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __rt_sigprocmask diff --git a/libc/arch-mips/syscalls/__rt_sigtimedwait.S b/libc/arch-mips/syscalls/__rt_sigtimedwait.S new file mode 100644 index 0000000..dae872e --- /dev/null +++ b/libc/arch-mips/syscalls/__rt_sigtimedwait.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __rt_sigtimedwait + .align 4 + .ent __rt_sigtimedwait + +__rt_sigtimedwait: + .set noreorder + .cpload $t9 + li $v0, __NR_rt_sigtimedwait + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __rt_sigtimedwait diff --git a/libc/arch-mips/syscalls/__sched_getaffinity.S b/libc/arch-mips/syscalls/__sched_getaffinity.S new file mode 100644 index 0000000..cc01ff2 --- /dev/null +++ b/libc/arch-mips/syscalls/__sched_getaffinity.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __sched_getaffinity + .align 4 + .ent __sched_getaffinity + +__sched_getaffinity: + .set noreorder + .cpload $t9 + li $v0, __NR_sched_getaffinity + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __sched_getaffinity diff --git a/libc/arch-mips/syscalls/__set_thread_area.S b/libc/arch-mips/syscalls/__set_thread_area.S new file mode 100644 index 0000000..2aac901 --- /dev/null +++ b/libc/arch-mips/syscalls/__set_thread_area.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __set_thread_area + .align 4 + .ent __set_thread_area + +__set_thread_area: + .set noreorder + .cpload $t9 + li $v0, __NR_set_thread_area + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __set_thread_area diff --git a/libc/arch-mips/syscalls/__setresuid.S b/libc/arch-mips/syscalls/__setresuid.S new file mode 100644 index 0000000..e00d2e1 --- /dev/null +++ b/libc/arch-mips/syscalls/__setresuid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __setresuid + .align 4 + .ent __setresuid + +__setresuid: + .set noreorder + .cpload $t9 + li $v0, __NR_setresuid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __setresuid diff --git a/libc/arch-mips/syscalls/__setreuid.S b/libc/arch-mips/syscalls/__setreuid.S new file mode 100644 index 0000000..b45f3fc --- /dev/null +++ b/libc/arch-mips/syscalls/__setreuid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __setreuid + .align 4 + .ent __setreuid + +__setreuid: + .set noreorder + .cpload $t9 + li $v0, __NR_setreuid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __setreuid diff --git a/libc/arch-mips/syscalls/__setuid.S b/libc/arch-mips/syscalls/__setuid.S new file mode 100644 index 0000000..c221526 --- /dev/null +++ b/libc/arch-mips/syscalls/__setuid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __setuid + .align 4 + .ent __setuid + +__setuid: + .set noreorder + .cpload $t9 + li $v0, __NR_setuid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __setuid diff --git a/libc/arch-mips/syscalls/__sigsuspend.S b/libc/arch-mips/syscalls/__sigsuspend.S new file mode 100644 index 0000000..b622efe --- /dev/null +++ b/libc/arch-mips/syscalls/__sigsuspend.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __sigsuspend + .align 4 + .ent __sigsuspend + +__sigsuspend: + .set noreorder + .cpload $t9 + li $v0, __NR_sigsuspend + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __sigsuspend diff --git a/libc/arch-mips/syscalls/__statfs64.S b/libc/arch-mips/syscalls/__statfs64.S new file mode 100644 index 0000000..4d1b17f --- /dev/null +++ b/libc/arch-mips/syscalls/__statfs64.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __statfs64 + .align 4 + .ent __statfs64 + +__statfs64: + .set noreorder + .cpload $t9 + li $v0, __NR_statfs64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __statfs64 diff --git a/libc/arch-mips/syscalls/__sys_clone.S b/libc/arch-mips/syscalls/__sys_clone.S new file mode 100644 index 0000000..3451e02 --- /dev/null +++ b/libc/arch-mips/syscalls/__sys_clone.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __sys_clone + .align 4 + .ent __sys_clone + +__sys_clone: + .set noreorder + .cpload $t9 + li $v0, __NR_clone + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __sys_clone diff --git a/libc/arch-mips/syscalls/__syslog.S b/libc/arch-mips/syscalls/__syslog.S new file mode 100644 index 0000000..bdc194d --- /dev/null +++ b/libc/arch-mips/syscalls/__syslog.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __syslog + .align 4 + .ent __syslog + +__syslog: + .set noreorder + .cpload $t9 + li $v0, __NR_syslog + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __syslog diff --git a/libc/arch-mips/syscalls/__timer_create.S b/libc/arch-mips/syscalls/__timer_create.S new file mode 100644 index 0000000..140d0d1 --- /dev/null +++ b/libc/arch-mips/syscalls/__timer_create.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __timer_create + .align 4 + .ent __timer_create + +__timer_create: + .set noreorder + .cpload $t9 + li $v0, __NR_timer_create + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __timer_create diff --git a/libc/arch-mips/syscalls/__timer_delete.S b/libc/arch-mips/syscalls/__timer_delete.S new file mode 100644 index 0000000..4f362e6 --- /dev/null +++ b/libc/arch-mips/syscalls/__timer_delete.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __timer_delete + .align 4 + .ent __timer_delete + +__timer_delete: + .set noreorder + .cpload $t9 + li $v0, __NR_timer_delete + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __timer_delete diff --git a/libc/arch-mips/syscalls/__timer_getoverrun.S b/libc/arch-mips/syscalls/__timer_getoverrun.S new file mode 100644 index 0000000..68afa1c --- /dev/null +++ b/libc/arch-mips/syscalls/__timer_getoverrun.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __timer_getoverrun + .align 4 + .ent __timer_getoverrun + +__timer_getoverrun: + .set noreorder + .cpload $t9 + li $v0, __NR_timer_getoverrun + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __timer_getoverrun diff --git a/libc/arch-mips/syscalls/__timer_gettime.S b/libc/arch-mips/syscalls/__timer_gettime.S new file mode 100644 index 0000000..4a70da6 --- /dev/null +++ b/libc/arch-mips/syscalls/__timer_gettime.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __timer_gettime + .align 4 + .ent __timer_gettime + +__timer_gettime: + .set noreorder + .cpload $t9 + li $v0, __NR_timer_gettime + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __timer_gettime diff --git a/libc/arch-mips/syscalls/__timer_settime.S b/libc/arch-mips/syscalls/__timer_settime.S new file mode 100644 index 0000000..ad84606 --- /dev/null +++ b/libc/arch-mips/syscalls/__timer_settime.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __timer_settime + .align 4 + .ent __timer_settime + +__timer_settime: + .set noreorder + .cpload $t9 + li $v0, __NR_timer_settime + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __timer_settime diff --git a/libc/arch-mips/syscalls/__wait4.S b/libc/arch-mips/syscalls/__wait4.S new file mode 100644 index 0000000..713b7cb --- /dev/null +++ b/libc/arch-mips/syscalls/__wait4.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __wait4 + .align 4 + .ent __wait4 + +__wait4: + .set noreorder + .cpload $t9 + li $v0, __NR_wait4 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __wait4 diff --git a/libc/arch-mips/syscalls/__waitid.S b/libc/arch-mips/syscalls/__waitid.S new file mode 100644 index 0000000..83e5aa3 --- /dev/null +++ b/libc/arch-mips/syscalls/__waitid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl __waitid + .align 4 + .ent __waitid + +__waitid: + .set noreorder + .cpload $t9 + li $v0, __NR_waitid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end __waitid diff --git a/libc/arch-mips/syscalls/_exit.S b/libc/arch-mips/syscalls/_exit.S new file mode 100644 index 0000000..b7ec876 --- /dev/null +++ b/libc/arch-mips/syscalls/_exit.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl _exit + .align 4 + .ent _exit + +_exit: + .set noreorder + .cpload $t9 + li $v0, __NR_exit_group + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end _exit diff --git a/libc/arch-mips/syscalls/_exit_thread.S b/libc/arch-mips/syscalls/_exit_thread.S new file mode 100644 index 0000000..0af9d3d --- /dev/null +++ b/libc/arch-mips/syscalls/_exit_thread.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl _exit_thread + .align 4 + .ent _exit_thread + +_exit_thread: + .set noreorder + .cpload $t9 + li $v0, __NR_exit + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end _exit_thread diff --git a/libc/arch-mips/syscalls/_flush_cache.S b/libc/arch-mips/syscalls/_flush_cache.S new file mode 100644 index 0000000..07dee66 --- /dev/null +++ b/libc/arch-mips/syscalls/_flush_cache.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl _flush_cache + .align 4 + .ent _flush_cache + +_flush_cache: + .set noreorder + .cpload $t9 + li $v0, __NR_cacheflush + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end _flush_cache diff --git a/libc/arch-mips/syscalls/_waitpid.S b/libc/arch-mips/syscalls/_waitpid.S new file mode 100644 index 0000000..20db3a8 --- /dev/null +++ b/libc/arch-mips/syscalls/_waitpid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl _waitpid + .align 4 + .ent _waitpid + +_waitpid: + .set noreorder + .cpload $t9 + li $v0, __NR_waitpid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end _waitpid diff --git a/libc/arch-mips/syscalls/accept.S b/libc/arch-mips/syscalls/accept.S new file mode 100644 index 0000000..c19216e --- /dev/null +++ b/libc/arch-mips/syscalls/accept.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl accept + .align 4 + .ent accept + +accept: + .set noreorder + .cpload $t9 + li $v0, __NR_accept + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end accept diff --git a/libc/arch-mips/syscalls/access.S b/libc/arch-mips/syscalls/access.S new file mode 100644 index 0000000..a22ed92 --- /dev/null +++ b/libc/arch-mips/syscalls/access.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl access + .align 4 + .ent access + +access: + .set noreorder + .cpload $t9 + li $v0, __NR_access + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end access diff --git a/libc/arch-mips/syscalls/acct.S b/libc/arch-mips/syscalls/acct.S new file mode 100644 index 0000000..5235ede --- /dev/null +++ b/libc/arch-mips/syscalls/acct.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl acct + .align 4 + .ent acct + +acct: + .set noreorder + .cpload $t9 + li $v0, __NR_acct + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end acct diff --git a/libc/arch-mips/syscalls/bind.S b/libc/arch-mips/syscalls/bind.S new file mode 100644 index 0000000..4f00922 --- /dev/null +++ b/libc/arch-mips/syscalls/bind.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl bind + .align 4 + .ent bind + +bind: + .set noreorder + .cpload $t9 + li $v0, __NR_bind + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end bind diff --git a/libc/arch-mips/syscalls/capget.S b/libc/arch-mips/syscalls/capget.S new file mode 100644 index 0000000..80e55ee --- /dev/null +++ b/libc/arch-mips/syscalls/capget.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl capget + .align 4 + .ent capget + +capget: + .set noreorder + .cpload $t9 + li $v0, __NR_capget + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end capget diff --git a/libc/arch-mips/syscalls/capset.S b/libc/arch-mips/syscalls/capset.S new file mode 100644 index 0000000..0e4a3be --- /dev/null +++ b/libc/arch-mips/syscalls/capset.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl capset + .align 4 + .ent capset + +capset: + .set noreorder + .cpload $t9 + li $v0, __NR_capset + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end capset diff --git a/libc/arch-mips/syscalls/chdir.S b/libc/arch-mips/syscalls/chdir.S new file mode 100644 index 0000000..42eb37c --- /dev/null +++ b/libc/arch-mips/syscalls/chdir.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl chdir + .align 4 + .ent chdir + +chdir: + .set noreorder + .cpload $t9 + li $v0, __NR_chdir + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end chdir diff --git a/libc/arch-mips/syscalls/chmod.S b/libc/arch-mips/syscalls/chmod.S new file mode 100644 index 0000000..7ea3ede --- /dev/null +++ b/libc/arch-mips/syscalls/chmod.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl chmod + .align 4 + .ent chmod + +chmod: + .set noreorder + .cpload $t9 + li $v0, __NR_chmod + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end chmod diff --git a/libc/arch-mips/syscalls/chown.S b/libc/arch-mips/syscalls/chown.S new file mode 100644 index 0000000..5fb1e32 --- /dev/null +++ b/libc/arch-mips/syscalls/chown.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl chown + .align 4 + .ent chown + +chown: + .set noreorder + .cpload $t9 + li $v0, __NR_chown + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end chown diff --git a/libc/arch-mips/syscalls/chroot.S b/libc/arch-mips/syscalls/chroot.S new file mode 100644 index 0000000..fafb6a2 --- /dev/null +++ b/libc/arch-mips/syscalls/chroot.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl chroot + .align 4 + .ent chroot + +chroot: + .set noreorder + .cpload $t9 + li $v0, __NR_chroot + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end chroot diff --git a/libc/arch-mips/syscalls/clock_getres.S b/libc/arch-mips/syscalls/clock_getres.S new file mode 100644 index 0000000..4021b14 --- /dev/null +++ b/libc/arch-mips/syscalls/clock_getres.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl clock_getres + .align 4 + .ent clock_getres + +clock_getres: + .set noreorder + .cpload $t9 + li $v0, __NR_clock_getres + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end clock_getres diff --git a/libc/arch-mips/syscalls/clock_gettime.S b/libc/arch-mips/syscalls/clock_gettime.S new file mode 100644 index 0000000..ba7afb9 --- /dev/null +++ b/libc/arch-mips/syscalls/clock_gettime.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl clock_gettime + .align 4 + .ent clock_gettime + +clock_gettime: + .set noreorder + .cpload $t9 + li $v0, __NR_clock_gettime + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end clock_gettime diff --git a/libc/arch-mips/syscalls/clock_nanosleep.S b/libc/arch-mips/syscalls/clock_nanosleep.S new file mode 100644 index 0000000..1a9aef5 --- /dev/null +++ b/libc/arch-mips/syscalls/clock_nanosleep.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl clock_nanosleep + .align 4 + .ent clock_nanosleep + +clock_nanosleep: + .set noreorder + .cpload $t9 + li $v0, __NR_clock_nanosleep + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end clock_nanosleep diff --git a/libc/arch-mips/syscalls/clock_settime.S b/libc/arch-mips/syscalls/clock_settime.S new file mode 100644 index 0000000..65d4388 --- /dev/null +++ b/libc/arch-mips/syscalls/clock_settime.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl clock_settime + .align 4 + .ent clock_settime + +clock_settime: + .set noreorder + .cpload $t9 + li $v0, __NR_clock_settime + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end clock_settime diff --git a/libc/arch-mips/syscalls/close.S b/libc/arch-mips/syscalls/close.S new file mode 100644 index 0000000..07ff4e3 --- /dev/null +++ b/libc/arch-mips/syscalls/close.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl close + .align 4 + .ent close + +close: + .set noreorder + .cpload $t9 + li $v0, __NR_close + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end close diff --git a/libc/arch-mips/syscalls/connect.S b/libc/arch-mips/syscalls/connect.S new file mode 100644 index 0000000..d1fc280 --- /dev/null +++ b/libc/arch-mips/syscalls/connect.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl connect + .align 4 + .ent connect + +connect: + .set noreorder + .cpload $t9 + li $v0, __NR_connect + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end connect diff --git a/libc/arch-mips/syscalls/delete_module.S b/libc/arch-mips/syscalls/delete_module.S new file mode 100644 index 0000000..db80ba7 --- /dev/null +++ b/libc/arch-mips/syscalls/delete_module.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl delete_module + .align 4 + .ent delete_module + +delete_module: + .set noreorder + .cpload $t9 + li $v0, __NR_delete_module + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end delete_module diff --git a/libc/arch-mips/syscalls/dup.S b/libc/arch-mips/syscalls/dup.S new file mode 100644 index 0000000..e815749 --- /dev/null +++ b/libc/arch-mips/syscalls/dup.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl dup + .align 4 + .ent dup + +dup: + .set noreorder + .cpload $t9 + li $v0, __NR_dup + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end dup diff --git a/libc/arch-mips/syscalls/dup2.S b/libc/arch-mips/syscalls/dup2.S new file mode 100644 index 0000000..6fb151f --- /dev/null +++ b/libc/arch-mips/syscalls/dup2.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl dup2 + .align 4 + .ent dup2 + +dup2: + .set noreorder + .cpload $t9 + li $v0, __NR_dup2 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end dup2 diff --git a/libc/arch-mips/syscalls/epoll_create.S b/libc/arch-mips/syscalls/epoll_create.S new file mode 100644 index 0000000..e5e420b --- /dev/null +++ b/libc/arch-mips/syscalls/epoll_create.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl epoll_create + .align 4 + .ent epoll_create + +epoll_create: + .set noreorder + .cpload $t9 + li $v0, __NR_epoll_create + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end epoll_create diff --git a/libc/arch-mips/syscalls/epoll_ctl.S b/libc/arch-mips/syscalls/epoll_ctl.S new file mode 100644 index 0000000..f4f9f05 --- /dev/null +++ b/libc/arch-mips/syscalls/epoll_ctl.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl epoll_ctl + .align 4 + .ent epoll_ctl + +epoll_ctl: + .set noreorder + .cpload $t9 + li $v0, __NR_epoll_ctl + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end epoll_ctl diff --git a/libc/arch-mips/syscalls/epoll_wait.S b/libc/arch-mips/syscalls/epoll_wait.S new file mode 100644 index 0000000..64d33fb --- /dev/null +++ b/libc/arch-mips/syscalls/epoll_wait.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl epoll_wait + .align 4 + .ent epoll_wait + +epoll_wait: + .set noreorder + .cpload $t9 + li $v0, __NR_epoll_wait + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end epoll_wait diff --git a/libc/arch-mips/syscalls/eventfd.S b/libc/arch-mips/syscalls/eventfd.S new file mode 100644 index 0000000..5c4e22b --- /dev/null +++ b/libc/arch-mips/syscalls/eventfd.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl eventfd + .align 4 + .ent eventfd + +eventfd: + .set noreorder + .cpload $t9 + li $v0, __NR_eventfd2 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end eventfd diff --git a/libc/arch-mips/syscalls/execve.S b/libc/arch-mips/syscalls/execve.S new file mode 100644 index 0000000..31b9276 --- /dev/null +++ b/libc/arch-mips/syscalls/execve.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl execve + .align 4 + .ent execve + +execve: + .set noreorder + .cpload $t9 + li $v0, __NR_execve + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end execve diff --git a/libc/arch-mips/syscalls/faccessat.S b/libc/arch-mips/syscalls/faccessat.S new file mode 100644 index 0000000..97db4c0 --- /dev/null +++ b/libc/arch-mips/syscalls/faccessat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl faccessat + .align 4 + .ent faccessat + +faccessat: + .set noreorder + .cpload $t9 + li $v0, __NR_faccessat + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end faccessat diff --git a/libc/arch-mips/syscalls/fchdir.S b/libc/arch-mips/syscalls/fchdir.S new file mode 100644 index 0000000..93298bd --- /dev/null +++ b/libc/arch-mips/syscalls/fchdir.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fchdir + .align 4 + .ent fchdir + +fchdir: + .set noreorder + .cpload $t9 + li $v0, __NR_fchdir + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fchdir diff --git a/libc/arch-mips/syscalls/fchmod.S b/libc/arch-mips/syscalls/fchmod.S new file mode 100644 index 0000000..f483567 --- /dev/null +++ b/libc/arch-mips/syscalls/fchmod.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fchmod + .align 4 + .ent fchmod + +fchmod: + .set noreorder + .cpload $t9 + li $v0, __NR_fchmod + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fchmod diff --git a/libc/arch-mips/syscalls/fchmodat.S b/libc/arch-mips/syscalls/fchmodat.S new file mode 100644 index 0000000..8ba1bbe --- /dev/null +++ b/libc/arch-mips/syscalls/fchmodat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fchmodat + .align 4 + .ent fchmodat + +fchmodat: + .set noreorder + .cpload $t9 + li $v0, __NR_fchmodat + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fchmodat diff --git a/libc/arch-mips/syscalls/fchown.S b/libc/arch-mips/syscalls/fchown.S new file mode 100644 index 0000000..24fc08f --- /dev/null +++ b/libc/arch-mips/syscalls/fchown.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fchown + .align 4 + .ent fchown + +fchown: + .set noreorder + .cpload $t9 + li $v0, __NR_fchown + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fchown diff --git a/libc/arch-mips/syscalls/fchownat.S b/libc/arch-mips/syscalls/fchownat.S new file mode 100644 index 0000000..983ed56 --- /dev/null +++ b/libc/arch-mips/syscalls/fchownat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fchownat + .align 4 + .ent fchownat + +fchownat: + .set noreorder + .cpload $t9 + li $v0, __NR_fchownat + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fchownat diff --git a/libc/arch-mips/syscalls/fdatasync.S b/libc/arch-mips/syscalls/fdatasync.S new file mode 100644 index 0000000..312439d --- /dev/null +++ b/libc/arch-mips/syscalls/fdatasync.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fdatasync + .align 4 + .ent fdatasync + +fdatasync: + .set noreorder + .cpload $t9 + li $v0, __NR_fdatasync + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fdatasync diff --git a/libc/arch-mips/syscalls/fgetxattr.S b/libc/arch-mips/syscalls/fgetxattr.S new file mode 100644 index 0000000..7e77e61 --- /dev/null +++ b/libc/arch-mips/syscalls/fgetxattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fgetxattr + .align 4 + .ent fgetxattr + +fgetxattr: + .set noreorder + .cpload $t9 + li $v0, __NR_fgetxattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fgetxattr diff --git a/libc/arch-mips/syscalls/flistxattr.S b/libc/arch-mips/syscalls/flistxattr.S new file mode 100644 index 0000000..26e26e1 --- /dev/null +++ b/libc/arch-mips/syscalls/flistxattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl flistxattr + .align 4 + .ent flistxattr + +flistxattr: + .set noreorder + .cpload $t9 + li $v0, __NR_flistxattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end flistxattr diff --git a/libc/arch-mips/syscalls/flock.S b/libc/arch-mips/syscalls/flock.S new file mode 100644 index 0000000..f9a3142 --- /dev/null +++ b/libc/arch-mips/syscalls/flock.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl flock + .align 4 + .ent flock + +flock: + .set noreorder + .cpload $t9 + li $v0, __NR_flock + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end flock diff --git a/libc/arch-mips/syscalls/fremovexattr.S b/libc/arch-mips/syscalls/fremovexattr.S new file mode 100644 index 0000000..db3eb6c --- /dev/null +++ b/libc/arch-mips/syscalls/fremovexattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fremovexattr + .align 4 + .ent fremovexattr + +fremovexattr: + .set noreorder + .cpload $t9 + li $v0, __NR_fremovexattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fremovexattr diff --git a/libc/arch-mips/syscalls/fsetxattr.S b/libc/arch-mips/syscalls/fsetxattr.S new file mode 100644 index 0000000..9e666f2 --- /dev/null +++ b/libc/arch-mips/syscalls/fsetxattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fsetxattr + .align 4 + .ent fsetxattr + +fsetxattr: + .set noreorder + .cpload $t9 + li $v0, __NR_fsetxattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fsetxattr diff --git a/libc/arch-mips/syscalls/fstat.S b/libc/arch-mips/syscalls/fstat.S new file mode 100644 index 0000000..73d7235 --- /dev/null +++ b/libc/arch-mips/syscalls/fstat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fstat + .align 4 + .ent fstat + +fstat: + .set noreorder + .cpload $t9 + li $v0, __NR_fstat64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fstat diff --git a/libc/arch-mips/syscalls/fstatat.S b/libc/arch-mips/syscalls/fstatat.S new file mode 100644 index 0000000..3ae229e --- /dev/null +++ b/libc/arch-mips/syscalls/fstatat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fstatat + .align 4 + .ent fstatat + +fstatat: + .set noreorder + .cpload $t9 + li $v0, __NR_fstatat64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fstatat diff --git a/libc/arch-mips/syscalls/fsync.S b/libc/arch-mips/syscalls/fsync.S new file mode 100644 index 0000000..e1cd316 --- /dev/null +++ b/libc/arch-mips/syscalls/fsync.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl fsync + .align 4 + .ent fsync + +fsync: + .set noreorder + .cpload $t9 + li $v0, __NR_fsync + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end fsync diff --git a/libc/arch-mips/syscalls/ftruncate.S b/libc/arch-mips/syscalls/ftruncate.S new file mode 100644 index 0000000..5d72b43 --- /dev/null +++ b/libc/arch-mips/syscalls/ftruncate.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl ftruncate + .align 4 + .ent ftruncate + +ftruncate: + .set noreorder + .cpload $t9 + li $v0, __NR_ftruncate + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end ftruncate diff --git a/libc/arch-mips/syscalls/ftruncate64.S b/libc/arch-mips/syscalls/ftruncate64.S new file mode 100644 index 0000000..216ae38 --- /dev/null +++ b/libc/arch-mips/syscalls/ftruncate64.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl ftruncate64 + .align 4 + .ent ftruncate64 + +ftruncate64: + .set noreorder + .cpload $t9 + li $v0, __NR_ftruncate64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end ftruncate64 diff --git a/libc/arch-mips/syscalls/futex.S b/libc/arch-mips/syscalls/futex.S new file mode 100644 index 0000000..65e537a --- /dev/null +++ b/libc/arch-mips/syscalls/futex.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl futex + .align 4 + .ent futex + +futex: + .set noreorder + .cpload $t9 + li $v0, __NR_futex + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end futex diff --git a/libc/arch-mips/syscalls/getdents.S b/libc/arch-mips/syscalls/getdents.S new file mode 100644 index 0000000..8ff0f26 --- /dev/null +++ b/libc/arch-mips/syscalls/getdents.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getdents + .align 4 + .ent getdents + +getdents: + .set noreorder + .cpload $t9 + li $v0, __NR_getdents64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getdents diff --git a/libc/arch-mips/syscalls/getegid.S b/libc/arch-mips/syscalls/getegid.S new file mode 100644 index 0000000..dc2a04b --- /dev/null +++ b/libc/arch-mips/syscalls/getegid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getegid + .align 4 + .ent getegid + +getegid: + .set noreorder + .cpload $t9 + li $v0, __NR_getegid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getegid diff --git a/libc/arch-mips/syscalls/geteuid.S b/libc/arch-mips/syscalls/geteuid.S new file mode 100644 index 0000000..8beca88 --- /dev/null +++ b/libc/arch-mips/syscalls/geteuid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl geteuid + .align 4 + .ent geteuid + +geteuid: + .set noreorder + .cpload $t9 + li $v0, __NR_geteuid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end geteuid diff --git a/libc/arch-mips/syscalls/getgid.S b/libc/arch-mips/syscalls/getgid.S new file mode 100644 index 0000000..6a615ee --- /dev/null +++ b/libc/arch-mips/syscalls/getgid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getgid + .align 4 + .ent getgid + +getgid: + .set noreorder + .cpload $t9 + li $v0, __NR_getgid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getgid diff --git a/libc/arch-mips/syscalls/getgroups.S b/libc/arch-mips/syscalls/getgroups.S new file mode 100644 index 0000000..8be7308 --- /dev/null +++ b/libc/arch-mips/syscalls/getgroups.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getgroups + .align 4 + .ent getgroups + +getgroups: + .set noreorder + .cpload $t9 + li $v0, __NR_getgroups + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getgroups diff --git a/libc/arch-mips/syscalls/getitimer.S b/libc/arch-mips/syscalls/getitimer.S new file mode 100644 index 0000000..3df1d11 --- /dev/null +++ b/libc/arch-mips/syscalls/getitimer.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getitimer + .align 4 + .ent getitimer + +getitimer: + .set noreorder + .cpload $t9 + li $v0, __NR_getitimer + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getitimer diff --git a/libc/arch-mips/syscalls/getpeername.S b/libc/arch-mips/syscalls/getpeername.S new file mode 100644 index 0000000..4a3beda --- /dev/null +++ b/libc/arch-mips/syscalls/getpeername.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getpeername + .align 4 + .ent getpeername + +getpeername: + .set noreorder + .cpload $t9 + li $v0, __NR_getpeername + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getpeername diff --git a/libc/arch-mips/syscalls/getpgid.S b/libc/arch-mips/syscalls/getpgid.S new file mode 100644 index 0000000..fd79351 --- /dev/null +++ b/libc/arch-mips/syscalls/getpgid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getpgid + .align 4 + .ent getpgid + +getpgid: + .set noreorder + .cpload $t9 + li $v0, __NR_getpgid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getpgid diff --git a/libc/arch-mips/syscalls/getpid.S b/libc/arch-mips/syscalls/getpid.S new file mode 100644 index 0000000..f52e31b --- /dev/null +++ b/libc/arch-mips/syscalls/getpid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getpid + .align 4 + .ent getpid + +getpid: + .set noreorder + .cpload $t9 + li $v0, __NR_getpid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getpid diff --git a/libc/arch-mips/syscalls/getppid.S b/libc/arch-mips/syscalls/getppid.S new file mode 100644 index 0000000..5e3fe19 --- /dev/null +++ b/libc/arch-mips/syscalls/getppid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getppid + .align 4 + .ent getppid + +getppid: + .set noreorder + .cpload $t9 + li $v0, __NR_getppid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getppid diff --git a/libc/arch-mips/syscalls/getresgid.S b/libc/arch-mips/syscalls/getresgid.S new file mode 100644 index 0000000..8e9bf39 --- /dev/null +++ b/libc/arch-mips/syscalls/getresgid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getresgid + .align 4 + .ent getresgid + +getresgid: + .set noreorder + .cpload $t9 + li $v0, __NR_getresgid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getresgid diff --git a/libc/arch-mips/syscalls/getresuid.S b/libc/arch-mips/syscalls/getresuid.S new file mode 100644 index 0000000..ff27cde --- /dev/null +++ b/libc/arch-mips/syscalls/getresuid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getresuid + .align 4 + .ent getresuid + +getresuid: + .set noreorder + .cpload $t9 + li $v0, __NR_getresuid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getresuid diff --git a/libc/arch-mips/syscalls/getrlimit.S b/libc/arch-mips/syscalls/getrlimit.S new file mode 100644 index 0000000..72ed7d8 --- /dev/null +++ b/libc/arch-mips/syscalls/getrlimit.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getrlimit + .align 4 + .ent getrlimit + +getrlimit: + .set noreorder + .cpload $t9 + li $v0, __NR_getrlimit + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getrlimit diff --git a/libc/arch-mips/syscalls/getrusage.S b/libc/arch-mips/syscalls/getrusage.S new file mode 100644 index 0000000..4c0f7d0 --- /dev/null +++ b/libc/arch-mips/syscalls/getrusage.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getrusage + .align 4 + .ent getrusage + +getrusage: + .set noreorder + .cpload $t9 + li $v0, __NR_getrusage + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getrusage diff --git a/libc/arch-mips/syscalls/getsid.S b/libc/arch-mips/syscalls/getsid.S new file mode 100644 index 0000000..2c089ac --- /dev/null +++ b/libc/arch-mips/syscalls/getsid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getsid + .align 4 + .ent getsid + +getsid: + .set noreorder + .cpload $t9 + li $v0, __NR_getsid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getsid diff --git a/libc/arch-mips/syscalls/getsockname.S b/libc/arch-mips/syscalls/getsockname.S new file mode 100644 index 0000000..e3d41f9 --- /dev/null +++ b/libc/arch-mips/syscalls/getsockname.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getsockname + .align 4 + .ent getsockname + +getsockname: + .set noreorder + .cpload $t9 + li $v0, __NR_getsockname + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getsockname diff --git a/libc/arch-mips/syscalls/getsockopt.S b/libc/arch-mips/syscalls/getsockopt.S new file mode 100644 index 0000000..d55ae6a --- /dev/null +++ b/libc/arch-mips/syscalls/getsockopt.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getsockopt + .align 4 + .ent getsockopt + +getsockopt: + .set noreorder + .cpload $t9 + li $v0, __NR_getsockopt + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getsockopt diff --git a/libc/arch-mips/syscalls/gettid.S b/libc/arch-mips/syscalls/gettid.S new file mode 100644 index 0000000..de37df5 --- /dev/null +++ b/libc/arch-mips/syscalls/gettid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl gettid + .align 4 + .ent gettid + +gettid: + .set noreorder + .cpload $t9 + li $v0, __NR_gettid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end gettid diff --git a/libc/arch-mips/syscalls/gettimeofday.S b/libc/arch-mips/syscalls/gettimeofday.S new file mode 100644 index 0000000..a9a93a5 --- /dev/null +++ b/libc/arch-mips/syscalls/gettimeofday.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl gettimeofday + .align 4 + .ent gettimeofday + +gettimeofday: + .set noreorder + .cpload $t9 + li $v0, __NR_gettimeofday + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end gettimeofday diff --git a/libc/arch-mips/syscalls/getuid.S b/libc/arch-mips/syscalls/getuid.S new file mode 100644 index 0000000..e5ba698 --- /dev/null +++ b/libc/arch-mips/syscalls/getuid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getuid + .align 4 + .ent getuid + +getuid: + .set noreorder + .cpload $t9 + li $v0, __NR_getuid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getuid diff --git a/libc/arch-mips/syscalls/getxattr.S b/libc/arch-mips/syscalls/getxattr.S new file mode 100644 index 0000000..6c70579 --- /dev/null +++ b/libc/arch-mips/syscalls/getxattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl getxattr + .align 4 + .ent getxattr + +getxattr: + .set noreorder + .cpload $t9 + li $v0, __NR_getxattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end getxattr diff --git a/libc/arch-mips/syscalls/init_module.S b/libc/arch-mips/syscalls/init_module.S new file mode 100644 index 0000000..5cfbd2f --- /dev/null +++ b/libc/arch-mips/syscalls/init_module.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl init_module + .align 4 + .ent init_module + +init_module: + .set noreorder + .cpload $t9 + li $v0, __NR_init_module + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end init_module diff --git a/libc/arch-mips/syscalls/inotify_add_watch.S b/libc/arch-mips/syscalls/inotify_add_watch.S new file mode 100644 index 0000000..8dde667 --- /dev/null +++ b/libc/arch-mips/syscalls/inotify_add_watch.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl inotify_add_watch + .align 4 + .ent inotify_add_watch + +inotify_add_watch: + .set noreorder + .cpload $t9 + li $v0, __NR_inotify_add_watch + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end inotify_add_watch diff --git a/libc/arch-mips/syscalls/inotify_init.S b/libc/arch-mips/syscalls/inotify_init.S new file mode 100644 index 0000000..cde4667 --- /dev/null +++ b/libc/arch-mips/syscalls/inotify_init.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl inotify_init + .align 4 + .ent inotify_init + +inotify_init: + .set noreorder + .cpload $t9 + li $v0, __NR_inotify_init + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end inotify_init diff --git a/libc/arch-mips/syscalls/inotify_rm_watch.S b/libc/arch-mips/syscalls/inotify_rm_watch.S new file mode 100644 index 0000000..1b2964e --- /dev/null +++ b/libc/arch-mips/syscalls/inotify_rm_watch.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl inotify_rm_watch + .align 4 + .ent inotify_rm_watch + +inotify_rm_watch: + .set noreorder + .cpload $t9 + li $v0, __NR_inotify_rm_watch + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end inotify_rm_watch diff --git a/libc/arch-mips/syscalls/ioprio_get.S b/libc/arch-mips/syscalls/ioprio_get.S new file mode 100644 index 0000000..f7f2441 --- /dev/null +++ b/libc/arch-mips/syscalls/ioprio_get.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl ioprio_get + .align 4 + .ent ioprio_get + +ioprio_get: + .set noreorder + .cpload $t9 + li $v0, __NR_ioprio_get + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end ioprio_get diff --git a/libc/arch-mips/syscalls/ioprio_set.S b/libc/arch-mips/syscalls/ioprio_set.S new file mode 100644 index 0000000..33a30e7 --- /dev/null +++ b/libc/arch-mips/syscalls/ioprio_set.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl ioprio_set + .align 4 + .ent ioprio_set + +ioprio_set: + .set noreorder + .cpload $t9 + li $v0, __NR_ioprio_set + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end ioprio_set diff --git a/libc/arch-mips/syscalls/kill.S b/libc/arch-mips/syscalls/kill.S new file mode 100644 index 0000000..a6640ff --- /dev/null +++ b/libc/arch-mips/syscalls/kill.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl kill + .align 4 + .ent kill + +kill: + .set noreorder + .cpload $t9 + li $v0, __NR_kill + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end kill diff --git a/libc/arch-mips/syscalls/klogctl.S b/libc/arch-mips/syscalls/klogctl.S new file mode 100644 index 0000000..8c41dcf --- /dev/null +++ b/libc/arch-mips/syscalls/klogctl.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl klogctl + .align 4 + .ent klogctl + +klogctl: + .set noreorder + .cpload $t9 + li $v0, __NR_syslog + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end klogctl diff --git a/libc/arch-mips/syscalls/lchown.S b/libc/arch-mips/syscalls/lchown.S new file mode 100644 index 0000000..9fb4660 --- /dev/null +++ b/libc/arch-mips/syscalls/lchown.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl lchown + .align 4 + .ent lchown + +lchown: + .set noreorder + .cpload $t9 + li $v0, __NR_lchown + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end lchown diff --git a/libc/arch-mips/syscalls/lgetxattr.S b/libc/arch-mips/syscalls/lgetxattr.S new file mode 100644 index 0000000..d546d28 --- /dev/null +++ b/libc/arch-mips/syscalls/lgetxattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl lgetxattr + .align 4 + .ent lgetxattr + +lgetxattr: + .set noreorder + .cpload $t9 + li $v0, __NR_lgetxattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end lgetxattr diff --git a/libc/arch-mips/syscalls/link.S b/libc/arch-mips/syscalls/link.S new file mode 100644 index 0000000..4096b44 --- /dev/null +++ b/libc/arch-mips/syscalls/link.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl link + .align 4 + .ent link + +link: + .set noreorder + .cpload $t9 + li $v0, __NR_link + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end link diff --git a/libc/arch-mips/syscalls/listen.S b/libc/arch-mips/syscalls/listen.S new file mode 100644 index 0000000..f365d1d --- /dev/null +++ b/libc/arch-mips/syscalls/listen.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl listen + .align 4 + .ent listen + +listen: + .set noreorder + .cpload $t9 + li $v0, __NR_listen + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end listen diff --git a/libc/arch-mips/syscalls/listxattr.S b/libc/arch-mips/syscalls/listxattr.S new file mode 100644 index 0000000..90b4544 --- /dev/null +++ b/libc/arch-mips/syscalls/listxattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl listxattr + .align 4 + .ent listxattr + +listxattr: + .set noreorder + .cpload $t9 + li $v0, __NR_listxattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end listxattr diff --git a/libc/arch-mips/syscalls/llistxattr.S b/libc/arch-mips/syscalls/llistxattr.S new file mode 100644 index 0000000..e74bf85 --- /dev/null +++ b/libc/arch-mips/syscalls/llistxattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl llistxattr + .align 4 + .ent llistxattr + +llistxattr: + .set noreorder + .cpload $t9 + li $v0, __NR_llistxattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end llistxattr diff --git a/libc/arch-mips/syscalls/lremovexattr.S b/libc/arch-mips/syscalls/lremovexattr.S new file mode 100644 index 0000000..a8d8df9 --- /dev/null +++ b/libc/arch-mips/syscalls/lremovexattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl lremovexattr + .align 4 + .ent lremovexattr + +lremovexattr: + .set noreorder + .cpload $t9 + li $v0, __NR_lremovexattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end lremovexattr diff --git a/libc/arch-mips/syscalls/lseek.S b/libc/arch-mips/syscalls/lseek.S new file mode 100644 index 0000000..bf486ac --- /dev/null +++ b/libc/arch-mips/syscalls/lseek.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl lseek + .align 4 + .ent lseek + +lseek: + .set noreorder + .cpload $t9 + li $v0, __NR_lseek + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end lseek diff --git a/libc/arch-mips/syscalls/lsetxattr.S b/libc/arch-mips/syscalls/lsetxattr.S new file mode 100644 index 0000000..19a0fdf --- /dev/null +++ b/libc/arch-mips/syscalls/lsetxattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl lsetxattr + .align 4 + .ent lsetxattr + +lsetxattr: + .set noreorder + .cpload $t9 + li $v0, __NR_lsetxattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end lsetxattr diff --git a/libc/arch-mips/syscalls/lstat.S b/libc/arch-mips/syscalls/lstat.S new file mode 100644 index 0000000..355d1da --- /dev/null +++ b/libc/arch-mips/syscalls/lstat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl lstat + .align 4 + .ent lstat + +lstat: + .set noreorder + .cpload $t9 + li $v0, __NR_lstat64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end lstat diff --git a/libc/arch-mips/syscalls/madvise.S b/libc/arch-mips/syscalls/madvise.S new file mode 100644 index 0000000..4df7325 --- /dev/null +++ b/libc/arch-mips/syscalls/madvise.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl madvise + .align 4 + .ent madvise + +madvise: + .set noreorder + .cpload $t9 + li $v0, __NR_madvise + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end madvise diff --git a/libc/arch-mips/syscalls/mincore.S b/libc/arch-mips/syscalls/mincore.S new file mode 100644 index 0000000..8f467cd --- /dev/null +++ b/libc/arch-mips/syscalls/mincore.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl mincore + .align 4 + .ent mincore + +mincore: + .set noreorder + .cpload $t9 + li $v0, __NR_mincore + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end mincore diff --git a/libc/arch-mips/syscalls/mkdir.S b/libc/arch-mips/syscalls/mkdir.S new file mode 100644 index 0000000..abf7db8 --- /dev/null +++ b/libc/arch-mips/syscalls/mkdir.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl mkdir + .align 4 + .ent mkdir + +mkdir: + .set noreorder + .cpload $t9 + li $v0, __NR_mkdir + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end mkdir diff --git a/libc/arch-mips/syscalls/mkdirat.S b/libc/arch-mips/syscalls/mkdirat.S new file mode 100644 index 0000000..4ccbe3b --- /dev/null +++ b/libc/arch-mips/syscalls/mkdirat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl mkdirat + .align 4 + .ent mkdirat + +mkdirat: + .set noreorder + .cpload $t9 + li $v0, __NR_mkdirat + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end mkdirat diff --git a/libc/arch-mips/syscalls/mknod.S b/libc/arch-mips/syscalls/mknod.S new file mode 100644 index 0000000..5ebb0ad --- /dev/null +++ b/libc/arch-mips/syscalls/mknod.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl mknod + .align 4 + .ent mknod + +mknod: + .set noreorder + .cpload $t9 + li $v0, __NR_mknod + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end mknod diff --git a/libc/arch-mips/syscalls/mlock.S b/libc/arch-mips/syscalls/mlock.S new file mode 100644 index 0000000..99aca6e --- /dev/null +++ b/libc/arch-mips/syscalls/mlock.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl mlock + .align 4 + .ent mlock + +mlock: + .set noreorder + .cpload $t9 + li $v0, __NR_mlock + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end mlock diff --git a/libc/arch-mips/syscalls/mlockall.S b/libc/arch-mips/syscalls/mlockall.S new file mode 100644 index 0000000..393c090 --- /dev/null +++ b/libc/arch-mips/syscalls/mlockall.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl mlockall + .align 4 + .ent mlockall + +mlockall: + .set noreorder + .cpload $t9 + li $v0, __NR_mlockall + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end mlockall diff --git a/libc/arch-mips/syscalls/mount.S b/libc/arch-mips/syscalls/mount.S new file mode 100644 index 0000000..1b3385a --- /dev/null +++ b/libc/arch-mips/syscalls/mount.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl mount + .align 4 + .ent mount + +mount: + .set noreorder + .cpload $t9 + li $v0, __NR_mount + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end mount diff --git a/libc/arch-mips/syscalls/mprotect.S b/libc/arch-mips/syscalls/mprotect.S new file mode 100644 index 0000000..4dc3bea --- /dev/null +++ b/libc/arch-mips/syscalls/mprotect.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl mprotect + .align 4 + .ent mprotect + +mprotect: + .set noreorder + .cpload $t9 + li $v0, __NR_mprotect + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end mprotect diff --git a/libc/arch-mips/syscalls/mremap.S b/libc/arch-mips/syscalls/mremap.S new file mode 100644 index 0000000..721ccd9 --- /dev/null +++ b/libc/arch-mips/syscalls/mremap.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl mremap + .align 4 + .ent mremap + +mremap: + .set noreorder + .cpload $t9 + li $v0, __NR_mremap + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end mremap diff --git a/libc/arch-mips/syscalls/msync.S b/libc/arch-mips/syscalls/msync.S new file mode 100644 index 0000000..37e1c9a --- /dev/null +++ b/libc/arch-mips/syscalls/msync.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl msync + .align 4 + .ent msync + +msync: + .set noreorder + .cpload $t9 + li $v0, __NR_msync + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end msync diff --git a/libc/arch-mips/syscalls/munlock.S b/libc/arch-mips/syscalls/munlock.S new file mode 100644 index 0000000..befc282 --- /dev/null +++ b/libc/arch-mips/syscalls/munlock.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl munlock + .align 4 + .ent munlock + +munlock: + .set noreorder + .cpload $t9 + li $v0, __NR_munlock + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end munlock diff --git a/libc/arch-mips/syscalls/munlockall.S b/libc/arch-mips/syscalls/munlockall.S new file mode 100644 index 0000000..20fa7b8 --- /dev/null +++ b/libc/arch-mips/syscalls/munlockall.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl munlockall + .align 4 + .ent munlockall + +munlockall: + .set noreorder + .cpload $t9 + li $v0, __NR_munlockall + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end munlockall diff --git a/libc/arch-mips/syscalls/munmap.S b/libc/arch-mips/syscalls/munmap.S new file mode 100644 index 0000000..5b717a9 --- /dev/null +++ b/libc/arch-mips/syscalls/munmap.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl munmap + .align 4 + .ent munmap + +munmap: + .set noreorder + .cpload $t9 + li $v0, __NR_munmap + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end munmap diff --git a/libc/arch-mips/syscalls/nanosleep.S b/libc/arch-mips/syscalls/nanosleep.S new file mode 100644 index 0000000..58ace12 --- /dev/null +++ b/libc/arch-mips/syscalls/nanosleep.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl nanosleep + .align 4 + .ent nanosleep + +nanosleep: + .set noreorder + .cpload $t9 + li $v0, __NR_nanosleep + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end nanosleep diff --git a/libc/arch-mips/syscalls/pause.S b/libc/arch-mips/syscalls/pause.S new file mode 100644 index 0000000..70346b4 --- /dev/null +++ b/libc/arch-mips/syscalls/pause.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl pause + .align 4 + .ent pause + +pause: + .set noreorder + .cpload $t9 + li $v0, __NR_pause + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end pause diff --git a/libc/arch-mips/syscalls/perf_event_open.S b/libc/arch-mips/syscalls/perf_event_open.S new file mode 100644 index 0000000..22c9c3c --- /dev/null +++ b/libc/arch-mips/syscalls/perf_event_open.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl perf_event_open + .align 4 + .ent perf_event_open + +perf_event_open: + .set noreorder + .cpload $t9 + li $v0, __NR_perf_event_open + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end perf_event_open diff --git a/libc/arch-mips/syscalls/personality.S b/libc/arch-mips/syscalls/personality.S new file mode 100644 index 0000000..0020469 --- /dev/null +++ b/libc/arch-mips/syscalls/personality.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl personality + .align 4 + .ent personality + +personality: + .set noreorder + .cpload $t9 + li $v0, __NR_personality + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end personality diff --git a/libc/arch-mips/syscalls/pipe2.S b/libc/arch-mips/syscalls/pipe2.S new file mode 100644 index 0000000..9dfde29 --- /dev/null +++ b/libc/arch-mips/syscalls/pipe2.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl pipe2 + .align 4 + .ent pipe2 + +pipe2: + .set noreorder + .cpload $t9 + li $v0, __NR_pipe2 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end pipe2 diff --git a/libc/arch-mips/syscalls/poll.S b/libc/arch-mips/syscalls/poll.S new file mode 100644 index 0000000..c1fec97 --- /dev/null +++ b/libc/arch-mips/syscalls/poll.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl poll + .align 4 + .ent poll + +poll: + .set noreorder + .cpload $t9 + li $v0, __NR_poll + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end poll diff --git a/libc/arch-mips/syscalls/prctl.S b/libc/arch-mips/syscalls/prctl.S new file mode 100644 index 0000000..aaf1344 --- /dev/null +++ b/libc/arch-mips/syscalls/prctl.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl prctl + .align 4 + .ent prctl + +prctl: + .set noreorder + .cpload $t9 + li $v0, __NR_prctl + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end prctl diff --git a/libc/arch-mips/syscalls/pread64.S b/libc/arch-mips/syscalls/pread64.S new file mode 100644 index 0000000..86e817c --- /dev/null +++ b/libc/arch-mips/syscalls/pread64.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl pread64 + .align 4 + .ent pread64 + +pread64: + .set noreorder + .cpload $t9 + li $v0, __NR_pread64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end pread64 diff --git a/libc/arch-mips/syscalls/pwrite64.S b/libc/arch-mips/syscalls/pwrite64.S new file mode 100644 index 0000000..a8dcd98 --- /dev/null +++ b/libc/arch-mips/syscalls/pwrite64.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl pwrite64 + .align 4 + .ent pwrite64 + +pwrite64: + .set noreorder + .cpload $t9 + li $v0, __NR_pwrite64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end pwrite64 diff --git a/libc/arch-mips/syscalls/read.S b/libc/arch-mips/syscalls/read.S new file mode 100644 index 0000000..75816cd --- /dev/null +++ b/libc/arch-mips/syscalls/read.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl read + .align 4 + .ent read + +read: + .set noreorder + .cpload $t9 + li $v0, __NR_read + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end read diff --git a/libc/arch-mips/syscalls/readahead.S b/libc/arch-mips/syscalls/readahead.S new file mode 100644 index 0000000..5ec600d --- /dev/null +++ b/libc/arch-mips/syscalls/readahead.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl readahead + .align 4 + .ent readahead + +readahead: + .set noreorder + .cpload $t9 + li $v0, __NR_readahead + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end readahead diff --git a/libc/arch-mips/syscalls/readlink.S b/libc/arch-mips/syscalls/readlink.S new file mode 100644 index 0000000..ccdd596 --- /dev/null +++ b/libc/arch-mips/syscalls/readlink.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl readlink + .align 4 + .ent readlink + +readlink: + .set noreorder + .cpload $t9 + li $v0, __NR_readlink + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end readlink diff --git a/libc/arch-mips/syscalls/readv.S b/libc/arch-mips/syscalls/readv.S new file mode 100644 index 0000000..0561c18 --- /dev/null +++ b/libc/arch-mips/syscalls/readv.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl readv + .align 4 + .ent readv + +readv: + .set noreorder + .cpload $t9 + li $v0, __NR_readv + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end readv diff --git a/libc/arch-mips/syscalls/recvfrom.S b/libc/arch-mips/syscalls/recvfrom.S new file mode 100644 index 0000000..cf3441d --- /dev/null +++ b/libc/arch-mips/syscalls/recvfrom.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl recvfrom + .align 4 + .ent recvfrom + +recvfrom: + .set noreorder + .cpload $t9 + li $v0, __NR_recvfrom + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end recvfrom diff --git a/libc/arch-mips/syscalls/recvmsg.S b/libc/arch-mips/syscalls/recvmsg.S new file mode 100644 index 0000000..5f22c49 --- /dev/null +++ b/libc/arch-mips/syscalls/recvmsg.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl recvmsg + .align 4 + .ent recvmsg + +recvmsg: + .set noreorder + .cpload $t9 + li $v0, __NR_recvmsg + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end recvmsg diff --git a/libc/arch-mips/syscalls/removexattr.S b/libc/arch-mips/syscalls/removexattr.S new file mode 100644 index 0000000..7d12b96 --- /dev/null +++ b/libc/arch-mips/syscalls/removexattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl removexattr + .align 4 + .ent removexattr + +removexattr: + .set noreorder + .cpload $t9 + li $v0, __NR_removexattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end removexattr diff --git a/libc/arch-mips/syscalls/rename.S b/libc/arch-mips/syscalls/rename.S new file mode 100644 index 0000000..950d579 --- /dev/null +++ b/libc/arch-mips/syscalls/rename.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl rename + .align 4 + .ent rename + +rename: + .set noreorder + .cpload $t9 + li $v0, __NR_rename + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end rename diff --git a/libc/arch-mips/syscalls/renameat.S b/libc/arch-mips/syscalls/renameat.S new file mode 100644 index 0000000..a2f3c4f --- /dev/null +++ b/libc/arch-mips/syscalls/renameat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl renameat + .align 4 + .ent renameat + +renameat: + .set noreorder + .cpload $t9 + li $v0, __NR_renameat + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end renameat diff --git a/libc/arch-mips/syscalls/rmdir.S b/libc/arch-mips/syscalls/rmdir.S new file mode 100644 index 0000000..2f77d0d --- /dev/null +++ b/libc/arch-mips/syscalls/rmdir.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl rmdir + .align 4 + .ent rmdir + +rmdir: + .set noreorder + .cpload $t9 + li $v0, __NR_rmdir + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end rmdir diff --git a/libc/arch-mips/syscalls/sched_get_priority_max.S b/libc/arch-mips/syscalls/sched_get_priority_max.S new file mode 100644 index 0000000..158b0fe --- /dev/null +++ b/libc/arch-mips/syscalls/sched_get_priority_max.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sched_get_priority_max + .align 4 + .ent sched_get_priority_max + +sched_get_priority_max: + .set noreorder + .cpload $t9 + li $v0, __NR_sched_get_priority_max + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sched_get_priority_max diff --git a/libc/arch-mips/syscalls/sched_get_priority_min.S b/libc/arch-mips/syscalls/sched_get_priority_min.S new file mode 100644 index 0000000..8c07d72 --- /dev/null +++ b/libc/arch-mips/syscalls/sched_get_priority_min.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sched_get_priority_min + .align 4 + .ent sched_get_priority_min + +sched_get_priority_min: + .set noreorder + .cpload $t9 + li $v0, __NR_sched_get_priority_min + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sched_get_priority_min diff --git a/libc/arch-mips/syscalls/sched_getparam.S b/libc/arch-mips/syscalls/sched_getparam.S new file mode 100644 index 0000000..6aba7cf --- /dev/null +++ b/libc/arch-mips/syscalls/sched_getparam.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sched_getparam + .align 4 + .ent sched_getparam + +sched_getparam: + .set noreorder + .cpload $t9 + li $v0, __NR_sched_getparam + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sched_getparam diff --git a/libc/arch-mips/syscalls/sched_getscheduler.S b/libc/arch-mips/syscalls/sched_getscheduler.S new file mode 100644 index 0000000..33d7f49 --- /dev/null +++ b/libc/arch-mips/syscalls/sched_getscheduler.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sched_getscheduler + .align 4 + .ent sched_getscheduler + +sched_getscheduler: + .set noreorder + .cpload $t9 + li $v0, __NR_sched_getscheduler + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sched_getscheduler diff --git a/libc/arch-mips/syscalls/sched_rr_get_interval.S b/libc/arch-mips/syscalls/sched_rr_get_interval.S new file mode 100644 index 0000000..e634ed0 --- /dev/null +++ b/libc/arch-mips/syscalls/sched_rr_get_interval.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sched_rr_get_interval + .align 4 + .ent sched_rr_get_interval + +sched_rr_get_interval: + .set noreorder + .cpload $t9 + li $v0, __NR_sched_rr_get_interval + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sched_rr_get_interval diff --git a/libc/arch-mips/syscalls/sched_setaffinity.S b/libc/arch-mips/syscalls/sched_setaffinity.S new file mode 100644 index 0000000..aefc240 --- /dev/null +++ b/libc/arch-mips/syscalls/sched_setaffinity.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sched_setaffinity + .align 4 + .ent sched_setaffinity + +sched_setaffinity: + .set noreorder + .cpload $t9 + li $v0, __NR_sched_setaffinity + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sched_setaffinity diff --git a/libc/arch-mips/syscalls/sched_setparam.S b/libc/arch-mips/syscalls/sched_setparam.S new file mode 100644 index 0000000..4d646bd --- /dev/null +++ b/libc/arch-mips/syscalls/sched_setparam.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sched_setparam + .align 4 + .ent sched_setparam + +sched_setparam: + .set noreorder + .cpload $t9 + li $v0, __NR_sched_setparam + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sched_setparam diff --git a/libc/arch-mips/syscalls/sched_setscheduler.S b/libc/arch-mips/syscalls/sched_setscheduler.S new file mode 100644 index 0000000..a79e39c --- /dev/null +++ b/libc/arch-mips/syscalls/sched_setscheduler.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sched_setscheduler + .align 4 + .ent sched_setscheduler + +sched_setscheduler: + .set noreorder + .cpload $t9 + li $v0, __NR_sched_setscheduler + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sched_setscheduler diff --git a/libc/arch-mips/syscalls/sched_yield.S b/libc/arch-mips/syscalls/sched_yield.S new file mode 100644 index 0000000..c7c99dc --- /dev/null +++ b/libc/arch-mips/syscalls/sched_yield.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sched_yield + .align 4 + .ent sched_yield + +sched_yield: + .set noreorder + .cpload $t9 + li $v0, __NR_sched_yield + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sched_yield diff --git a/libc/arch-mips/syscalls/select.S b/libc/arch-mips/syscalls/select.S new file mode 100644 index 0000000..ce4112f --- /dev/null +++ b/libc/arch-mips/syscalls/select.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl select + .align 4 + .ent select + +select: + .set noreorder + .cpload $t9 + li $v0, __NR__newselect + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end select diff --git a/libc/arch-mips/syscalls/sendfile.S b/libc/arch-mips/syscalls/sendfile.S new file mode 100644 index 0000000..c4c176e --- /dev/null +++ b/libc/arch-mips/syscalls/sendfile.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sendfile + .align 4 + .ent sendfile + +sendfile: + .set noreorder + .cpload $t9 + li $v0, __NR_sendfile + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sendfile diff --git a/libc/arch-mips/syscalls/sendmsg.S b/libc/arch-mips/syscalls/sendmsg.S new file mode 100644 index 0000000..1913f13 --- /dev/null +++ b/libc/arch-mips/syscalls/sendmsg.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sendmsg + .align 4 + .ent sendmsg + +sendmsg: + .set noreorder + .cpload $t9 + li $v0, __NR_sendmsg + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sendmsg diff --git a/libc/arch-mips/syscalls/sendto.S b/libc/arch-mips/syscalls/sendto.S new file mode 100644 index 0000000..f17743d --- /dev/null +++ b/libc/arch-mips/syscalls/sendto.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sendto + .align 4 + .ent sendto + +sendto: + .set noreorder + .cpload $t9 + li $v0, __NR_sendto + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sendto diff --git a/libc/arch-mips/syscalls/setgid.S b/libc/arch-mips/syscalls/setgid.S new file mode 100644 index 0000000..83dbfe5 --- /dev/null +++ b/libc/arch-mips/syscalls/setgid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setgid + .align 4 + .ent setgid + +setgid: + .set noreorder + .cpload $t9 + li $v0, __NR_setgid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setgid diff --git a/libc/arch-mips/syscalls/setgroups.S b/libc/arch-mips/syscalls/setgroups.S new file mode 100644 index 0000000..ef9327d --- /dev/null +++ b/libc/arch-mips/syscalls/setgroups.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setgroups + .align 4 + .ent setgroups + +setgroups: + .set noreorder + .cpload $t9 + li $v0, __NR_setgroups + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setgroups diff --git a/libc/arch-mips/syscalls/setitimer.S b/libc/arch-mips/syscalls/setitimer.S new file mode 100644 index 0000000..b042e07 --- /dev/null +++ b/libc/arch-mips/syscalls/setitimer.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setitimer + .align 4 + .ent setitimer + +setitimer: + .set noreorder + .cpload $t9 + li $v0, __NR_setitimer + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setitimer diff --git a/libc/arch-mips/syscalls/setpgid.S b/libc/arch-mips/syscalls/setpgid.S new file mode 100644 index 0000000..2ddc828 --- /dev/null +++ b/libc/arch-mips/syscalls/setpgid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setpgid + .align 4 + .ent setpgid + +setpgid: + .set noreorder + .cpload $t9 + li $v0, __NR_setpgid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setpgid diff --git a/libc/arch-mips/syscalls/setpriority.S b/libc/arch-mips/syscalls/setpriority.S new file mode 100644 index 0000000..02550e9 --- /dev/null +++ b/libc/arch-mips/syscalls/setpriority.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setpriority + .align 4 + .ent setpriority + +setpriority: + .set noreorder + .cpload $t9 + li $v0, __NR_setpriority + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setpriority diff --git a/libc/arch-mips/syscalls/setregid.S b/libc/arch-mips/syscalls/setregid.S new file mode 100644 index 0000000..619b3a1 --- /dev/null +++ b/libc/arch-mips/syscalls/setregid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setregid + .align 4 + .ent setregid + +setregid: + .set noreorder + .cpload $t9 + li $v0, __NR_setregid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setregid diff --git a/libc/arch-mips/syscalls/setresgid.S b/libc/arch-mips/syscalls/setresgid.S new file mode 100644 index 0000000..3ff94c7 --- /dev/null +++ b/libc/arch-mips/syscalls/setresgid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setresgid + .align 4 + .ent setresgid + +setresgid: + .set noreorder + .cpload $t9 + li $v0, __NR_setresgid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setresgid diff --git a/libc/arch-mips/syscalls/setrlimit.S b/libc/arch-mips/syscalls/setrlimit.S new file mode 100644 index 0000000..3ec37c5 --- /dev/null +++ b/libc/arch-mips/syscalls/setrlimit.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setrlimit + .align 4 + .ent setrlimit + +setrlimit: + .set noreorder + .cpload $t9 + li $v0, __NR_setrlimit + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setrlimit diff --git a/libc/arch-mips/syscalls/setsid.S b/libc/arch-mips/syscalls/setsid.S new file mode 100644 index 0000000..2a09663 --- /dev/null +++ b/libc/arch-mips/syscalls/setsid.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setsid + .align 4 + .ent setsid + +setsid: + .set noreorder + .cpload $t9 + li $v0, __NR_setsid + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setsid diff --git a/libc/arch-mips/syscalls/setsockopt.S b/libc/arch-mips/syscalls/setsockopt.S new file mode 100644 index 0000000..dc5e62f --- /dev/null +++ b/libc/arch-mips/syscalls/setsockopt.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setsockopt + .align 4 + .ent setsockopt + +setsockopt: + .set noreorder + .cpload $t9 + li $v0, __NR_setsockopt + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setsockopt diff --git a/libc/arch-mips/syscalls/settimeofday.S b/libc/arch-mips/syscalls/settimeofday.S new file mode 100644 index 0000000..f7c03ea --- /dev/null +++ b/libc/arch-mips/syscalls/settimeofday.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl settimeofday + .align 4 + .ent settimeofday + +settimeofday: + .set noreorder + .cpload $t9 + li $v0, __NR_settimeofday + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end settimeofday diff --git a/libc/arch-mips/syscalls/setxattr.S b/libc/arch-mips/syscalls/setxattr.S new file mode 100644 index 0000000..baa78a4 --- /dev/null +++ b/libc/arch-mips/syscalls/setxattr.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl setxattr + .align 4 + .ent setxattr + +setxattr: + .set noreorder + .cpload $t9 + li $v0, __NR_setxattr + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end setxattr diff --git a/libc/arch-mips/syscalls/shutdown.S b/libc/arch-mips/syscalls/shutdown.S new file mode 100644 index 0000000..b80d99b --- /dev/null +++ b/libc/arch-mips/syscalls/shutdown.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl shutdown + .align 4 + .ent shutdown + +shutdown: + .set noreorder + .cpload $t9 + li $v0, __NR_shutdown + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end shutdown diff --git a/libc/arch-mips/syscalls/sigaction.S b/libc/arch-mips/syscalls/sigaction.S new file mode 100644 index 0000000..700da54 --- /dev/null +++ b/libc/arch-mips/syscalls/sigaction.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sigaction + .align 4 + .ent sigaction + +sigaction: + .set noreorder + .cpload $t9 + li $v0, __NR_sigaction + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sigaction diff --git a/libc/arch-mips/syscalls/sigaltstack.S b/libc/arch-mips/syscalls/sigaltstack.S new file mode 100644 index 0000000..d2a4a9a --- /dev/null +++ b/libc/arch-mips/syscalls/sigaltstack.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sigaltstack + .align 4 + .ent sigaltstack + +sigaltstack: + .set noreorder + .cpload $t9 + li $v0, __NR_sigaltstack + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sigaltstack diff --git a/libc/arch-mips/syscalls/sigpending.S b/libc/arch-mips/syscalls/sigpending.S new file mode 100644 index 0000000..68df4db --- /dev/null +++ b/libc/arch-mips/syscalls/sigpending.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sigpending + .align 4 + .ent sigpending + +sigpending: + .set noreorder + .cpload $t9 + li $v0, __NR_sigpending + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sigpending diff --git a/libc/arch-mips/syscalls/sigprocmask.S b/libc/arch-mips/syscalls/sigprocmask.S new file mode 100644 index 0000000..17c01cb --- /dev/null +++ b/libc/arch-mips/syscalls/sigprocmask.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sigprocmask + .align 4 + .ent sigprocmask + +sigprocmask: + .set noreorder + .cpload $t9 + li $v0, __NR_sigprocmask + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sigprocmask diff --git a/libc/arch-mips/syscalls/socket.S b/libc/arch-mips/syscalls/socket.S new file mode 100644 index 0000000..e7d43f9 --- /dev/null +++ b/libc/arch-mips/syscalls/socket.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl socket + .align 4 + .ent socket + +socket: + .set noreorder + .cpload $t9 + li $v0, __NR_socket + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end socket diff --git a/libc/arch-mips/syscalls/socketpair.S b/libc/arch-mips/syscalls/socketpair.S new file mode 100644 index 0000000..97c67af --- /dev/null +++ b/libc/arch-mips/syscalls/socketpair.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl socketpair + .align 4 + .ent socketpair + +socketpair: + .set noreorder + .cpload $t9 + li $v0, __NR_socketpair + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end socketpair diff --git a/libc/arch-mips/syscalls/stat.S b/libc/arch-mips/syscalls/stat.S new file mode 100644 index 0000000..aec910d --- /dev/null +++ b/libc/arch-mips/syscalls/stat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl stat + .align 4 + .ent stat + +stat: + .set noreorder + .cpload $t9 + li $v0, __NR_stat64 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end stat diff --git a/libc/arch-mips/syscalls/symlink.S b/libc/arch-mips/syscalls/symlink.S new file mode 100644 index 0000000..f81c6dd --- /dev/null +++ b/libc/arch-mips/syscalls/symlink.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl symlink + .align 4 + .ent symlink + +symlink: + .set noreorder + .cpload $t9 + li $v0, __NR_symlink + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end symlink diff --git a/libc/arch-mips/syscalls/sync.S b/libc/arch-mips/syscalls/sync.S new file mode 100644 index 0000000..a122873 --- /dev/null +++ b/libc/arch-mips/syscalls/sync.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sync + .align 4 + .ent sync + +sync: + .set noreorder + .cpload $t9 + li $v0, __NR_sync + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sync diff --git a/libc/arch-mips/syscalls/syscall.S b/libc/arch-mips/syscalls/syscall.S new file mode 100644 index 0000000..2192bd5 --- /dev/null +++ b/libc/arch-mips/syscalls/syscall.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl syscall + .align 4 + .ent syscall + +syscall: + .set noreorder + .cpload $t9 + li $v0, __NR_syscall + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end syscall diff --git a/libc/arch-mips/syscalls/sysinfo.S b/libc/arch-mips/syscalls/sysinfo.S new file mode 100644 index 0000000..4577af9 --- /dev/null +++ b/libc/arch-mips/syscalls/sysinfo.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl sysinfo + .align 4 + .ent sysinfo + +sysinfo: + .set noreorder + .cpload $t9 + li $v0, __NR_sysinfo + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end sysinfo diff --git a/libc/arch-mips/syscalls/tgkill.S b/libc/arch-mips/syscalls/tgkill.S new file mode 100644 index 0000000..57b3a85 --- /dev/null +++ b/libc/arch-mips/syscalls/tgkill.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl tgkill + .align 4 + .ent tgkill + +tgkill: + .set noreorder + .cpload $t9 + li $v0, __NR_tgkill + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end tgkill diff --git a/libc/arch-mips/syscalls/times.S b/libc/arch-mips/syscalls/times.S new file mode 100644 index 0000000..3e8950d --- /dev/null +++ b/libc/arch-mips/syscalls/times.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl times + .align 4 + .ent times + +times: + .set noreorder + .cpload $t9 + li $v0, __NR_times + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end times diff --git a/libc/arch-mips/syscalls/tkill.S b/libc/arch-mips/syscalls/tkill.S new file mode 100644 index 0000000..3037baa --- /dev/null +++ b/libc/arch-mips/syscalls/tkill.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl tkill + .align 4 + .ent tkill + +tkill: + .set noreorder + .cpload $t9 + li $v0, __NR_tkill + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end tkill diff --git a/libc/arch-mips/syscalls/truncate.S b/libc/arch-mips/syscalls/truncate.S new file mode 100644 index 0000000..4a8f12c --- /dev/null +++ b/libc/arch-mips/syscalls/truncate.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl truncate + .align 4 + .ent truncate + +truncate: + .set noreorder + .cpload $t9 + li $v0, __NR_truncate + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end truncate diff --git a/libc/arch-mips/syscalls/umask.S b/libc/arch-mips/syscalls/umask.S new file mode 100644 index 0000000..eee911e --- /dev/null +++ b/libc/arch-mips/syscalls/umask.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl umask + .align 4 + .ent umask + +umask: + .set noreorder + .cpload $t9 + li $v0, __NR_umask + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end umask diff --git a/libc/arch-mips/syscalls/umount2.S b/libc/arch-mips/syscalls/umount2.S new file mode 100644 index 0000000..c6d9df6 --- /dev/null +++ b/libc/arch-mips/syscalls/umount2.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl umount2 + .align 4 + .ent umount2 + +umount2: + .set noreorder + .cpload $t9 + li $v0, __NR_umount2 + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end umount2 diff --git a/libc/arch-mips/syscalls/uname.S b/libc/arch-mips/syscalls/uname.S new file mode 100644 index 0000000..7e4f780 --- /dev/null +++ b/libc/arch-mips/syscalls/uname.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl uname + .align 4 + .ent uname + +uname: + .set noreorder + .cpload $t9 + li $v0, __NR_uname + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end uname diff --git a/libc/arch-mips/syscalls/unlink.S b/libc/arch-mips/syscalls/unlink.S new file mode 100644 index 0000000..fd8dad9 --- /dev/null +++ b/libc/arch-mips/syscalls/unlink.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl unlink + .align 4 + .ent unlink + +unlink: + .set noreorder + .cpload $t9 + li $v0, __NR_unlink + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end unlink diff --git a/libc/arch-mips/syscalls/unlinkat.S b/libc/arch-mips/syscalls/unlinkat.S new file mode 100644 index 0000000..793ab5e --- /dev/null +++ b/libc/arch-mips/syscalls/unlinkat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl unlinkat + .align 4 + .ent unlinkat + +unlinkat: + .set noreorder + .cpload $t9 + li $v0, __NR_unlinkat + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end unlinkat diff --git a/libc/arch-mips/syscalls/unshare.S b/libc/arch-mips/syscalls/unshare.S new file mode 100644 index 0000000..11af354 --- /dev/null +++ b/libc/arch-mips/syscalls/unshare.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl unshare + .align 4 + .ent unshare + +unshare: + .set noreorder + .cpload $t9 + li $v0, __NR_unshare + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end unshare diff --git a/libc/arch-mips/syscalls/utimensat.S b/libc/arch-mips/syscalls/utimensat.S new file mode 100644 index 0000000..435c49e --- /dev/null +++ b/libc/arch-mips/syscalls/utimensat.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl utimensat + .align 4 + .ent utimensat + +utimensat: + .set noreorder + .cpload $t9 + li $v0, __NR_utimensat + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end utimensat diff --git a/libc/arch-mips/syscalls/utimes.S b/libc/arch-mips/syscalls/utimes.S new file mode 100644 index 0000000..8ce1e44 --- /dev/null +++ b/libc/arch-mips/syscalls/utimes.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl utimes + .align 4 + .ent utimes + +utimes: + .set noreorder + .cpload $t9 + li $v0, __NR_utimes + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end utimes diff --git a/libc/arch-mips/syscalls/write.S b/libc/arch-mips/syscalls/write.S new file mode 100644 index 0000000..a772ace --- /dev/null +++ b/libc/arch-mips/syscalls/write.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl write + .align 4 + .ent write + +write: + .set noreorder + .cpload $t9 + li $v0, __NR_write + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end write diff --git a/libc/arch-mips/syscalls/writev.S b/libc/arch-mips/syscalls/writev.S new file mode 100644 index 0000000..bdacb42 --- /dev/null +++ b/libc/arch-mips/syscalls/writev.S @@ -0,0 +1,22 @@ +/* autogenerated by gensyscalls.py */ +#include <sys/linux-syscalls.h> + .text + .globl writev + .align 4 + .ent writev + +writev: + .set noreorder + .cpload $t9 + li $v0, __NR_writev + syscall + bnez $a3, 1f + move $a0, $v0 + j $ra + nop +1: + la $t9,__set_errno + j $t9 + nop + .set reorder + .end writev |