[Midnightbsd-cvs] src [10576] trunk/lib/libc/mips: tag

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Jun 7 22:29:48 EDT 2018


Revision: 10576
          http://svnweb.midnightbsd.org/src/?rev=10576
Author:   laffer1
Date:     2018-06-07 22:29:48 -0400 (Thu, 07 Jun 2018)
Log Message:
-----------
tag

Added Paths:
-----------
    trunk/lib/libc/mips/
    trunk/lib/libc/mips/Makefile.inc
    trunk/lib/libc/mips/SYS.h
    trunk/lib/libc/mips/Symbol.map
    trunk/lib/libc/mips/_fpmath.h
    trunk/lib/libc/mips/arith.h
    trunk/lib/libc/mips/gd_qnan.h
    trunk/lib/libc/mips/gdtoa/
    trunk/lib/libc/mips/gdtoa/Makefile.inc
    trunk/lib/libc/mips/gdtoa/arith.h
    trunk/lib/libc/mips/gen/
    trunk/lib/libc/mips/gen/Makefile.inc
    trunk/lib/libc/mips/gen/_ctx_start.S
    trunk/lib/libc/mips/gen/_set_tp.c
    trunk/lib/libc/mips/gen/_setjmp.S
    trunk/lib/libc/mips/gen/fabs.S
    trunk/lib/libc/mips/gen/fabs.c
    trunk/lib/libc/mips/gen/flt_rounds.c
    trunk/lib/libc/mips/gen/getcontextx.c
    trunk/lib/libc/mips/gen/hardfloat/
    trunk/lib/libc/mips/gen/hardfloat/fpgetmask.c
    trunk/lib/libc/mips/gen/hardfloat/fpgetround.c
    trunk/lib/libc/mips/gen/hardfloat/fpgetsticky.c
    trunk/lib/libc/mips/gen/hardfloat/fpsetmask.c
    trunk/lib/libc/mips/gen/hardfloat/fpsetround.c
    trunk/lib/libc/mips/gen/hardfloat/fpsetsticky.c
    trunk/lib/libc/mips/gen/infinity.c
    trunk/lib/libc/mips/gen/ldexp.S
    trunk/lib/libc/mips/gen/longjmp.c
    trunk/lib/libc/mips/gen/makecontext.c
    trunk/lib/libc/mips/gen/setjmp.S
    trunk/lib/libc/mips/gen/signalcontext.c
    trunk/lib/libc/mips/gen/sigsetjmp.S
    trunk/lib/libc/mips/net/
    trunk/lib/libc/mips/net/Makefile.inc
    trunk/lib/libc/mips/net/htonl.S
    trunk/lib/libc/mips/net/htons.S
    trunk/lib/libc/mips/net/ntohl.S
    trunk/lib/libc/mips/net/ntohs.S
    trunk/lib/libc/mips/softfloat/
    trunk/lib/libc/mips/softfloat/milieu.h
    trunk/lib/libc/mips/softfloat/mips-gcc.h
    trunk/lib/libc/mips/softfloat/softfloat.h
    trunk/lib/libc/mips/string/
    trunk/lib/libc/mips/string/Makefile.inc
    trunk/lib/libc/mips/string/bcmp.S
    trunk/lib/libc/mips/string/bcopy.S
    trunk/lib/libc/mips/string/bzero.S
    trunk/lib/libc/mips/string/ffs.S
    trunk/lib/libc/mips/string/memcpy.S
    trunk/lib/libc/mips/string/memmove.S
    trunk/lib/libc/mips/string/strchr.S
    trunk/lib/libc/mips/string/strcmp.S
    trunk/lib/libc/mips/string/strlen.S
    trunk/lib/libc/mips/string/strrchr.S
    trunk/lib/libc/mips/sys/
    trunk/lib/libc/mips/sys/Makefile.inc
    trunk/lib/libc/mips/sys/Ovfork.S
    trunk/lib/libc/mips/sys/__vdso_gettc.c
    trunk/lib/libc/mips/sys/brk.S
    trunk/lib/libc/mips/sys/cerror.S
    trunk/lib/libc/mips/sys/exect.S
    trunk/lib/libc/mips/sys/fork.S
    trunk/lib/libc/mips/sys/pipe.S
    trunk/lib/libc/mips/sys/sbrk.S
    trunk/lib/libc/mips/sys/shmat.S
    trunk/lib/libc/mips/sys/syscall.S

Added: trunk/lib/libc/mips/Makefile.inc
===================================================================
--- trunk/lib/libc/mips/Makefile.inc	                        (rev 0)
+++ trunk/lib/libc/mips/Makefile.inc	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,8 @@
+#	$NetBSD: Makefile.inc,v 1.7 2005/09/17 11:49:39 tsutsui Exp $
+# $FreeBSD: stable/10/lib/libc/mips/Makefile.inc 209233 2010-06-16 14:13:36Z jchandra $
+# $MidnightBSD$
+
+CFLAGS+=-DSOFTFLOAT
+
+MDSRCS+= machdep_ldisd.c
+SYM_MAPS+= ${.CURDIR}/mips/Symbol.map


Property changes on: trunk/lib/libc/mips/Makefile.inc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/SYS.h
===================================================================
--- trunk/lib/libc/mips/SYS.h	                        (rev 0)
+++ trunk/lib/libc/mips/SYS.h	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,152 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: SYS.h,v 1.19 2009/12/14 01:07:41 matt Exp $ */
+/* $FreeBSD: stable/10/lib/libc/mips/SYS.h 295020 2016-01-28 22:57:09Z brooks $ */
+
+/*-
+ * Copyright (c) 1996 Jonathan Stone
+ * 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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by Jonathan Stone for
+ *      the NetBSD Project.
+ * 4. The name of the author may not 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.
+ */
+
+/*-
+ * Copyright (c) 1991, 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.
+ *
+ *	from: @(#)SYS.h	8.1 (Berkeley) 6/4/93
+ */
+
+#include <sys/syscall.h>
+
+#include <machine/asm.h>
+
+/*
+ * If compiling for shared libs, Emit sysV ABI PIC segment pseudo-ops.
+ *
+ * i)  Emit .abicalls before .LEAF entrypoint, and .cpload/.cprestore after.
+ * ii) Do interprocedure jumps indirectly via t9, with the side-effect of
+ *     preserving the callee's entry address in t9.
+ */
+#ifdef __ABICALLS__
+	.abicalls
+# if defined(__mips_o32) || defined(__mips_o64)
+#  define PIC_PROLOGUE(x)	SETUP_GP
+#  define PIC_TAILCALL(l)	PTR_LA t9, _C_LABEL(l); jr t9
+#  define PIC_RETURN()		j ra
+# else
+#  define PIC_PROLOGUE(x)	SETUP_GP64(t3, x)
+#  define PIC_TAILCALL(l)	PTR_LA t9, _C_LABEL(l); RESTORE_GP64; jr t9
+#  define PIC_RETURN()		RESTORE_GP64; j ra
+# endif
+#else
+# define PIC_PROLOGUE(x)
+# define PIC_TAILCALL(l)	j  _C_LABEL(l)
+# define PIC_RETURN()		j ra
+#endif /* __ABICALLS__ */
+
+# define SYSTRAP(x)	li v0,SYS_ ## x; syscall;
+
+/*
+ * Do a syscall that cannot fail (sync, get{p,u,g,eu,eg)id)
+ */
+#define RSYSCALL_NOERROR(x)						\
+LEAF(__sys_ ## x);							\
+	.weak _C_LABEL(x);						\
+	_C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x));			\
+	.weak _C_LABEL(__CONCAT(_,x));					\
+	_C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x));		\
+	SYSTRAP(x);							\
+	j ra;								\
+END(__sys_ ## x)
+
+/*
+ * Do a normal syscall.
+ */
+#define RSYSCALL(x)							\
+LEAF(__sys_ ## x);							\
+	.weak _C_LABEL(x);						\
+	_C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x));			\
+	.weak _C_LABEL(__CONCAT(_,x));					\
+	_C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x));		\
+	PIC_PROLOGUE(__sys_ ## x);					\
+	SYSTRAP(x);							\
+	bne a3,zero,err;						\
+	PIC_RETURN();							\
+err:									\
+	PIC_TAILCALL(__cerror);						\
+END(__sys_ ## x)
+
+/*
+ * Do a renamed or pseudo syscall (e.g., _exit()), where the entrypoint
+ * and syscall name are not the same.
+ */
+#define PSEUDO_NOERROR(x)						\
+LEAF(__sys_ ## x);							\
+	.weak _C_LABEL(__CONCAT(_,x));					\
+	_C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x));		\
+	SYSTRAP(x);							\
+	j ra;								\
+END(__sys_ ## x)
+
+#define PSEUDO(x)							\
+LEAF(__sys_ ## x);							\
+	.weak _C_LABEL(__CONCAT(_,x));					\
+	_C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x));		\
+	PIC_PROLOGUE(__sys_ ## x);					\
+	SYSTRAP(x);							\
+	bne a3,zero,err;						\
+	PIC_RETURN();							\
+err:									\
+	PIC_TAILCALL(__cerror);						\
+END(__sys_ ## x)


Property changes on: trunk/lib/libc/mips/SYS.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/Symbol.map
===================================================================
--- trunk/lib/libc/mips/Symbol.map	                        (rev 0)
+++ trunk/lib/libc/mips/Symbol.map	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,77 @@
+/* $MidnightBSD$
+ * $FreeBSD: stable/10/lib/libc/mips/Symbol.map 226606 2011-10-21 06:40:36Z das $
+ */
+
+/*
+ * This only needs to contain symbols that are not listed in
+ * symbol maps from other parts of libc (i.e., not found in
+ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...).
+ */
+FBSD_1.0 {
+	/* PSEUDO syscalls */
+	_exit;
+
+	_setjmp;
+	_longjmp;
+	alloca;
+	fabs;
+	__infinity;
+	__nan;
+	makecontext;
+	setjmp;
+	longjmp;
+	sigsetjmp;
+	siglongjmp;
+	htonl;
+	htons;
+	ntohl;
+	ntohs;
+	vfork;
+	brk;
+	cerror;		/* XXX - Should this be .cerror (see sys/cerror.S)? */
+	sbrk;
+};
+
+FBSDprivate_1.0 {
+	/* PSEUDO syscalls */
+	__sys_getlogin;
+	_getlogin;
+	__sys_exit;
+
+	_set_tp;
+	___longjmp;
+	__umodsi3;
+	__modsi3;
+	__udivsi3;
+	__divsi3;
+	__makecontext;
+	__longjmp;
+	signalcontext;
+	_signalcontext;
+	__siglongjmp;
+	__sys_vfork;
+	_vfork;
+	_end;
+	__curbrk;
+	minbrk;
+	_brk;
+	_sbrk;
+
+	/* softfloat */
+	__addsf3;
+	__adddf3;
+	__subsf3;
+	__subdf3;
+	__mulsf3;
+	__muldf3;
+	__divsf3;
+	__divdf3;
+	__floatsisf;
+	__floatsidf;
+	__fixsfsi;
+	__fixdfsi;
+	__fixunssfsi;
+	__fixunsdfsi;
+	__extendsfdf2;
+	__truncdfsf2;
+};


Property changes on: trunk/lib/libc/mips/Symbol.map
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: trunk/lib/libc/mips/_fpmath.h
===================================================================
--- trunk/lib/libc/mips/_fpmath.h	                        (rev 0)
+++ trunk/lib/libc/mips/_fpmath.h	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,57 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright (c) 2002, 2003 David Schultz <das at FreeBSD.ORG>
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 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.
+ *
+ * $FreeBSD: stable/10/lib/libc/mips/_fpmath.h 178580 2008-04-26 12:08:02Z imp $
+ */
+
+union IEEEl2bits {
+	long double	e;
+	struct {
+#ifndef __MIPSEB__
+		unsigned int	manl	:32;
+		unsigned int	manh	:20;
+		unsigned int	exp	:11;
+		unsigned int	sign	:1;
+#else
+		unsigned int		sign	:1;
+		unsigned int		exp	:11;
+		unsigned int		manh	:20;
+		unsigned int		manl	:32;
+#endif
+	} bits;
+};
+
+#define	LDBL_NBIT	0
+#define	mask_nbit_l(u)	((void)0)
+#define	LDBL_IMPLICIT_NBIT
+
+#define	LDBL_MANH_SIZE	20
+#define	LDBL_MANL_SIZE	32
+
+#define	LDBL_TO_ARRAY32(u, a) do {			\
+	(a)[0] = (uint32_t)(u).bits.manl;		\
+	(a)[1] = (uint32_t)(u).bits.manh;		\
+} while(0)


Property changes on: trunk/lib/libc/mips/_fpmath.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/arith.h
===================================================================
--- trunk/lib/libc/mips/arith.h	                        (rev 0)
+++ trunk/lib/libc/mips/arith.h	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,30 @@
+/* $MidnightBSD$ */
+/*
+ * MD header for contrib/gdtoa
+ *
+ * $FreeBSD: stable/10/lib/libc/mips/arith.h 178580 2008-04-26 12:08:02Z imp $
+ */
+
+/*
+ * NOTE: The definitions in this file must be correct or strtod(3) and
+ * floating point formats in printf(3) will break!  The file can be
+ * generated by running contrib/gdtoa/arithchk.c on the target
+ * architecture.  See contrib/gdtoa/gdtoaimp.h for details.
+ */
+#include <machine/endian.h>
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define IEEE_MC68k
+#define Arith_Kind_ASL 2
+#define Double_Align
+#else
+/* TODO: Generate these values on a LE machine */
+/* Current values were stolen from ia64 except the
+ * Xpointer define.
+ */
+#define IEEE_8087
+#define Arith_Kind_ASL 1
+#define Long int
+#define Intcast (int)(long)
+#define Double_Align
+#endif


Property changes on: trunk/lib/libc/mips/arith.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gd_qnan.h
===================================================================
--- trunk/lib/libc/mips/gd_qnan.h	                        (rev 0)
+++ trunk/lib/libc/mips/gd_qnan.h	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,49 @@
+/* $MidnightBSD$ */
+/*
+ * MD header for contrib/gdtoa
+ *
+ * This file can be generated by compiling and running contrib/gdtoa/qnan.c
+ * on the target architecture after arith.h has been generated.
+ *
+ * $FreeBSD: stable/10/lib/libc/mips/gd_qnan.h 178580 2008-04-26 12:08:02Z imp $
+ */
+
+
+#include <machine/endian.h>
+
+#if BYTE_ORDER == BIG_ENDIAN
+/* These values were gained on a running
+ * Octeon in Big Endian order. They were gotten
+ * by running ./qnan after arithchk was ran and
+ * got us the proper values for arith.h.
+ */
+#define f_QNAN 0x7f900000
+#define d_QNAN0 0x7ff80000
+#define d_QNAN1 0x0
+#define ld_QNAN0 0x7ff80000
+#define ld_QNAN1 0x0
+#define ld_QNAN2 0x0
+#define ld_QNAN3 0x0
+#define ldus_QNAN0 0x7ff8
+#define ldus_QNAN1 0x0
+#define ldus_QNAN2 0x0
+#define ldus_QNAN3 0x0
+#define ldus_QNAN4 0x0
+#else
+/* FIX FIX, need to run this on a Little Endian
+ * machine and get the proper values, these here
+ * were stolen fromn i386/gd_qnan.h
+ */
+#define f_QNAN 0x7fc00000
+#define d_QNAN0 0x0
+#define d_QNAN1 0x7ff80000
+#define ld_QNAN0 0x0
+#define ld_QNAN1 0xc0000000
+#define ld_QNAN2 0x7fff
+#define ld_QNAN3 0x0
+#define ldus_QNAN0 0x0
+#define ldus_QNAN1 0x0
+#define ldus_QNAN2 0x0
+#define ldus_QNAN3 0xc000
+#define ldus_QNAN4 0x7fff
+#endif


Property changes on: trunk/lib/libc/mips/gd_qnan.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gdtoa/Makefile.inc
===================================================================
--- trunk/lib/libc/mips/gdtoa/Makefile.inc	                        (rev 0)
+++ trunk/lib/libc/mips/gdtoa/Makefile.inc	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,5 @@
+#	$NetBSD: Makefile.inc,v 1.1 2006/03/15 17:35:18 kleink Exp $
+# $FreeBSD: stable/10/lib/libc/mips/gdtoa/Makefile.inc 178580 2008-04-26 12:08:02Z imp $
+# $MidnightBSD$
+
+SRCS+=	strtof.c


Property changes on: trunk/lib/libc/mips/gdtoa/Makefile.inc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gdtoa/arith.h
===================================================================
--- trunk/lib/libc/mips/gdtoa/arith.h	                        (rev 0)
+++ trunk/lib/libc/mips/gdtoa/arith.h	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,11 @@
+/* $MidnightBSD$ */
+/* $NetBSD: arith.h,v 1.1 2006/01/25 15:33:28 kleink Exp $ */
+/* $FreeBSD: stable/10/lib/libc/mips/gdtoa/arith.h 178580 2008-04-26 12:08:02Z imp $ */
+
+#include <machine/endian.h>
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define IEEE_BIG_ENDIAN
+#else
+#define IEEE_LITTLE_ENDIAN
+#endif


Property changes on: trunk/lib/libc/mips/gdtoa/arith.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/Makefile.inc
===================================================================
--- trunk/lib/libc/mips/gen/Makefile.inc	                        (rev 0)
+++ trunk/lib/libc/mips/gen/Makefile.inc	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,11 @@
+#	$NetBSD: Makefile.inc,v 1.27 2005/10/07 17:16:40 tsutsui Exp $
+# $FreeBSD: stable/10/lib/libc/mips/gen/Makefile.inc 230429 2012-01-21 18:00:28Z kib $
+# $MidnightBSD$
+
+SRCS+=	infinity.c fabs.c ldexp.c
+
+# SRCS+=	flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
+#	fpsetround.c fpsetsticky.c
+
+SRCS+=	_ctx_start.S _set_tp.c _setjmp.S getcontextx.c makecontext.c \
+	setjmp.S signalcontext.c sigsetjmp.S


Property changes on: trunk/lib/libc/mips/gen/Makefile.inc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/_ctx_start.S
===================================================================
--- trunk/lib/libc/mips/gen/_ctx_start.S	                        (rev 0)
+++ trunk/lib/libc/mips/gen/_ctx_start.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,42 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright (c) 2010 Juli Mallett.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/_ctx_start.S 209233 2010-06-16 14:13:36Z jchandra $");
+
+/*
+ * XXX gp?
+ */
+ENTRY(_ctx_start)
+	jalr	t9
+
+	move	a0, s0
+	PTR_LA	t9, _ctx_done
+	jalr	t9
+
+	break	0
+END(_ctx_start)


Property changes on: trunk/lib/libc/mips/gen/_ctx_start.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/_set_tp.c
===================================================================
--- trunk/lib/libc/mips/gen/_set_tp.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/_set_tp.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,40 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright (c) 2004 Doug Rabson
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 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.
+ *
+ *	$FreeBSD: stable/10/lib/libc/mips/gen/_set_tp.c 232581 2012-03-06 03:30:09Z gonzo $
+ */
+
+#include <string.h>
+#include <stdint.h>
+
+#include <machine/sysarch.h>
+
+void
+_set_tp(void *tp)
+{
+
+	sysarch(MIPS_SET_TLS, tp);
+}


Property changes on: trunk/lib/libc/mips/gen/_set_tp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/_setjmp.S
===================================================================
--- trunk/lib/libc/mips/gen/_setjmp.S	                        (rev 0)
+++ trunk/lib/libc/mips/gen/_setjmp.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,202 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: _setjmp.S,v 1.20.34.5 2010/02/03 23:46:47 matt Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/_setjmp.S 277537 2015-01-22 21:17:58Z brooks $");
+#include <machine/regnum.h>
+
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+	RCSID("from: @(#)_setjmp.s	8.1 (Berkeley) 6/4/93")
+#else
+	RCSID("$NetBSD: _setjmp.S,v 1.20.34.5 2010/02/03 23:46:47 matt Exp $")
+#endif
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * C library -- _setjmp, _longjmp
+ *
+ *	_longjmp(a,v)
+ * will generate a "return(v)" from
+ * the last call to
+ *	_setjmp(a)
+ * by restoring registers from the stack,
+ * The previous signal state is NOT restored.
+ */
+
+	.set	noreorder
+
+LEAF(_setjmp)
+	REG_PROLOGUE
+	REG_LI	v0, _JB_MAGIC__SETJMP		# sigcontext magic number
+	REG_S	v0, (_JB_MAGIC  * SZREG)(a0)
+	REG_S	ra, (_JB_REG_RA * SZREG)(a0)
+	/*
+	 * From "MIPSpro N32 ABI Handbook", Table 2-1:
+	 * Registers s0..s7 are callee-saved.
+	 * The sp register is callee-saved.
+	 * The fp (or s8) register is callee-saved.
+	 * The gp register is callee-saved (for n32/n64).
+	 */
+	REG_S	s0, (_JB_REG_S0 * SZREG)(a0)
+	REG_S	s1, (_JB_REG_S1 * SZREG)(a0)
+	REG_S	s2, (_JB_REG_S2 * SZREG)(a0)
+	REG_S	s3, (_JB_REG_S3 * SZREG)(a0)
+	REG_S	s4, (_JB_REG_S4 * SZREG)(a0)
+	REG_S	s5, (_JB_REG_S5 * SZREG)(a0)
+	REG_S	s6, (_JB_REG_S6 * SZREG)(a0)
+	REG_S	s7, (_JB_REG_S7 * SZREG)(a0)
+	REG_S	sp, (_JB_REG_SP * SZREG)(a0)
+	REG_S	s8, (_JB_REG_S8 * SZREG)(a0)
+#if defined(__mips_n32) || defined(__mips_n64)
+	REG_S	gp, (_JB_REG_GP * SZREG)(a0)	# newabi gp is callee-saved
+#endif
+	/*
+	 * From "MIPSpro N32 ABI Handbook", Table 2-1:
+	 * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
+	 * In N64, FP registers F24 .. F31 are callee-saved.
+	 * In O32, FP registers F20 .. F23 are callee-saved.
+	 */
+#ifndef SOFTFLOAT
+	cfc1	v0, $31				# too bad can't check if FP used
+#if defined(__mips_n64) || defined(__mips_n32)
+	FP_S	$f30, (_JB_FPREG_F30 * SZREG)(a0)
+	FP_S	$f28, (_JB_FPREG_F28 * SZREG)(a0)
+	FP_S	$f26, (_JB_FPREG_F26 * SZREG)(a0)
+	FP_S	$f24, (_JB_FPREG_F24 * SZREG)(a0)
+#endif
+#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
+	FP_S	$f22, (_JB_FPREG_F22 * SZREG)(a0)
+	FP_S	$f20, (_JB_FPREG_F20 * SZREG)(a0)
+#endif
+#if defined(__mips_o32) || defined(__mips_o64)
+	FP_S	$f21, (_JB_FPREG_F21 * SZREG)(a0)
+	FP_S	$f23, (_JB_FPREG_F23 * SZREG)(a0)
+#endif
+#if defined(__mips_n64)
+	FP_S	$f25, (_JB_FPREG_F25 * SZREG)(a0)
+	FP_S	$f27, (_JB_FPREG_F27 * SZREG)(a0)
+	FP_S	$f29, (_JB_FPREG_F29 * SZREG)(a0)
+	FP_S	$f31, (_JB_FPREG_F31 * SZREG)(a0)
+#endif
+	INT_S	v0, (_JB_FPREG_FCSR * SZREG)(a0)
+#endif /* ! SOFTFLOAT */
+	REG_EPILOGUE
+
+	j	ra
+	move	v0, zero
+END(_setjmp)
+
+LEAF(_longjmp)
+	PIC_PROLOGUE(_longjmp)
+	PTR_SUBU	sp, sp, CALLFRAME_SIZ
+	SAVE_GP(CALLFRAME_GP)
+
+	REG_PROLOGUE
+	REG_L		v0, (_JB_MAGIC  * SZREG)(a0)	# get magic number
+	REG_L		ra, (_JB_REG_RA * SZREG)(a0)
+	REG_LI		t0, _JB_MAGIC__SETJMP
+	bne		v0, t0, botch		# jump if error
+	PTR_ADDU	sp, sp, CALLFRAME_SIZ	# does not matter, sanity
+	/*
+	 * From "MIPSpro N32 ABI Handbook", Table 2-1:
+	 * Registers s0..s7 are callee-saved.
+	 * The sp register is callee-saved.
+	 * The fp (or s8) register is callee-saved.
+	 * The gp register is callee-saved (for n32/n64).
+	 */
+	REG_L		s0, (_JB_REG_S0 * SZREG)(a0)
+	REG_L		s1, (_JB_REG_S1 * SZREG)(a0)
+	REG_L		s2, (_JB_REG_S2 * SZREG)(a0)
+	REG_L		s3, (_JB_REG_S3 * SZREG)(a0)
+	REG_L		s4, (_JB_REG_S4 * SZREG)(a0)
+	REG_L		s5, (_JB_REG_S5 * SZREG)(a0)
+	REG_L		s6, (_JB_REG_S6 * SZREG)(a0)
+	REG_L		s7, (_JB_REG_S7 * SZREG)(a0)
+	REG_L		sp, (_JB_REG_SP * SZREG)(a0)
+	REG_L		s8, (_JB_REG_S8 * SZREG)(a0)
+#if defined(__mips_n32) || defined(__mips_n64)
+	REG_L		gp, (_JB_REG_GP * SZREG)(a0)
+#endif
+#ifndef SOFTFLOAT
+	# get fpu status
+	INT_L		v0, (_JB_FPREG_FCSR * SZREG)(a0)
+	ctc1		v0, $31
+	/*
+	 * From "MIPSpro N32 ABI Handbook", Table 2-1:
+	 * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
+	 * In N64, FP registers F24 .. F31 are callee-saved.
+	 * In O32, FP registers F20 .. F23 are callee-saved.
+	 */
+#if defined(__mips_n64) || defined(__mips_n32)
+	FP_L	$f30, (_JB_FPREG_F30 * SZREG)(a0)
+	FP_L	$f28, (_JB_FPREG_F28 * SZREG)(a0)
+	FP_L	$f26, (_JB_FPREG_F26 * SZREG)(a0)
+	FP_L	$f24, (_JB_FPREG_F24 * SZREG)(a0)
+#endif
+#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
+	FP_L	$f22, (_JB_FPREG_F22 * SZREG)(a0)
+	FP_L	$f20, (_JB_FPREG_F20 * SZREG)(a0)
+#endif
+#if defined(__mips_o32) || defined(__mips_o64)
+	FP_L	$f21, (_JB_FPREG_F21 * SZREG)(a0)
+	FP_L	$f23, (_JB_FPREG_F23 * SZREG)(a0)
+#endif
+#if defined(__mips_n64)
+	FP_L	$f25, (_JB_FPREG_F25 * SZREG)(a0)
+	FP_L	$f27, (_JB_FPREG_F27 * SZREG)(a0)
+	FP_L	$f29, (_JB_FPREG_F29 * SZREG)(a0)
+	FP_L	$f31, (_JB_FPREG_F31 * SZREG)(a0)
+#endif
+#endif	/* ! SOFTFLOAT */
+
+	REG_EPILOGUE
+	move	v0, a1			# get return value in 1st arg
+	j	ra
+	nop
+
+botch:
+	/*
+	 * We know we aren't returning so we don't care about restoring
+	 * our caller's GP.
+	 */
+	PTR_LA	t9, _C_LABEL(longjmperror)
+	jalr	t9
+	nop
+
+	PIC_TAILCALL(abort)
+END(_longjmp)


Property changes on: trunk/lib/libc/mips/gen/_setjmp.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/fabs.S
===================================================================
--- trunk/lib/libc/mips/gen/fabs.S	                        (rev 0)
+++ trunk/lib/libc/mips/gen/fabs.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,59 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: fabs.S,v 1.7 2003/08/07 16:42:15 agc Exp $	*/
+
+/*-
+ * Copyright (c) 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/fabs.S 178580 2008-04-26 12:08:02Z imp $");
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)fabs.s	8.1 (Berkeley) 2/16/94")
+	ASMSTR("$NetBSD: fabs.S,v 1.7 2003/08/07 16:42:15 agc Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+	.set	noreorder
+
+/*
+ * fabs(x)
+ *	double x;
+ *
+ * Return absolute value of x.
+ */
+LEAF(fabs)
+	j	ra
+	abs.d	$f0, $f12		# compute absolute value of x
+END(fabs)


Property changes on: trunk/lib/libc/mips/gen/fabs.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/fabs.c
===================================================================
--- trunk/lib/libc/mips/gen/fabs.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/fabs.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,47 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: fabs.c,v 1.2 2002/05/26 11:48:01 wiz Exp $	*/
+
+/*
+ * Copyright (c) 1996 Mark Brinicombe
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by Mark Brinicombe
+ * 4. 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 AUTHOR 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 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.
+ */
+
+/*
+ * fabs(x) returns the absolute value of x.
+ */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/fabs.c 178580 2008-04-26 12:08:02Z imp $");
+
+double
+fabs(double x)
+{
+	if (x < 0)
+		x = -x;
+	return(x);
+}


Property changes on: trunk/lib/libc/mips/gen/fabs.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/flt_rounds.c
===================================================================
--- trunk/lib/libc/mips/gen/flt_rounds.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/flt_rounds.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,31 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/flt_rounds.c 178580 2008-04-26 12:08:02Z imp $");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include <machine/float.h>
+
+static const int map[] = {
+	1,	/* round to nearest */
+	0,	/* round to zero */
+	2,	/* round to positive infinity */
+	3	/* round to negative infinity */
+};
+
+int
+__flt_rounds()
+{
+	int x;
+
+	__asm("cfc1 %0,$31" : "=r" (x));
+	return map[x & 0x03];
+}


Property changes on: trunk/lib/libc/mips/gen/flt_rounds.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/getcontextx.c
===================================================================
--- trunk/lib/libc/mips/gen/getcontextx.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/getcontextx.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,77 @@
+/* $MidnightBSD$ */
+/*
+ * Copyright (c) 2011 Konstantin Belousov <kib at FreeBSD.org>
+ * 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.
+ *
+ * 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/getcontextx.c 251047 2013-05-28 04:54:16Z kib $");
+
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <errno.h>
+#include <stdlib.h>
+
+int
+__getcontextx_size(void)
+{
+
+	return (sizeof(ucontext_t));
+}
+
+int
+__fillcontextx2(char *ctx)
+{
+
+	return (0);
+}
+
+int
+__fillcontextx(char *ctx)
+{
+	ucontext_t *ucp;
+
+	ucp = (ucontext_t *)ctx;
+	return (getcontext(ucp));
+}
+
+__weak_reference(__getcontextx, getcontextx);
+
+ucontext_t *
+__getcontextx(void)
+{
+	char *ctx;
+	int error;
+
+	ctx = malloc(__getcontextx_size());
+	if (ctx == NULL)
+		return (NULL);
+	if (__fillcontextx(ctx) == -1) {
+		error = errno;
+		free(ctx);
+		errno = error;
+		return (NULL);
+	}
+	return ((ucontext_t *)ctx);
+}


Property changes on: trunk/lib/libc/mips/gen/getcontextx.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/hardfloat/fpgetmask.c
===================================================================
--- trunk/lib/libc/mips/gen/hardfloat/fpgetmask.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/hardfloat/fpgetmask.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,30 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/hardfloat/fpgetmask.c 201856 2010-01-08 23:50:39Z imp $");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpgetmask,_fpgetmask)
+#endif
+
+fp_except_t
+fpgetmask()
+{
+	int x;
+
+	__asm("cfc1 %0,$31" : "=r" (x));
+	return (x >> 7) & 0x1f;
+}


Property changes on: trunk/lib/libc/mips/gen/hardfloat/fpgetmask.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/hardfloat/fpgetround.c
===================================================================
--- trunk/lib/libc/mips/gen/hardfloat/fpgetround.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/hardfloat/fpgetround.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,30 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/hardfloat/fpgetround.c 201856 2010-01-08 23:50:39Z imp $");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpgetround,_fpgetround)
+#endif
+
+fp_rnd_t
+fpgetround()
+{
+	int x;
+
+	__asm("cfc1 %0,$31" : "=r" (x));
+	return x & 0x03;
+}


Property changes on: trunk/lib/libc/mips/gen/hardfloat/fpgetround.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/hardfloat/fpgetsticky.c
===================================================================
--- trunk/lib/libc/mips/gen/hardfloat/fpgetsticky.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/hardfloat/fpgetsticky.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,30 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/hardfloat/fpgetsticky.c 201856 2010-01-08 23:50:39Z imp $");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpgetsticky,_fpgetsticky)
+#endif
+
+fp_except_t
+fpgetsticky()
+{
+	int x;
+
+	__asm("cfc1 %0,$31" : "=r" (x));
+	return (x >> 2) & 0x1f;
+}


Property changes on: trunk/lib/libc/mips/gen/hardfloat/fpgetsticky.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/hardfloat/fpsetmask.c
===================================================================
--- trunk/lib/libc/mips/gen/hardfloat/fpsetmask.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/hardfloat/fpsetmask.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,39 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/hardfloat/fpsetmask.c 201856 2010-01-08 23:50:39Z imp $");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpsetmask,_fpsetmask)
+#endif
+
+fp_except_t
+fpsetmask(mask)
+	fp_except_t mask;
+{
+	fp_except_t old;
+	fp_except_t new;
+
+	__asm("cfc1 %0,$31" : "=r" (old));
+
+	new = old;
+	new &= ~(0x1f << 7); 
+	new |= ((mask & 0x1f) << 7);
+
+	__asm("ctc1 %0,$31" : : "r" (new));
+
+	return (old >> 7) & 0x1f;
+}


Property changes on: trunk/lib/libc/mips/gen/hardfloat/fpsetmask.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/hardfloat/fpsetround.c
===================================================================
--- trunk/lib/libc/mips/gen/hardfloat/fpsetround.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/hardfloat/fpsetround.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,38 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/hardfloat/fpsetround.c 201856 2010-01-08 23:50:39Z imp $");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpsetround,_fpsetround)
+#endif
+
+fp_rnd_t
+fpsetround(fp_rnd_t rnd_dir)
+{
+	fp_rnd_t old;
+	fp_rnd_t new;
+
+	__asm("cfc1 %0,$31" : "=r" (old));
+
+	new = old;
+	new &= ~0x03;
+	new |= (rnd_dir & 0x03);
+
+	__asm("ctc1 %0,$31" : : "r" (new));
+
+	return old & 0x03;
+}


Property changes on: trunk/lib/libc/mips/gen/hardfloat/fpsetround.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/hardfloat/fpsetsticky.c
===================================================================
--- trunk/lib/libc/mips/gen/hardfloat/fpsetsticky.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/hardfloat/fpsetsticky.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,39 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/hardfloat/fpsetsticky.c 201856 2010-01-08 23:50:39Z imp $");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpsetsticky,_fpsetsticky)
+#endif
+
+fp_except
+fpsetsticky(sticky)
+	fp_except sticky;
+{
+	fp_except old;
+	fp_except new;
+
+	__asm("cfc1 %0,$31" : "=r" (old));
+
+	new = old;
+	new &= ~(0x1f << 2); 
+	new |= ((sticky & 0x1f) << 2);
+
+	__asm("ctc1 %0,$31" : : "r" (new));
+
+	return (old >> 2) & 0x1f;
+}


Property changes on: trunk/lib/libc/mips/gen/hardfloat/fpsetsticky.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/infinity.c
===================================================================
--- trunk/lib/libc/mips/gen/infinity.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/infinity.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,27 @@
+/* $MidnightBSD$ */
+/*
+ * infinity.c
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/infinity.c 178580 2008-04-26 12:08:02Z imp $");
+
+#include <math.h>
+
+/* bytes for +Infinity on a 387 */
+const union __infinity_un __infinity = { 
+#if BYTE_ORDER == BIG_ENDIAN
+	{ 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
+#else
+	{ 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
+#endif
+};
+
+/* bytes for NaN */
+const union __nan_un __nan = {
+#if BYTE_ORDER == BIG_ENDIAN
+	{0x7f, 0xa0, 0, 0}
+#else
+	{ 0, 0, 0xa0, 0x7f }
+#endif
+};


Property changes on: trunk/lib/libc/mips/gen/infinity.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/ldexp.S
===================================================================
--- trunk/lib/libc/mips/gen/ldexp.S	                        (rev 0)
+++ trunk/lib/libc/mips/gen/ldexp.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,220 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: ldexp.S,v 1.8 2003/08/07 16:42:15 agc Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/ldexp.S 178580 2008-04-26 12:08:02Z imp $");
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)ldexp.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: ldexp.S,v 1.8 2003/08/07 16:42:15 agc Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+#define DEXP_INF	0x7ff
+#define DEXP_BIAS	1023
+#define DEXP_MIN	-1022
+#define DEXP_MAX	1023
+#define DFRAC_BITS	52
+#define DIMPL_ONE	0x00100000
+#define DLEAD_ZEROS	31 - 20
+#define STICKYBIT	1
+#define GUARDBIT	0x80000000
+#define DSIGNAL_NAN	0x00040000
+#define DQUIET_NAN0	0x0007ffff
+#define DQUIET_NAN1	0xffffffff
+
+/*
+ * double ldexp(x, N)
+ *	double x; int N;
+ *
+ * Return x * (2**N), for integer values N.
+ */
+LEAF(ldexp)
+	mfc1	v1, $f13		# get MSW of x
+	mfc1	t3, $f12		# get LSW of x
+	sll	t1, v1, 1		# get x exponent
+	srl	t1, t1, 32 - 11
+	beq	t1, DEXP_INF, 9f	# is it a NAN or infinity?
+	beq	t1, zero, 1f		# zero or denormalized number?
+	addu	t1, t1, a2		# scale exponent
+	sll	v0, a2, 20		# position N for addition
+	bge	t1, DEXP_INF, 8f	# overflow?
+	addu	v0, v0, v1		# multiply by (2**N)
+	ble	t1, zero, 4f		# underflow?
+	mtc1	v0, $f1			# save MSW of result
+	mtc1	t3, $f0			# save LSW of result
+	j	ra
+1:
+	sll	t2, v1, 32 - 20		# get x fraction
+	srl	t2, t2, 32 - 20
+	srl	t0, v1, 31		# get x sign
+	bne	t2, zero, 1f
+	beq	t3, zero, 9f		# result is zero
+1:
+/*
+ * Find out how many leading zero bits are in t2,t3 and put in t9.
+ */
+	move	v0, t2
+	move	t9, zero
+	bne	t2, zero, 1f
+	move	v0, t3
+	addu	t9, 32
+1:
+	srl	ta0, v0, 16
+	bne	ta0, zero, 1f
+	addu	t9, 16
+	sll	v0, 16
+1:
+	srl	ta0, v0, 24
+	bne	ta0, zero, 1f
+	addu	t9, 8
+	sll	v0, 8
+1:
+	srl	ta0, v0, 28
+	bne	ta0, zero, 1f
+	addu	t9, 4
+	sll	v0, 4
+1:
+	srl	ta0, v0, 30
+	bne	ta0, zero, 1f
+	addu	t9, 2
+	sll	v0, 2
+1:
+	srl	ta0, v0, 31
+	bne	ta0, zero, 1f
+	addu	t9, 1
+/*
+ * Now shift t2,t3 the correct number of bits.
+ */
+1:
+	subu	t9, t9, DLEAD_ZEROS	# dont count normal leading zeros
+	li	t1, DEXP_MIN + DEXP_BIAS
+	subu	t1, t1, t9		# adjust exponent
+	addu	t1, t1, a2		# scale exponent
+	li	v0, 32
+	blt	t9, v0, 1f
+	subu	t9, t9, v0		# shift fraction left >= 32 bits
+	sll	t2, t3, t9
+	move	t3, zero
+	b	2f
+1:
+	subu	v0, v0, t9		# shift fraction left < 32 bits
+	sll	t2, t2, t9
+	srl	ta0, t3, v0
+	or	t2, t2, ta0
+	sll	t3, t3, t9
+2:
+	bge	t1, DEXP_INF, 8f	# overflow?
+	ble	t1, zero, 4f		# underflow?
+	sll	t2, t2, 32 - 20		# clear implied one bit
+	srl	t2, t2, 32 - 20
+3:
+	sll	t1, t1, 31 - 11		# reposition exponent
+	sll	t0, t0, 31		# reposition sign
+	or	t0, t0, t1		# put result back together
+	or	t0, t0, t2
+	mtc1	t0, $f1			# save MSW of result
+	mtc1	t3, $f0			# save LSW of result
+	j	ra
+4:
+	li	v0, 0x80000000
+	ble	t1, -52, 7f		# is result too small for denorm?
+	sll	t2, v1, 31 - 20		# clear exponent, extract fraction
+	or	t2, t2, v0		# set implied one bit
+	blt	t1, -30, 2f		# will all bits in t3 be shifted out?
+	srl	t2, t2, 31 - 20		# shift fraction back to normal position
+	subu	t1, t1, 1
+	sll	ta0, t2, t1		# shift right t2,t3 based on exponent
+	srl	t8, t3, t1		# save bits shifted out
+	negu	t1
+	srl	t3, t3, t1
+	or	t3, t3, ta0
+	srl	t2, t2, t1
+	bge	t8, zero, 1f		# does result need to be rounded?
+	addu	t3, t3, 1		# round result
+	sltu	ta0, t3, 1
+	sll	t8, t8, 1
+	addu	t2, t2, ta0
+	bne	t8, zero, 1f		# round result to nearest
+	and	t3, t3, ~1
+1:
+	mtc1	t3, $f0			# save denormalized result (LSW)
+	mtc1	t2, $f1			# save denormalized result (MSW)
+	bge	v1, zero, 1f		# should result be negative?
+	neg.d	$f0, $f0		# negate result
+1:
+	j	ra
+2:
+	mtc1	zero, $f1		# exponent and upper fraction
+	addu	t1, t1, 20		# compute amount to shift right by
+	sll	t8, t2, t1		# save bits shifted out
+	negu	t1
+	srl	t3, t2, t1
+	bge	t8, zero, 1f		# does result need to be rounded?
+	addu	t3, t3, 1		# round result
+	sltu	ta0, t3, 1
+	sll	t8, t8, 1
+	mtc1	ta0, $f1			# exponent and upper fraction
+	bne	t8, zero, 1f		# round result to nearest
+	and	t3, t3, ~1
+1:
+	mtc1	t3, $f0
+	bge	v1, zero, 1f		# is result negative?
+	neg.d	$f0, $f0		# negate result
+1:
+	j	ra
+7:
+	mtc1	zero, $f0		# result is zero
+	mtc1	zero, $f1
+	beq	t0, zero, 1f		# is result positive?
+	neg.d	$f0, $f0		# negate result
+1:
+	j	ra
+8:
+	li	t1, 0x7ff00000		# result is infinity (MSW)
+	mtc1	t1, $f1	
+	mtc1	zero, $f0		# result is infinity (LSW)
+	bge	v1, zero, 1f		# should result be negative infinity?
+	neg.d	$f0, $f0		# result is negative infinity
+1:
+	add.d	$f0, $f0		# cause overflow faults if enabled
+	j	ra
+9:
+	mov.d	$f0, $f12		# yes, result is just x
+	j	ra
+END(ldexp)


Property changes on: trunk/lib/libc/mips/gen/ldexp.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/longjmp.c
===================================================================
--- trunk/lib/libc/mips/gen/longjmp.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/longjmp.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,104 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: longjmp.c,v 1.1 2005/09/17 11:49:39 tsutsui Exp $	*/
+
+/*-
+ * Copyright (c) 2003 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christian Limpach and Matt Thomas.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/longjmp.c 251091 2013-05-29 01:54:10Z emaste $");
+#include "namespace.h"
+#include <sys/types.h>
+#include <ucontext.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <machine/regnum.h>
+
+void
+__longjmp14(jmp_buf env, int val)
+{
+	struct sigcontext *sc = (void *)env;
+	ucontext_t uc;
+
+	/* Ensure non-zero SP and sigcontext magic number is present */
+	if (sc->sc_regs[_R_SP] == 0 || sc->sc_regs[_R_ZERO] != 0xACEDBADE)
+		goto err;
+
+	/* Ensure non-zero return value */
+	if (val == 0)
+		val = 1;
+
+	/*
+	 * Set _UC_{SET,CLR}STACK according to SS_ONSTACK.
+	 *
+	 * Restore the signal mask with sigprocmask() instead of _UC_SIGMASK,
+	 * since libpthread may want to interpose on signal handling.
+	 */
+	uc.uc_flags = _UC_CPU | (sc->sc_onstack ? _UC_SETSTACK : _UC_CLRSTACK);
+
+	sigprocmask(SIG_SETMASK, &sc->sc_mask, NULL);
+
+	/* Clear uc_link */
+	uc.uc_link = 0;
+
+	/* Save return value in context */
+	uc.uc_mcontext.__gregs[_R_V0] = val;
+
+	/* Copy saved registers */
+	uc.uc_mcontext.__gregs[_REG_S0] = sc->sc_regs[_R_S0];
+	uc.uc_mcontext.__gregs[_REG_S1] = sc->sc_regs[_R_S1];
+	uc.uc_mcontext.__gregs[_REG_S2] = sc->sc_regs[_R_S2];
+	uc.uc_mcontext.__gregs[_REG_S3] = sc->sc_regs[_R_S3];
+	uc.uc_mcontext.__gregs[_REG_S4] = sc->sc_regs[_R_S4];
+	uc.uc_mcontext.__gregs[_REG_S5] = sc->sc_regs[_R_S5];
+	uc.uc_mcontext.__gregs[_REG_S6] = sc->sc_regs[_R_S6];
+	uc.uc_mcontext.__gregs[_REG_S7] = sc->sc_regs[_R_S7];
+	uc.uc_mcontext.__gregs[_REG_S8] = sc->sc_regs[_R_S8];
+	uc.uc_mcontext.__gregs[_REG_SP] = sc->sc_regs[_R_SP];
+	uc.uc_mcontext.__gregs[_REG_RA] = sc->sc_regs[_R_RA];
+	uc.uc_mcontext.__gregs[_REG_EPC] = sc->sc_pc;
+
+	/* Copy FP state */
+	if (sc->sc_fpused) {
+		/* FP saved regs are $f20 .. $f31 */
+		memcpy(&uc.uc_mcontext.__fpregs.__fp_r.__fp_regs[20],
+		    &sc->sc_fpregs[20], 32 - 20);
+		uc.uc_mcontext.__fpregs.__fp_csr =
+		    sc->sc_fpregs[_R_FSR - _FPBASE];
+		/* XXX sc_fp_control */
+		uc.uc_flags |= _UC_FPU;
+	}
+
+	setcontext(&uc);
+ err:
+	longjmperror();
+	abort();
+	/* NOTREACHED */
+}


Property changes on: trunk/lib/libc/mips/gen/longjmp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/makecontext.c
===================================================================
--- trunk/lib/libc/mips/gen/makecontext.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/makecontext.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,124 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $	*/
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/makecontext.c 209233 2010-06-16 14:13:36Z jchandra $");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $");
+#endif
+
+#include <sys/param.h>
+#include <machine/regnum.h>
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ucontext.h>
+
+__weak_reference(__makecontext, makecontext);
+
+void _ctx_done(ucontext_t *);
+void _ctx_start(void);
+
+void
+__makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
+{
+	mcontext_t *mc;
+	register_t *sp;
+	int i;
+	va_list ap;
+
+	/*
+	 * XXX/juli
+	 * We need an mc_len or mc_flags like other architectures
+	 * so that we can mark a context as invalid.  Store it in
+	 * mc->mc_regs[ZERO] perhaps?
+	 */
+	if (argc < 0 || argc > 6 || ucp == NULL ||
+	    ucp->uc_stack.ss_sp == NULL ||
+	    ucp->uc_stack.ss_size < MINSIGSTKSZ)
+		return;
+	mc = &ucp->uc_mcontext;
+
+	sp  = (register_t *)
+	    ((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
+#if defined(__mips_o32) || defined(__mips_o64)
+	sp -= (argc >= 4 ? argc : 4);	/* Make room for >=4 arguments. */
+	sp  = (register_t *)
+	    ((uintptr_t)sp & ~0x7);	/* Align on double-word boundary. */
+#elif defined(__mips_n32) || defined(__mips_n64)
+	sp -= (argc > 8 ? argc - 8 : 0); /* Make room for > 8 arguments. */
+	sp  = (register_t *)
+	    ((uintptr_t)sp & ~0xf);	/* Align on quad-word boundary. */
+#endif
+
+	mc->mc_regs[SP] = (intptr_t)sp;
+	mc->mc_regs[S0] = (intptr_t)ucp;
+	mc->mc_regs[T9] = (intptr_t)func;
+	mc->mc_pc = (intptr_t)_ctx_start;
+
+	/* Construct argument list. */
+	va_start(ap, argc);
+#if defined(__mips_o32) || defined(__mips_o64)
+	/* Up to the first four arguments are passed in $a0-3. */
+	for (i = 0; i < argc && i < 4; i++)
+		/* LINTED register_t is safe */
+		mc->mc_regs[A0 + i] = va_arg(ap, register_t);
+	/* Pass remaining arguments on the stack above the $a0-3 gap. */
+	sp += i;
+#endif
+#if defined(__mips_n32) || defined(__mips_n64)
+	/* Up to the first 8 arguments are passed in $a0-7. */
+	for (i = 0; i < argc && i < 8; i++)
+		/* LINTED register_t is safe */
+		mc->mc_regs[A0 + i] = va_arg(ap, register_t);
+	/* Pass remaining arguments on the stack above the $a0-3 gap. */
+#endif
+	/* Pass remaining arguments on the stack above the $a0-3 gap. */
+	for (; i < argc; i++)
+		/* LINTED uintptr_t is safe */
+		*sp++ = va_arg(ap, register_t);
+	va_end(ap);
+}
+
+void
+_ctx_done(ucontext_t *ucp)
+{
+
+	if (ucp->uc_link == NULL)
+		exit(0);
+	else {
+		setcontext((const ucontext_t *)ucp->uc_link);
+		abort();
+	}
+}


Property changes on: trunk/lib/libc/mips/gen/makecontext.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/setjmp.S
===================================================================
--- trunk/lib/libc/mips/gen/setjmp.S	                        (rev 0)
+++ trunk/lib/libc/mips/gen/setjmp.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,239 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/setjmp.S 277537 2015-01-22 21:17:58Z brooks $");
+#include <machine/regnum.h>
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)setjmp.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+/*
+ * C library -- setjmp, longjmp
+ *
+ *	longjmp(a,v)
+ * will generate a "return(v)" from
+ * the last call to
+ *	setjmp(a)
+ * by restoring registers from the stack,
+ * and a struct sigcontext, see <signal.h>
+ */
+
+#define SETJMP_FRAME_SIZE	(CALLFRAME_SIZ + (SZREG * 2))
+
+
+NESTED(setjmp, SETJMP_FRAME_SIZE, ra)
+	.mask	0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
+	SETUP_GP
+	PTR_SUBU sp, sp, SETJMP_FRAME_SIZE	# allocate stack frame
+	SAVE_GP(CALLFRAME_GP)
+	SETUP_GP64(CALLFRAME_GP, setjmp)
+
+	REG_S	ra, CALLFRAME_RA(sp)		# save RA
+	REG_S	a0, CALLFRAME_SIZ(sp)		# store env
+
+	/* Get the signal mask. */
+	PTR_ADDU a2, a0, _JB_SIGMASK * SZREG	# &oenv
+	li	a0, 1				# SIG_SETBLOCK
+	move	a1, zero			# &env == 0
+	PTR_LA	t9, _C_LABEL(sigprocmask)	# get current signal mask
+	jalr	t9
+
+	RESTORE_GP64
+	REG_L	a0, CALLFRAME_SIZ(sp)		# restore env pointer
+	REG_L	ra, CALLFRAME_RA(sp)		# restore RA
+	PTR_ADDU sp, sp, SETJMP_FRAME_SIZE	# pop stack frame
+
+	REG_LI	v0, _JB_MAGIC_SETJMP
+	REG_S	v0, (_JB_MAGIC  * SZREG)(a0)
+	REG_S	ra, (_JB_REG_RA * SZREG)(a0)
+	/*
+	 * From "MIPSpro N32 ABI Handbook", Table 2-1:
+	 * Registers s0..s7 are callee-saved.
+	 * The sp register is callee-saved.
+	 * The fp (or s8) register is callee-saved.
+	 * The gp register is callee-saved (for n32/n64).
+	 */
+	REG_S	s0, (_JB_REG_S0 * SZREG)(a0)
+	REG_S	s1, (_JB_REG_S1 * SZREG)(a0)
+	REG_S	s2, (_JB_REG_S2 * SZREG)(a0)
+	REG_S	s3, (_JB_REG_S3 * SZREG)(a0)
+	REG_S	s4, (_JB_REG_S4 * SZREG)(a0)
+	REG_S	s5, (_JB_REG_S5 * SZREG)(a0)
+	REG_S	s6, (_JB_REG_S6 * SZREG)(a0)
+	REG_S	s7, (_JB_REG_S7 * SZREG)(a0)
+	REG_S	sp, (_JB_REG_SP * SZREG)(a0)
+	REG_S	s8, (_JB_REG_S8 * SZREG)(a0)
+#if defined(__mips_n32) || defined(__mips_n64)
+	REG_S	gp, (_JB_REG_GP * SZREG)(a0)
+#endif
+#ifndef SOFTFLOAT
+	/*
+	 * From "MIPSpro N32 ABI Handbook", Table 2-1:
+	 * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
+	 * In N64, FP registers F24 .. F31 are callee-saved.
+	 * In O32, FP registers F20 .. F23 are callee-saved.
+	 */
+	cfc1	v0, $31
+	INT_S	v0, (_JB_FPREG_FCSR * SZREG)(a0)
+#if defined(__mips_o32) || defined(__mips_o64) || defined(__mips_n32)
+	FP_S	$f20, (_JB_FPREG_F20 * SZREG)(a0)
+	FP_S	$f22, (_JB_FPREG_F22 * SZREG)(a0)
+#endif
+#if defined(__mips_o32) || defined(__mips_o64)
+	FP_S	$f21, (_JB_FPREG_F21 * SZREG)(a0)
+	FP_S	$f23, (_JB_FPREG_F23 * SZREG)(a0)
+#endif
+#if defined(__mips_n32) || defined(__mips_n64)
+	FP_S	$f24, (_JB_FPREG_F24 * SZREG)(a0)
+	FP_S	$f26, (_JB_FPREG_F26 * SZREG)(a0)
+	FP_S	$f28, (_JB_FPREG_F28 * SZREG)(a0)
+	FP_S	$f30, (_JB_FPREG_F30 * SZREG)(a0)
+#endif
+#if defined(__mips_n64)
+	FP_S	$f25, (_JB_FPREG_F25 * SZREG)(a0)
+	FP_S	$f27, (_JB_FPREG_F27 * SZREG)(a0)
+	FP_S	$f29, (_JB_FPREG_F29 * SZREG)(a0)
+	FP_S	$f31, (_JB_FPREG_F31 * SZREG)(a0)
+#endif
+#endif	/* ! SOFTFLOAT */
+
+	move	v0, zero
+	jr	ra
+END(setjmp)
+
+#define LONGJMP_FRAME_SIZE	(CALLFRAME_SIZ + (SZREG * 2))
+
+NESTED(longjmp, LONGJMP_FRAME_SIZE, ra)
+	.mask	0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
+	PIC_PROLOGUE(longjmp)
+	PTR_SUBU sp, sp, LONGJMP_FRAME_SIZE	# allocate stack frame
+	SAVE_GP(CALLFRAME_GP)
+
+	REG_S	ra, CALLFRAME_RA(sp)		# save RA
+	REG_L	v0, (_JB_MAGIC  * SZREG)(a0)
+	REG_LI	t0, _JB_MAGIC_SETJMP
+	bne	v0, t0, botch		# jump if error
+	nop
+
+	REG_S	a0, CALLFRAME_SIZ(sp)		# save env
+	REG_S	a1, (CALLFRAME_SIZ + SZREG)(sp)	# save return value
+
+	# set sigmask
+	PTR_ADDU a1, a0, _JB_SIGMASK * SZREG	# &set
+	move	a2, zero			# &oset == NULL
+	li	a0, 3				# SIG_SETMASK
+	PTR_LA	t9,_C_LABEL(sigprocmask)	# set current signal mask
+	jal	t9
+	nop
+
+	REG_L	a0, CALLFRAME_SIZ(sp)		# restore env
+	REG_L	a1, (CALLFRAME_SIZ + SZREG)(sp)	# restore return value
+
+	REG_L	ra, (_JB_REG_RA * SZREG)(a0)
+	/*
+	 * From "MIPSpro N32 ABI Handbook", Table 2-1:
+	 * Registers s0..s7 are callee-saved.
+	 * The sp register is callee-saved.
+	 * The fp (or s8) register is callee-saved.
+	 * The gp register is callee-saved (for n32/n64).
+	 */
+	REG_L	s0, (_JB_REG_S0 * SZREG)(a0)
+	REG_L	s1, (_JB_REG_S1 * SZREG)(a0)
+	REG_L	s2, (_JB_REG_S2 * SZREG)(a0)
+	REG_L	s3, (_JB_REG_S3 * SZREG)(a0)
+	REG_L	s4, (_JB_REG_S4 * SZREG)(a0)
+	REG_L	s5, (_JB_REG_S5 * SZREG)(a0)
+	REG_L	s6, (_JB_REG_S6 * SZREG)(a0)
+	REG_L	s7, (_JB_REG_S7 * SZREG)(a0)
+	REG_L	sp, (_JB_REG_SP * SZREG)(a0)
+	REG_L	s8, (_JB_REG_S8 * SZREG)(a0)
+#if defined(__mips_n32) || defined(__mips_n64)
+	REG_L	gp, (_JB_REG_GP * SZREG)(a0)
+#endif
+#ifndef SOFTFLOAT
+	/*
+	 * From "MIPSpro N32 ABI Handbook", Table 2-1:
+	 * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
+	 * In N64, FP registers F23 .. F31 are callee-saved.
+	 * In O32, FP registers F20 .. F23 are callee-saved.
+	 */
+        INT_L           v0, (_JB_FPREG_FCSR * SZREG)(a0)
+        ctc1            v0, $31
+#if defined(__mips_n64) || defined(__mips_n32)
+	FP_L	$f30, (_JB_FPREG_F30 * SZREG)(a0)
+	FP_L	$f28, (_JB_FPREG_F28 * SZREG)(a0)
+	FP_L	$f26, (_JB_FPREG_F26 * SZREG)(a0)
+	FP_L	$f24, (_JB_FPREG_F24 * SZREG)(a0)
+#endif
+#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
+	FP_L	$f22, (_JB_FPREG_F22 * SZREG)(a0)
+	FP_L	$f20, (_JB_FPREG_F20 * SZREG)(a0)
+#endif
+#if defined(__mips_o32) || defined(__mips_o64)
+	FP_L	$f21, (_JB_FPREG_F21 * SZREG)(a0)
+	FP_L	$f23, (_JB_FPREG_F23 * SZREG)(a0)
+#endif
+#if defined(__mips_n64)
+	FP_L	$f25, (_JB_FPREG_F25 * SZREG)(a0)
+	FP_L	$f27, (_JB_FPREG_F27 * SZREG)(a0)
+	FP_L	$f29, (_JB_FPREG_F29 * SZREG)(a0)
+	FP_L	$f31, (_JB_FPREG_F31 * SZREG)(a0)
+#endif
+#endif	/* ! SOFTFLOAT */
+
+	move	v0, a1
+	j	ra
+	nop
+
+botch:
+	/*
+	 * We know we aren't returning so we don't care about restoring
+	 * our caller's GP.
+	 */
+	PTR_LA	t9, _C_LABEL(longjmperror)
+	jalr	t9
+	nop
+
+	PIC_TAILCALL(abort)
+END(longjmp)


Property changes on: trunk/lib/libc/mips/gen/setjmp.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/signalcontext.c
===================================================================
--- trunk/lib/libc/mips/gen/signalcontext.c	                        (rev 0)
+++ trunk/lib/libc/mips/gen/signalcontext.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,54 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright (c) 2004 Olivier Houchard
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/signalcontext.c 178580 2008-04-26 12:08:02Z imp $");
+
+#include <sys/param.h>
+#include <sys/signal.h>
+#include <sys/ucontext.h>
+
+#include <machine/frame.h>
+#include <machine/sigframe.h>
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <strings.h>
+#include <signal.h>
+
+__weak_reference(__signalcontext, signalcontext);
+
+extern void _ctx_start(void);
+
+int
+__signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func)
+{
+	/* XXXMIPS: Implement me */
+	return (0);
+}


Property changes on: trunk/lib/libc/mips/gen/signalcontext.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/gen/sigsetjmp.S
===================================================================
--- trunk/lib/libc/mips/gen/sigsetjmp.S	                        (rev 0)
+++ trunk/lib/libc/mips/gen/sigsetjmp.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,78 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui 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>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/gen/sigsetjmp.S 282143 2015-04-28 12:52:08Z emaste $");
+#include <machine/regnum.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)setjmp.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+#include "SYS.h"
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+/*
+ * C library -- sigsetjmp, siglongjmp
+ *
+ *	siglongjmp(a,v)
+ * will generate a "return(v)" from
+ * the last call to
+ *	sigsetjmp(a, savemask)
+ * by restoring registers from the stack,
+ * and dependent on savemask restores the
+ * signal mask.
+ */
+
+LEAF(sigsetjmp)
+	PIC_PROLOGUE(sigsetjmp)
+
+	bne	a1, zero, 1f			# do saving of signal mask?
+	PIC_TAILCALL(_setjmp)
+
+1:	PIC_TAILCALL(setjmp)
+END(sigsetjmp)
+
+LEAF(siglongjmp)
+	PIC_PROLOGUE(siglongjmp)
+	REG_L	t0, (_JB_MAGIC  * SZREG)(a0)
+	REG_LI	t1, _JB_MAGIC__SETJMP
+	bne	t0, t1, 1f			# setjmp or _setjmp magic?
+	PIC_TAILCALL(_longjmp)
+1:	PIC_TAILCALL(longjmp)
+END(siglongjmp)


Property changes on: trunk/lib/libc/mips/gen/sigsetjmp.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/net/Makefile.inc
===================================================================
--- trunk/lib/libc/mips/net/Makefile.inc	                        (rev 0)
+++ trunk/lib/libc/mips/net/Makefile.inc	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,5 @@
+#	$NetBSD: Makefile.inc,v 1.3 2003/08/01 17:03:51 lukem Exp $
+# $FreeBSD: stable/10/lib/libc/mips/net/Makefile.inc 178580 2008-04-26 12:08:02Z imp $
+# $MidnightBSD$
+
+SRCS+= htonl.S ntohl.S htons.S ntohs.S 


Property changes on: trunk/lib/libc/mips/net/Makefile.inc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/net/htonl.S
===================================================================
--- trunk/lib/libc/mips/net/htonl.S	                        (rev 0)
+++ trunk/lib/libc/mips/net/htonl.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,52 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: byte_swap_4.S,v 1.2 2006/02/08 21:52:36 simonb Exp $	*/
+
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Neil A. Carson
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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>
+
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/net/htonl.S 251091 2013-05-29 01:54:10Z emaste $");
+
+LEAF(htonl)                            # a0 = 0x11223344, return 0x44332211
+#ifdef __MIPSEB__
+	move	v0, a0
+#else
+        srl     v1, a0, 24              # v1 = 0x00000011
+        sll     v0, a0, 24              # v0 = 0x44000000
+        or      v0, v0, v1
+        and     v1, a0, 0xff00
+        sll     v1, v1, 8               # v1 = 0x00330000
+        or      v0, v0, v1
+        srl     v1, a0, 8
+        and     v1, v1, 0xff00          # v1 = 0x00002200
+        or      v0, v0, v1
+#endif
+        j       ra
+END(htonl)


Property changes on: trunk/lib/libc/mips/net/htonl.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/net/htons.S
===================================================================
--- trunk/lib/libc/mips/net/htons.S	                        (rev 0)
+++ trunk/lib/libc/mips/net/htons.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,48 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: byte_swap_2.S,v 1.2 2006/02/08 21:52:36 simonb Exp $	*/
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles M. Hannum.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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>
+
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/net/htons.S 251091 2013-05-29 01:54:10Z emaste $");
+
+LEAF(htons)
+#ifdef __MIPSEB__
+        move    v0, a0
+#else
+	srl	v0, a0, 8
+	and	v0, v0, 0xff
+	sll	v1, a0, 8
+	and	v1, v1, 0xff00
+	or	v0, v0, v1
+#endif
+	j	ra
+END(htons)


Property changes on: trunk/lib/libc/mips/net/htons.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/net/ntohl.S
===================================================================
--- trunk/lib/libc/mips/net/ntohl.S	                        (rev 0)
+++ trunk/lib/libc/mips/net/ntohl.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,52 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: byte_swap_4.S,v 1.2 2006/02/08 21:52:36 simonb Exp $	*/
+
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Neil A. Carson
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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>
+
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/net/ntohl.S 251091 2013-05-29 01:54:10Z emaste $");
+
+LEAF(ntohl)                            # a0 = 0x11223344, return 0x44332211
+#ifdef __MIPSEB__
+	move	v0, a0
+#else
+        srl     v1, a0, 24              # v1 = 0x00000011
+        sll     v0, a0, 24              # v0 = 0x44000000
+        or      v0, v0, v1
+        and     v1, a0, 0xff00
+        sll     v1, v1, 8               # v1 = 0x00330000
+        or      v0, v0, v1
+        srl     v1, a0, 8
+        and     v1, v1, 0xff00          # v1 = 0x00002200
+        or      v0, v0, v1
+#endif
+        j       ra
+END(ntohl)


Property changes on: trunk/lib/libc/mips/net/ntohl.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/net/ntohs.S
===================================================================
--- trunk/lib/libc/mips/net/ntohs.S	                        (rev 0)
+++ trunk/lib/libc/mips/net/ntohs.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,47 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: byte_swap_2.S,v 1.2 2006/02/08 21:52:36 simonb Exp $	*/
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles M. Hannum.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/net/ntohs.S 251091 2013-05-29 01:54:10Z emaste $");
+
+LEAF(ntohs)
+#ifdef __MIPSEB__
+        move    v0, a0
+#else
+	srl	v0, a0, 8
+	and	v0, v0, 0xff
+	sll	v1, a0, 8
+	and	v1, v1, 0xff00
+	or	v0, v0, v1
+#endif
+	j	ra
+END(ntohs)


Property changes on: trunk/lib/libc/mips/net/ntohs.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/softfloat/milieu.h
===================================================================
--- trunk/lib/libc/mips/softfloat/milieu.h	                        (rev 0)
+++ trunk/lib/libc/mips/softfloat/milieu.h	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,49 @@
+/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/lib/libc/mips/softfloat/milieu.h 178580 2008-04-26 12:08:02Z imp $ */
+
+/*
+===============================================================================
+
+This C header file is part of the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2a.
+
+Written by John R. Hauser.  This work was made possible in part by the
+International Computer Science Institute, located at Suite 600, 1947 Center
+Street, Berkeley, California 94704.  Funding was partially provided by the
+National Science Foundation under grant MIP-9311980.  The original version
+of this code was written as part of a project to build a fixed-point vector
+processor in collaboration with the University of California at Berkeley,
+overseen by Profs. Nelson Morgan and John Wawrzynek.  More information
+is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
+arithmetic/SoftFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+/*
+-------------------------------------------------------------------------------
+Include common integer types and flags.
+-------------------------------------------------------------------------------
+*/
+#include "mips-gcc.h"
+
+/*
+-------------------------------------------------------------------------------
+Symbolic Boolean literals.
+-------------------------------------------------------------------------------
+*/
+enum {
+    FALSE = 0,
+    TRUE  = 1
+};


Property changes on: trunk/lib/libc/mips/softfloat/milieu.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/softfloat/mips-gcc.h
===================================================================
--- trunk/lib/libc/mips/softfloat/mips-gcc.h	                        (rev 0)
+++ trunk/lib/libc/mips/softfloat/mips-gcc.h	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,92 @@
+/* $MidnightBSD$ */
+/* $NetBSD: arm-gcc.h,v 1.2 2001/02/21 18:09:25 bjh21 Exp $ */
+/* $FreeBSD: stable/10/lib/libc/mips/softfloat/mips-gcc.h 178580 2008-04-26 12:08:02Z imp $ */
+
+/*
+-------------------------------------------------------------------------------
+One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
+-------------------------------------------------------------------------------
+*/
+#ifdef __MIPSEB__
+#define BIGENDIAN
+#else
+#define LITTLEENDIAN
+#endif
+
+/*
+-------------------------------------------------------------------------------
+The macro `BITS64' can be defined to indicate that 64-bit integer types are
+supported by the compiler.
+-------------------------------------------------------------------------------
+*/
+#define BITS64
+
+/*
+-------------------------------------------------------------------------------
+Each of the following `typedef's defines the most convenient type that holds
+integers of at least as many bits as specified.  For example, `uint8' should
+be the most convenient type that can hold unsigned integers of as many as
+8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
+implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
+to the same as `int'.
+-------------------------------------------------------------------------------
+*/
+typedef int flag;
+typedef int uint8;
+typedef int int8;
+typedef int uint16;
+typedef int int16;
+typedef unsigned int uint32;
+typedef signed int int32;
+#ifdef BITS64
+typedef unsigned long long int uint64;
+typedef signed long long int int64;
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Each of the following `typedef's defines a type that holds integers
+of _exactly_ the number of bits specified.  For instance, for most
+implementation of C, `bits16' and `sbits16' should be `typedef'ed to
+`unsigned short int' and `signed short int' (or `short int'), respectively.
+-------------------------------------------------------------------------------
+*/
+typedef unsigned char bits8;
+typedef signed char sbits8;
+typedef unsigned short int bits16;
+typedef signed short int sbits16;
+typedef unsigned int bits32;
+typedef signed int sbits32;
+#ifdef BITS64
+typedef unsigned long long int bits64;
+typedef signed long long int sbits64;
+#endif
+
+#ifdef BITS64
+/*
+-------------------------------------------------------------------------------
+The `LIT64' macro takes as its argument a textual integer literal and
+if necessary ``marks'' the literal as having a 64-bit integer type.
+For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
+appended with the letters `LL' standing for `long long', which is `gcc's
+name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
+defined as the identity macro:  `#define LIT64( a ) a'.
+-------------------------------------------------------------------------------
+*/
+#define LIT64( a ) a##LL
+#endif
+
+/*
+-------------------------------------------------------------------------------
+The macro `INLINE' can be used before functions that should be inlined.  If
+a compiler does not support explicit inlining, this macro should be defined
+to be `static'.
+-------------------------------------------------------------------------------
+*/
+#define INLINE static __inline
+
+#if defined(SOFTFLOAT_FOR_GCC)
+/* XXXMIPS: check this one */
+#define FLOAT64_DEMANGLE(a)	(a)
+#define FLOAT64_MANGLE(a)	(a)
+#endif


Property changes on: trunk/lib/libc/mips/softfloat/mips-gcc.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/softfloat/softfloat.h
===================================================================
--- trunk/lib/libc/mips/softfloat/softfloat.h	                        (rev 0)
+++ trunk/lib/libc/mips/softfloat/softfloat.h	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,316 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: softfloat.h,v 1.6 2002/05/12 13:12:46 bjh21 Exp $	*/
+/* $FreeBSD: stable/10/lib/libc/mips/softfloat/softfloat.h 230189 2012-01-16 04:05:53Z das $ */
+
+/* This is a derivative work. */
+
+/*
+===============================================================================
+
+This C header file is part of the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2a.
+
+Written by John R. Hauser.  This work was made possible in part by the
+International Computer Science Institute, located at Suite 600, 1947 Center
+Street, Berkeley, California 94704.  Funding was partially provided by the
+National Science Foundation under grant MIP-9311980.  The original version
+of this code was written as part of a project to build a fixed-point vector
+processor in collaboration with the University of California at Berkeley,
+overseen by Profs. Nelson Morgan and John Wawrzynek.  More information
+is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
+arithmetic/SoftFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+/*
+-------------------------------------------------------------------------------
+The macro `FLOATX80' must be defined to enable the extended double-precision
+floating-point format `floatx80'.  If this macro is not defined, the
+`floatx80' type will not be defined, and none of the functions that either
+input or output the `floatx80' type will be defined.  The same applies to
+the `FLOAT128' macro and the quadruple-precision format `float128'.
+-------------------------------------------------------------------------------
+*/
+/* #define FLOATX80 */
+/* #define FLOAT128 */
+
+#include <fenv.h>
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE floating-point types.
+-------------------------------------------------------------------------------
+*/
+typedef unsigned int float32;
+typedef unsigned long long float64;
+#ifdef FLOATX80
+typedef struct {
+    unsigned short high;
+    unsigned long long low;
+} floatx80;
+#endif
+#ifdef FLOAT128
+typedef struct {
+    unsigned long long high, low;
+} float128;
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE floating-point underflow tininess-detection mode.
+-------------------------------------------------------------------------------
+*/
+#ifndef SOFTFLOAT_FOR_GCC
+extern int float_detect_tininess;
+#endif
+enum {
+    float_tininess_after_rounding  = 0,
+    float_tininess_before_rounding = 1
+};
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE floating-point rounding mode.
+-------------------------------------------------------------------------------
+*/
+extern int float_rounding_mode;
+enum {
+    float_round_nearest_even = FE_TONEAREST,
+    float_round_to_zero      = FE_TOWARDZERO,
+    float_round_down         = FE_DOWNWARD,
+    float_round_up           = FE_UPWARD
+};
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE floating-point exception flags.
+-------------------------------------------------------------------------------
+*/
+extern int float_exception_flags;
+extern int float_exception_mask;
+enum {
+    float_flag_inexact   = FE_INEXACT,
+    float_flag_underflow = FE_UNDERFLOW,
+    float_flag_overflow  = FE_OVERFLOW,
+    float_flag_divbyzero = FE_DIVBYZERO,
+    float_flag_invalid   = FE_INVALID
+};
+
+/*
+-------------------------------------------------------------------------------
+Routine to raise any or all of the software IEC/IEEE floating-point
+exception flags.
+-------------------------------------------------------------------------------
+*/
+void float_raise( int );
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE integer-to-floating-point conversion routines.
+-------------------------------------------------------------------------------
+*/
+float32 int32_to_float32( int );
+float64 int32_to_float64( int );
+#ifdef FLOATX80
+floatx80 int32_to_floatx80( int );
+#endif
+#ifdef FLOAT128
+float128 int32_to_float128( int );
+#endif
+#ifndef SOFTFLOAT_FOR_GCC /* __floatdi?f is in libgcc2.c */
+float32 int64_to_float32( long long );
+float64 int64_to_float64( long long );
+#ifdef FLOATX80
+floatx80 int64_to_floatx80( long long );
+#endif
+#ifdef FLOAT128
+float128 int64_to_float128( long long );
+#endif
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE single-precision conversion routines.
+-------------------------------------------------------------------------------
+*/
+int float32_to_int32( float32 );
+int float32_to_int32_round_to_zero( float32 );
+#if defined(SOFTFLOAT_FOR_GCC) && defined(SOFTFLOAT_NEED_FIXUNS)
+unsigned int float32_to_uint32_round_to_zero( float32 );
+#endif
+#ifndef SOFTFLOAT_FOR_GCC /* __fix?fdi provided by libgcc2.c */
+long long float32_to_int64( float32 );
+long long float32_to_int64_round_to_zero( float32 );
+#endif
+float64 float32_to_float64( float32 );
+#ifdef FLOATX80
+floatx80 float32_to_floatx80( float32 );
+#endif
+#ifdef FLOAT128
+float128 float32_to_float128( float32 );
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE single-precision operations.
+-------------------------------------------------------------------------------
+*/
+float32 float32_round_to_int( float32 );
+float32 float32_add( float32, float32 );
+float32 float32_sub( float32, float32 );
+float32 float32_mul( float32, float32 );
+float32 float32_div( float32, float32 );
+float32 float32_rem( float32, float32 );
+float32 float32_sqrt( float32 );
+int float32_eq( float32, float32 );
+int float32_le( float32, float32 );
+int float32_lt( float32, float32 );
+int float32_eq_signaling( float32, float32 );
+int float32_le_quiet( float32, float32 );
+int float32_lt_quiet( float32, float32 );
+#ifndef SOFTFLOAT_FOR_GCC
+int float32_is_signaling_nan( float32 );
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE double-precision conversion routines.
+-------------------------------------------------------------------------------
+*/
+int float64_to_int32( float64 );
+int float64_to_int32_round_to_zero( float64 );
+#if defined(SOFTFLOAT_FOR_GCC) && defined(SOFTFLOAT_NEED_FIXUNS)
+unsigned int float64_to_uint32_round_to_zero( float64 );
+#endif
+#ifndef SOFTFLOAT_FOR_GCC /* __fix?fdi provided by libgcc2.c */
+long long float64_to_int64( float64 );
+long long float64_to_int64_round_to_zero( float64 );
+#endif
+float32 float64_to_float32( float64 );
+#ifdef FLOATX80
+floatx80 float64_to_floatx80( float64 );
+#endif
+#ifdef FLOAT128
+float128 float64_to_float128( float64 );
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE double-precision operations.
+-------------------------------------------------------------------------------
+*/
+float64 float64_round_to_int( float64 );
+float64 float64_add( float64, float64 );
+float64 float64_sub( float64, float64 );
+float64 float64_mul( float64, float64 );
+float64 float64_div( float64, float64 );
+float64 float64_rem( float64, float64 );
+float64 float64_sqrt( float64 );
+int float64_eq( float64, float64 );
+int float64_le( float64, float64 );
+int float64_lt( float64, float64 );
+int float64_eq_signaling( float64, float64 );
+int float64_le_quiet( float64, float64 );
+int float64_lt_quiet( float64, float64 );
+#ifndef SOFTFLOAT_FOR_GCC
+int float64_is_signaling_nan( float64 );
+#endif
+
+#ifdef FLOATX80
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE extended double-precision conversion routines.
+-------------------------------------------------------------------------------
+*/
+int floatx80_to_int32( floatx80 );
+int floatx80_to_int32_round_to_zero( floatx80 );
+long long floatx80_to_int64( floatx80 );
+long long floatx80_to_int64_round_to_zero( floatx80 );
+float32 floatx80_to_float32( floatx80 );
+float64 floatx80_to_float64( floatx80 );
+#ifdef FLOAT128
+float128 floatx80_to_float128( floatx80 );
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE extended double-precision rounding precision.  Valid
+values are 32, 64, and 80.
+-------------------------------------------------------------------------------
+*/
+extern int floatx80_rounding_precision;
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE extended double-precision operations.
+-------------------------------------------------------------------------------
+*/
+floatx80 floatx80_round_to_int( floatx80 );
+floatx80 floatx80_add( floatx80, floatx80 );
+floatx80 floatx80_sub( floatx80, floatx80 );
+floatx80 floatx80_mul( floatx80, floatx80 );
+floatx80 floatx80_div( floatx80, floatx80 );
+floatx80 floatx80_rem( floatx80, floatx80 );
+floatx80 floatx80_sqrt( floatx80 );
+int floatx80_eq( floatx80, floatx80 );
+int floatx80_le( floatx80, floatx80 );
+int floatx80_lt( floatx80, floatx80 );
+int floatx80_eq_signaling( floatx80, floatx80 );
+int floatx80_le_quiet( floatx80, floatx80 );
+int floatx80_lt_quiet( floatx80, floatx80 );
+int floatx80_is_signaling_nan( floatx80 );
+
+#endif
+
+#ifdef FLOAT128
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE quadruple-precision conversion routines.
+-------------------------------------------------------------------------------
+*/
+int float128_to_int32( float128 );
+int float128_to_int32_round_to_zero( float128 );
+long long float128_to_int64( float128 );
+long long float128_to_int64_round_to_zero( float128 );
+float32 float128_to_float32( float128 );
+float64 float128_to_float64( float128 );
+#ifdef FLOATX80
+floatx80 float128_to_floatx80( float128 );
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Software IEC/IEEE quadruple-precision operations.
+-------------------------------------------------------------------------------
+*/
+float128 float128_round_to_int( float128 );
+float128 float128_add( float128, float128 );
+float128 float128_sub( float128, float128 );
+float128 float128_mul( float128, float128 );
+float128 float128_div( float128, float128 );
+float128 float128_rem( float128, float128 );
+float128 float128_sqrt( float128 );
+int float128_eq( float128, float128 );
+int float128_le( float128, float128 );
+int float128_lt( float128, float128 );
+int float128_eq_signaling( float128, float128 );
+int float128_le_quiet( float128, float128 );
+int float128_lt_quiet( float128, float128 );
+int float128_is_signaling_nan( float128 );
+
+#endif
+


Property changes on: trunk/lib/libc/mips/softfloat/softfloat.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/Makefile.inc
===================================================================
--- trunk/lib/libc/mips/string/Makefile.inc	                        (rev 0)
+++ trunk/lib/libc/mips/string/Makefile.inc	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,9 @@
+#	$NetBSD: Makefile.inc,v 1.2 2000/10/10 21:51:54 jeffs Exp $
+# $FreeBSD: stable/10/lib/libc/mips/string/Makefile.inc 229368 2012-01-03 07:14:01Z ed $
+# $MidnightBSD$
+
+SRCS+=	bcmp.S bcopy.S bzero.S ffs.S memchr.c memcmp.c memset.c \
+	memcpy.S memmove.S \
+	strcat.c strchr.S strcmp.S strcpy.c strcspn.c strlen.S \
+	strncat.c strncmp.c strncpy.c strrchr.S strpbrk.c strsep.c \
+	strspn.c strstr.c swab.c


Property changes on: trunk/lib/libc/mips/string/Makefile.inc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/bcmp.S
===================================================================
--- trunk/lib/libc/mips/string/bcmp.S	                        (rev 0)
+++ trunk/lib/libc/mips/string/bcmp.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,131 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: bcmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/string/bcmp.S 209231 2010-06-16 12:55:14Z jchandra $");
+
+#define _LOCORE		/* XXX not really, just assembly-code source */
+#include <machine/endian.h>	/* LWLO/LWHI, SWLO/SWHI */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+	ASMSTR("from: @(#)bcmp.s	8.1 (Berkeley) 6/4/93")
+#else
+	ASMSTR("$NetBSD: bcmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $")
+#endif
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+/* bcmp(s1, s2, n) */
+
+
+LEAF(bcmp)
+	.set	noreorder
+	blt		a2, 16, small	# is it worth any trouble?
+	xor		v0, a0, a1	# compare low two bits of addresses
+	and		v0, v0, 3
+	PTR_SUBU	a3, zero, a1	# compute # bytes to word align address
+	bne		v0, zero, unaligned # not possible to align addresses
+	and		a3, a3, 3
+
+	beq		a3, zero, 1f
+	PTR_SUBU	a2, a2, a3	# subtract from remaining count
+	move		v0, v1		# init v0,v1 so unmodified bytes match
+	LWHI		v0, 0(a0)	# read 1, 2, or 3 bytes
+	LWHI		v1, 0(a1)
+	PTR_ADDU	a1, a1, a3
+	bne		v0, v1, nomatch
+	PTR_ADDU	a0, a0, a3
+1:
+	and		a3, a2, ~3	# compute number of whole words left
+	PTR_SUBU	a2, a2, a3	#   which has to be >= (16-3) & ~3
+	PTR_ADDU	a3, a3, a0	# compute ending address
+2:
+	lw		v0, 0(a0)	# compare words
+	lw		v1, 0(a1)
+	PTR_ADDU	a0, a0, 4
+	bne		v0, v1, nomatch
+	PTR_ADDU	a1, a1, 4
+	bne		a0, a3, 2b
+	nop
+	b		small		# finish remainder
+	nop
+unaligned:
+	beq		a3, zero, 2f
+	PTR_SUBU	a2, a2, a3	# subtract from remaining count
+	PTR_ADDU	a3, a3, a0	# compute ending address
+1:
+	lbu		v0, 0(a0)	# compare bytes until a1 word aligned
+	lbu		v1, 0(a1)
+	PTR_ADDU	a0, a0, 1
+	bne		v0, v1, nomatch
+	PTR_ADDU	a1, a1, 1
+	bne		a0, a3, 1b
+	nop
+2:
+	and		a3, a2, ~3	# compute number of whole words left
+	PTR_SUBU	a2, a2, a3	#   which has to be >= (16-3) & ~3
+	PTR_ADDU	a3, a3, a0	# compute ending address
+3:
+	LWHI		v0, 0(a0)	# compare words a0 unaligned, a1 aligned
+	LWLO		v0, 3(a0)
+	lw		v1, 0(a1)
+	PTR_ADDU	a0, a0, 4
+	bne		v0, v1, nomatch
+	PTR_ADDU	a1, a1, 4
+	bne		a0, a3, 3b
+	nop
+small:
+	ble		a2, zero, match
+	PTR_ADDU	a3, a2, a0		# compute ending address
+1:
+	lbu		v0, 0(a0)
+	lbu		v1, 0(a1)
+	PTR_ADDU	a0, a0, 1
+	bne		v0, v1, nomatch
+	PTR_ADDU	a1, a1, 1
+	bne		a0, a3, 1b
+	nop
+match:
+	j		ra
+	move		v0, zero
+nomatch:
+	j		ra
+	li		v0, 1
+	.set	reorder
+END(bcmp)


Property changes on: trunk/lib/libc/mips/string/bcmp.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/bcopy.S
===================================================================
--- trunk/lib/libc/mips/string/bcopy.S	                        (rev 0)
+++ trunk/lib/libc/mips/string/bcopy.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,298 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: bcopy.S,v 1.3 2009/12/14 00:39:00 matt Exp $	*/
+
+/*
+ * Mach Operating System
+ * Copyright (c) 1993 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ *  Software Distribution Coordinator  or  Software.Distribution at CS.CMU.EDU
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+
+/*
+ *	File:	mips_bcopy.s
+ *	Author:	Chris Maeda
+ *	Date:	June 1993
+ *
+ *	Fast copy routine.  Derived from aligned_block_copy.
+ */
+
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/string/bcopy.S 209231 2010-06-16 12:55:14Z jchandra $");
+
+#define _LOCORE		/* XXX not really, just assembly-code source */
+#include <machine/endian.h>
+
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+	ASMSTR("from: @(#)mips_bcopy.s	2.2 CMU 18/06/93")
+#else
+	ASMSTR("$NetBSD: bcopy.S,v 1.3 2009/12/14 00:39:00 matt Exp $")
+#endif
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+/*
+ *	bcopy(caddr_t src, caddr_t dst, unsigned int len)
+ *
+ *	a0 	src address
+ *	a1	dst address
+ *	a2	length
+ */
+
+#if defined(MEMCOPY) || defined(MEMMOVE)
+#ifdef MEMCOPY
+#define	FUNCTION	memcpy
+#else
+#define FUNCTION	memmove
+#endif
+#define	SRCREG		a1
+#define	DSTREG		a0
+#else
+#define	FUNCTION	bcopy
+#define	SRCREG		a0
+#define	DSTREG		a1
+#endif
+
+#define	SIZEREG		a2
+
+LEAF(FUNCTION)
+	.set	noat
+	.set	noreorder
+
+#if defined(MEMCOPY) || defined(MEMMOVE)
+	/* set up return value, while we still can */
+	move	v0,DSTREG
+#endif
+	/*
+	 *	Make sure we can copy forwards.
+	 */
+	sltu	t0,SRCREG,DSTREG	# t0 == SRCREG < DSTREG
+	bne	t0,zero,6f		# copy backwards
+
+	/*
+	 * 	There are four alignment cases (with frequency)
+	 *	(Based on measurements taken with a DECstation 5000/200
+	 *	 inside a Mach kernel.)
+	 *
+	 * 	aligned   -> aligned		(mostly)
+	 * 	unaligned -> aligned		(sometimes)
+	 * 	aligned,unaligned -> unaligned	(almost never)
+	 *
+	 *	Note that we could add another case that checks if
+	 *	the destination and source are unaligned but the
+	 *	copy is alignable.  eg if src and dest are both
+	 *	on a halfword boundary.
+	 */
+	andi		t1,DSTREG,(SZREG-1)	# get last bits of dest
+	bne		t1,zero,3f		# dest unaligned
+	andi		t0,SRCREG,(SZREG-1)	# get last bits of src
+	bne		t0,zero,5f
+
+	/*
+	 *	Forward aligned->aligned copy, 8 words at a time.
+	 */
+98:
+	li		AT,-(SZREG*8)
+	and		t0,SIZEREG,AT		# count truncated to multiples
+	PTR_ADDU	a3,SRCREG,t0		# run fast loop up to this addr
+	sltu		AT,SRCREG,a3		# any work to do?
+	beq		AT,zero,2f
+	PTR_SUBU	SIZEREG,t0
+
+	/*
+	 *	loop body
+	 */
+1:	# cp
+	REG_L		t3,(0*SZREG)(SRCREG)
+	REG_L		v1,(1*SZREG)(SRCREG)
+	REG_L		t0,(2*SZREG)(SRCREG)
+	REG_L		t1,(3*SZREG)(SRCREG)
+	PTR_ADDU	SRCREG,SZREG*8
+	REG_S		t3,(0*SZREG)(DSTREG)
+	REG_S		v1,(1*SZREG)(DSTREG)
+	REG_S		t0,(2*SZREG)(DSTREG)
+	REG_S		t1,(3*SZREG)(DSTREG)
+	REG_L		t1,(-1*SZREG)(SRCREG)
+	REG_L		t0,(-2*SZREG)(SRCREG)
+	REG_L		v1,(-3*SZREG)(SRCREG)
+	REG_L		t3,(-4*SZREG)(SRCREG)
+	PTR_ADDU	DSTREG,SZREG*8
+	REG_S		t1,(-1*SZREG)(DSTREG)
+	REG_S		t0,(-2*SZREG)(DSTREG)
+	REG_S		v1,(-3*SZREG)(DSTREG)
+	bne		SRCREG,a3,1b
+	REG_S		t3,(-4*SZREG)(DSTREG)
+
+	/*
+	 *	Copy a word at a time, no loop unrolling.
+	 */
+2:	# wordcopy
+	andi		t2,SIZEREG,(SZREG-1)	# get byte count / SZREG
+	PTR_SUBU	t2,SIZEREG,t2		# t2 = words to copy * SZREG
+	beq		t2,zero,3f
+	PTR_ADDU	t0,SRCREG,t2		# stop at t0
+	PTR_SUBU	SIZEREG,SIZEREG,t2
+1:
+	REG_L		t3,0(SRCREG)
+	PTR_ADDU	SRCREG,SZREG
+	REG_S		t3,0(DSTREG)
+	bne		SRCREG,t0,1b
+	PTR_ADDU	DSTREG,SZREG
+
+3:	# bytecopy
+	beq		SIZEREG,zero,4f		# nothing left to do?
+	nop
+1:
+	lb		t3,0(SRCREG)
+	PTR_ADDU	SRCREG,1
+	sb		t3,0(DSTREG)
+	PTR_SUBU	SIZEREG,1
+	bgtz		SIZEREG,1b
+	PTR_ADDU	DSTREG,1
+
+4:	# copydone
+	j	ra
+	nop
+
+	/*
+	 *	Copy from unaligned source to aligned dest.
+	 */
+5:	# destaligned
+	andi		t0,SIZEREG,(SZREG-1)	# t0 = bytecount mod SZREG
+	PTR_SUBU	a3,SIZEREG,t0		# number of words to transfer
+	beq		a3,zero,3b
+	nop
+	move		SIZEREG,t0		# this many to do after we are done
+	PTR_ADDU	a3,SRCREG,a3		# stop point
+
+1:
+	REG_LHI		t3,0(SRCREG)
+	REG_LLO		t3,SZREG-1(SRCREG)
+	PTR_ADDI	SRCREG,SZREG
+	REG_S		t3,0(DSTREG)
+	bne		SRCREG,a3,1b
+	PTR_ADDI	DSTREG,SZREG
+
+	b		3b
+	nop
+
+6:	# backcopy -- based on above
+	PTR_ADDU	SRCREG,SIZEREG
+	PTR_ADDU	DSTREG,SIZEREG
+	andi		t1,DSTREG,SZREG-1	# get last 3 bits of dest
+	bne		t1,zero,3f
+	andi		t0,SRCREG,SZREG-1	# get last 3 bits of src
+	bne		t0,zero,5f
+
+	/*
+	 *	Forward aligned->aligned copy, 8*4 bytes at a time.
+	 */
+	li		AT,(-8*SZREG)
+	and		t0,SIZEREG,AT		# count truncated to multiple of 32
+	beq		t0,zero,2f		# any work to do?
+	PTR_SUBU	SIZEREG,t0
+	PTR_SUBU	a3,SRCREG,t0
+
+	/*
+	 *	loop body
+	 */
+1:	# cp
+	REG_L		t3,(-4*SZREG)(SRCREG)
+	REG_L		v1,(-3*SZREG)(SRCREG)
+	REG_L		t0,(-2*SZREG)(SRCREG)
+	REG_L		t1,(-1*SZREG)(SRCREG)
+	PTR_SUBU	SRCREG,8*SZREG
+	REG_S		t3,(-4*SZREG)(DSTREG)
+	REG_S		v1,(-3*SZREG)(DSTREG)
+	REG_S		t0,(-2*SZREG)(DSTREG)
+	REG_S		t1,(-1*SZREG)(DSTREG)
+	REG_L		t1,(3*SZREG)(SRCREG)
+	REG_L		t0,(2*SZREG)(SRCREG)
+	REG_L		v1,(1*SZREG)(SRCREG)
+	REG_L		t3,(0*SZREG)(SRCREG)
+	PTR_SUBU	DSTREG,8*SZREG
+	REG_S		t1,(3*SZREG)(DSTREG)
+	REG_S		t0,(2*SZREG)(DSTREG)
+	REG_S		v1,(1*SZREG)(DSTREG)
+	bne		SRCREG,a3,1b
+	REG_S		t3,(0*SZREG)(DSTREG)
+
+	/*
+	 *	Copy a word at a time, no loop unrolling.
+	 */
+2:	# wordcopy
+	andi		t2,SIZEREG,SZREG-1	# get byte count / 4
+	PTR_SUBU	t2,SIZEREG,t2		# t2 = number of words to copy
+	beq		t2,zero,3f
+	PTR_SUBU	t0,SRCREG,t2		# stop at t0
+	PTR_SUBU	SIZEREG,SIZEREG,t2
+1:
+	REG_L		t3,-SZREG(SRCREG)
+	PTR_SUBU	SRCREG,SZREG
+	REG_S		t3,-SZREG(DSTREG)
+	bne		SRCREG,t0,1b
+	PTR_SUBU	DSTREG,SZREG
+
+3:	# bytecopy
+	beq		SIZEREG,zero,4f		# nothing left to do?
+	nop
+1:
+	lb		t3,-1(SRCREG)
+	PTR_SUBU	SRCREG,1
+	sb		t3,-1(DSTREG)
+	PTR_SUBU	SIZEREG,1
+	bgtz		SIZEREG,1b
+	PTR_SUBU	DSTREG,1
+
+4:	# copydone
+	j	ra
+	nop
+
+	/*
+	 *	Copy from unaligned source to aligned dest.
+	 */
+5:	# destaligned
+	andi		t0,SIZEREG,SZREG-1	# t0 = bytecount mod 4
+	PTR_SUBU	a3,SIZEREG,t0		# number of words to transfer
+	beq		a3,zero,3b
+	nop
+	move		SIZEREG,t0		# this many to do after we are done
+	PTR_SUBU	a3,SRCREG,a3		# stop point
+
+1:
+	REG_LHI		t3,-SZREG(SRCREG)
+	REG_LLO		t3,-1(SRCREG)
+	PTR_SUBU	SRCREG,SZREG
+	REG_S		t3,-SZREG(DSTREG)
+	bne		SRCREG,a3,1b
+	PTR_SUBU	DSTREG,SZREG
+
+	b		3b
+	nop
+
+	.set	reorder
+	.set	at
+	END(FUNCTION)


Property changes on: trunk/lib/libc/mips/string/bcopy.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/bzero.S
===================================================================
--- trunk/lib/libc/mips/string/bzero.S	                        (rev 0)
+++ trunk/lib/libc/mips/string/bzero.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,84 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: bzero.S,v 1.10 2009/12/14 02:53:52 matt Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/string/bzero.S 218939 2011-02-22 07:49:51Z jchandra $");
+
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+	ASMSTR("from: @(#)bzero.s	8.1 (Berkeley) 6/4/93")
+#else
+	ASMSTR("$NetBSD: bzero.S,v 1.10 2009/12/14 02:53:52 matt Exp $")
+#endif
+#endif /* LIBC_SCCS and not lint */
+
+#define _LOCORE		/* XXX not really, just assembly-code source */
+#include <machine/endian.h>
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+/* bzero(s1, n) */
+
+LEAF(bzero)
+	.set	noreorder
+	blt		a1, 3*SZREG, smallclr # small amount to clear?
+	PTR_SUBU	a3, zero, a0	# compute # bytes to word align address
+	and		a3, a3, SZREG-1
+	beq		a3, zero, 1f	# skip if word aligned
+	PTR_SUBU	a1, a1, a3	# subtract from remaining count
+	REG_SHI		zero, 0(a0)	# clear 1, 2, or 3 bytes to align
+	PTR_ADDU	a0, a0, a3
+1:
+	and		v0, a1, SZREG-1	# compute number of words left
+	PTR_SUBU	a3, a1, v0
+	move		a1, v0
+	PTR_ADDU	a3, a3, a0	# compute ending address
+2:
+	PTR_ADDU	a0, a0, SZREG	# clear words
+	bne		a0, a3, 2b	#  unrolling loop doesnt help
+	REG_S		zero, -SZREG(a0) # since we are limited by memory speed
+smallclr:
+	ble		a1, zero, 2f
+	PTR_ADDU	a3, a1, a0	# compute ending address
+1:
+	PTR_ADDU	a0, a0, 1	# clear bytes
+	bne		a0, a3, 1b
+	sb		zero, -1(a0)
+2:
+	j		ra
+	nop
+END(bzero)


Property changes on: trunk/lib/libc/mips/string/bzero.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/ffs.S
===================================================================
--- trunk/lib/libc/mips/string/ffs.S	                        (rev 0)
+++ trunk/lib/libc/mips/string/ffs.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,60 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: ffs.S,v 1.2 2009/12/14 00:39:00 matt Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/string/ffs.S 209231 2010-06-16 12:55:14Z jchandra $");
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)ffs.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: ffs.S,v 1.2 2009/12/14 00:39:00 matt Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+/* bit = ffs(value) */
+
+LEAF(ffs)
+	move	v0, zero
+	beq	a0, zero, done
+1:
+	and	v1, a0, 1		# bit set?
+	addu	v0, v0, 1
+	srl	a0, a0, 1
+	beq	v1, zero, 1b		# no, continue
+done:
+	j	ra
+END(ffs)


Property changes on: trunk/lib/libc/mips/string/ffs.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/memcpy.S
===================================================================
--- trunk/lib/libc/mips/string/memcpy.S	                        (rev 0)
+++ trunk/lib/libc/mips/string/memcpy.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,8 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: memcpy.S,v 1.1 2005/12/20 19:28:50 christos Exp $	*/
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/string/memcpy.S 178580 2008-04-26 12:08:02Z imp $");
+
+#define MEMCOPY
+#include "bcopy.S"


Property changes on: trunk/lib/libc/mips/string/memcpy.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/memmove.S
===================================================================
--- trunk/lib/libc/mips/string/memmove.S	                        (rev 0)
+++ trunk/lib/libc/mips/string/memmove.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,8 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: memmove.S,v 1.1 2005/12/20 19:28:50 christos Exp $	*/
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/string/memmove.S 178580 2008-04-26 12:08:02Z imp $");
+
+#define MEMMOVE
+#include "bcopy.S"


Property changes on: trunk/lib/libc/mips/string/memmove.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/strchr.S
===================================================================
--- trunk/lib/libc/mips/string/strchr.S	                        (rev 0)
+++ trunk/lib/libc/mips/string/strchr.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,62 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: index.S,v 1.8 2005/04/22 06:59:00 simonb Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/string/strchr.S 229571 2012-01-05 10:32:53Z ed $");
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)index.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: index.S,v 1.8 2005/04/22 06:59:00 simonb Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+LEAF(strchr)
+1:
+	lbu		a2, 0(a0)		# get a byte
+	PTR_ADDU	a0, a0, 1
+	beq		a2, a1, fnd
+	bne		a2, zero, 1b
+notfnd:
+	move		v0, zero
+	j		ra
+fnd:
+	PTR_SUBU	v0, a0, 1
+	j		ra
+END(strchr)
+
+WEAK_ALIAS(index, strchr)


Property changes on: trunk/lib/libc/mips/string/strchr.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/strcmp.S
===================================================================
--- trunk/lib/libc/mips/string/strcmp.S	                        (rev 0)
+++ trunk/lib/libc/mips/string/strcmp.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,69 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: strcmp.S,v 1.2 2009/12/14 00:39:00 matt Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/string/strcmp.S 209231 2010-06-16 12:55:14Z jchandra $");
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)strcmp.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: strcmp.S,v 1.2 2009/12/14 00:39:00 matt Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+/*
+ * NOTE: this version assumes unsigned chars in order to be "8 bit clean".
+ */
+LEAF(strcmp)
+1:
+	lbu	t0, 0(a0)		# get two bytes and compare them
+	lbu	t1, 0(a1)
+	beq	t0, zero, LessOrEq	# end of first string?
+	bne	t0, t1, NotEq
+	lbu	t0, 1(a0)		# unroll loop
+	lbu	t1, 1(a1)
+	PTR_ADD	a0, a0, 2
+	beq	t0, zero, LessOrEq	# end of first string?
+	PTR_ADD	a1, a1, 2
+	beq	t0, t1, 1b
+NotEq:
+	subu	v0, t0, t1
+	j	ra
+LessOrEq:
+	subu	v0, zero, t1
+	j	ra
+END(strcmp)


Property changes on: trunk/lib/libc/mips/string/strcmp.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/strlen.S
===================================================================
--- trunk/lib/libc/mips/string/strlen.S	                        (rev 0)
+++ trunk/lib/libc/mips/string/strlen.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,56 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: strlen.S,v 1.2 2009/12/14 00:39:00 matt Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/string/strlen.S 209231 2010-06-16 12:55:14Z jchandra $");
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)strlen.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: strlen.S,v 1.2 2009/12/14 00:39:00 matt Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+LEAF(strlen)
+	PTR_ADDU	v1, a0, 1
+1:
+	lb		v0, 0(a0)	# get byte from string
+	PTR_ADDU	a0, a0, 1	# increment pointer
+	bne		v0, zero, 1b	# continue if not end
+	PTR_SUBU 	v0, a0, v1	# compute length - 1 for '\0' char
+	j		ra
+END(strlen)


Property changes on: trunk/lib/libc/mips/string/strlen.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/string/strrchr.S
===================================================================
--- trunk/lib/libc/mips/string/strrchr.S	                        (rev 0)
+++ trunk/lib/libc/mips/string/strrchr.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,60 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: rindex.S,v 1.7 2003/08/07 16:42:16 agc Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/string/strrchr.S 229571 2012-01-05 10:32:53Z ed $");
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)rindex.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: rindex.S,v 1.7 2003/08/07 16:42:16 agc Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef __ABICALLS__
+	.abicalls
+#endif
+
+LEAF(strrchr)
+	move		v0, zero		# default if not found
+1:
+	lbu		a3, 0(a0)		# get a byte
+	PTR_ADDU	a0, a0, 1
+	bne		a3, a1, 2f
+	PTR_SUBU	v0, a0, 1		# save address of last match
+2:
+	bne		a3, zero, 1b		# continue if not end
+	j		ra
+END(strrchr)
+
+WEAK_ALIAS(rindex, strrchr)


Property changes on: trunk/lib/libc/mips/string/strrchr.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/Makefile.inc
===================================================================
--- trunk/lib/libc/mips/sys/Makefile.inc	                        (rev 0)
+++ trunk/lib/libc/mips/sys/Makefile.inc	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,16 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/lib/libc/mips/sys/Makefile.inc 305341 2016-09-03 11:09:47Z kib $
+
+SRCS+=	__vdso_gettc.c
+
+MDASM=  Ovfork.S brk.S cerror.S exect.S \
+	fork.S pipe.S sbrk.S syscall.S
+
+# Don't generate default code for these syscalls:
+NOASM=	break.o exit.o ftruncate.o getlogin.o lseek.o mmap.o \
+	openbsd_poll.o pread.o pwrite.o sstk.o truncate.o vfork.o yield.o
+
+PSEUDO= _exit.o _getlogin.o
+.if !defined(WITHOUT_SYSCALL_COMPAT)
+PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
+.endif


Property changes on: trunk/lib/libc/mips/sys/Makefile.inc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/Ovfork.S
===================================================================
--- trunk/lib/libc/mips/sys/Ovfork.S	                        (rev 0)
+++ trunk/lib/libc/mips/sys/Ovfork.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,65 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: compat_Ovfork.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/sys/Ovfork.S 209231 2010-06-16 12:55:14Z jchandra $");
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)Ovfork.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: compat_Ovfork.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * pid = vfork();
+ *
+ * v1 == 0 in parent process, v1 == 1 in child process.
+ * v0 == pid of child in parent, v0 == pid of parent in child.
+ */
+
+LEAF(__sys_vfork)
+	WEAK_ALIAS(vfork, __sys_vfork)
+	WEAK_ALIAS(_vfork, __sys_vfork)
+	PIC_PROLOGUE(__sys_vfork)
+	li	v0, SYS_vfork		# system call number for vfork
+	syscall
+	beq	a3, zero, 1f		# jump if no errors
+	PIC_TAILCALL(__cerror)
+1:
+	beq	v1, zero, 2f		# parent process ?
+	move	v0, zero		# return zero in child
+2:
+	PIC_RETURN()
+END(__sys_vfork)


Property changes on: trunk/lib/libc/mips/sys/Ovfork.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/__vdso_gettc.c
===================================================================
--- trunk/lib/libc/mips/sys/__vdso_gettc.c	                        (rev 0)
+++ trunk/lib/libc/mips/sys/__vdso_gettc.c	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,49 @@
+/* $MidnightBSD$ */
+/*-
+ * Copyright (c) 2013 Konstantin Belousov <kib at FreeBSD.org>
+ *
+ * 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 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 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/sys/__vdso_gettc.c 246117 2013-01-30 12:48:16Z kib $");
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
+
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
+
+	return (0);
+}
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+	return (ENOSYS);
+}


Property changes on: trunk/lib/libc/mips/sys/__vdso_gettc.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/brk.S
===================================================================
--- trunk/lib/libc/mips/sys/brk.S	                        (rev 0)
+++ trunk/lib/libc/mips/sys/brk.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,72 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: brk.S,v 1.16 2003/08/07 16:42:17 agc Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/sys/brk.S 209521 2010-06-25 05:36:36Z jchandra $");
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)brk.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: brk.S,v 1.16 2003/08/07 16:42:17 agc Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+	.globl	_C_LABEL(minbrk)
+	.globl	_C_LABEL(__curbrk)
+	.globl	_C_LABEL(_end)
+
+	.data
+_C_LABEL(minbrk):
+	PTR_WORD	_C_LABEL(_end)
+
+	.text
+LEAF(__sys_brk)
+	WEAK_ALIAS(brk, __sys_brk)
+	WEAK_ALIAS(_brk, __sys_brk)
+	PIC_PROLOGUE(__sys_brk)
+	PTR_LA	v0, _C_LABEL(minbrk)
+	PTR_L	v0, 0(v0)
+	bgeu	a0, v0, 1f
+	move	a0, v0		# dont allow break < minbrk
+1:
+	li	v0, SYS_break
+	syscall
+	bne	a3, zero, 2f
+	PTR_LA	t0, _C_LABEL(__curbrk)
+	PTR_S	a0, 0(t0)
+	move	v0, zero
+	PIC_RETURN()
+2:
+	PIC_TAILCALL(__cerror)
+END(__sys_brk)


Property changes on: trunk/lib/libc/mips/sys/brk.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/cerror.S
===================================================================
--- trunk/lib/libc/mips/sys/cerror.S	                        (rev 0)
+++ trunk/lib/libc/mips/sys/cerror.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,73 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: cerror.S,v 1.14 2009/12/14 01:07:42 matt Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/sys/cerror.S 209231 2010-06-16 12:55:14Z jchandra $");
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+	RCSID("from: @(#)cerror.s	8.1 (Berkeley) 6/16/93")
+#else
+	RCSID("$NetBSD: cerror.S,v 1.14 2009/12/14 01:07:42 matt Exp $")
+#endif
+#endif /* LIBC_SCCS and not lint */
+
+	.globl	_C_LABEL(__error)
+NESTED_NOPROFILE(__cerror, CALLFRAME_SIZ, ra)
+	.mask	0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
+	SETUP_GP
+	PTR_SUBU	sp, sp, CALLFRAME_SIZ
+	SETUP_GP64(CALLFRAME_GP, __cerror)
+	SAVE_GP(CALLFRAME_GP)
+
+	PTR_S		ra, CALLFRAME_RA(sp)
+	REG_S		v0, CALLFRAME_S0(sp)	# save errno value
+
+	PTR_LA		t9, _C_LABEL(__error)	# locate address of errno
+	jalr		t9
+
+	REG_L		t0, CALLFRAME_S0(sp)
+	PTR_L		ra, CALLFRAME_RA(sp)
+	INT_S		t0, 0(v0)		# update errno value
+
+	RESTORE_GP64
+	PTR_ADDU	sp, sp, CALLFRAME_SIZ
+
+	li		v0, -1
+	li		v1, -1
+
+	j		ra
+END(__cerror)


Property changes on: trunk/lib/libc/mips/sys/cerror.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/exect.S
===================================================================
--- trunk/lib/libc/mips/sys/exect.S	                        (rev 0)
+++ trunk/lib/libc/mips/sys/exect.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,52 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: exect.S,v 1.9 2003/08/07 16:42:17 agc Exp $	*/
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/sys/exect.S 209231 2010-06-16 12:55:14Z jchandra $");
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)exect.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: exect.S,v 1.9 2003/08/07 16:42:17 agc Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+LEAF(exect)
+	PIC_PROLOGUE(exect)
+	li	v0, SYS_execve
+	syscall
+	bne	a3, zero, 1f
+	PIC_RETURN()
+1:
+	PIC_TAILCALL(__cerror)
+END(exect)


Property changes on: trunk/lib/libc/mips/sys/exect.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/fork.S
===================================================================
--- trunk/lib/libc/mips/sys/fork.S	                        (rev 0)
+++ trunk/lib/libc/mips/sys/fork.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,58 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: fork.S,v 1.11 2003/08/07 16:42:17 agc Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/sys/fork.S 209231 2010-06-16 12:55:14Z jchandra $");
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)fork.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: fork.S,v 1.11 2003/08/07 16:42:17 agc Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+LEAF(__sys_fork)
+	WEAK_ALIAS(fork, __sys_fork)
+	WEAK_ALIAS(_fork, __sys_fork)
+	PIC_PROLOGUE(__sys_fork)
+	li	v0, SYS_fork	# pid = fork()
+	syscall
+	bne	a3, zero, 2f
+	beq	v1, zero, 1f	# v1 == 0 in parent, 1 in child
+	move	v0, zero
+1:
+	PIC_RETURN()
+2:
+	PIC_TAILCALL(__cerror)
+END(__sys_fork)


Property changes on: trunk/lib/libc/mips/sys/fork.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/pipe.S
===================================================================
--- trunk/lib/libc/mips/sys/pipe.S	                        (rev 0)
+++ trunk/lib/libc/mips/sys/pipe.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,58 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: pipe.S,v 1.11 2005/04/22 06:58:01 simonb Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/sys/pipe.S 209231 2010-06-16 12:55:14Z jchandra $");
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)pipe.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: pipe.S,v 1.11 2005/04/22 06:58:01 simonb Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+LEAF(__sys_pipe)
+	WEAK_ALIAS(pipe, __sys_pipe)
+	WEAK_ALIAS(_pipe, __sys_pipe)
+	PIC_PROLOGUE(__sys_pipe)
+	li	v0, SYS_pipe	# pipe(fildes) int fildes[2];
+	syscall
+	bne	a3, zero, 1f
+	sw	v0, 0(a0)	# store the two file descriptors
+	sw	v1, 4(a0)
+	move	v0, zero
+	PIC_RETURN()
+1:
+	PIC_TAILCALL(__cerror)
+END(__sys_pipe)


Property changes on: trunk/lib/libc/mips/sys/pipe.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/sbrk.S
===================================================================
--- trunk/lib/libc/mips/sys/sbrk.S	                        (rev 0)
+++ trunk/lib/libc/mips/sys/sbrk.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,74 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: sbrk.S,v 1.16 2005/04/22 06:58:01 simonb Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/sys/sbrk.S 209521 2010-06-25 05:36:36Z jchandra $");
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)sbrk.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: sbrk.S,v 1.16 2005/04/22 06:58:01 simonb Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+	.globl	_C_LABEL(__curbrk)
+	.globl	_C_LABEL(_end)
+
+	.data
+_C_LABEL(__curbrk):
+	PTR_WORD	_C_LABEL(_end)
+	.text
+
+LEAF(__sys_sbrk)
+	WEAK_ALIAS(sbrk, __sys_sbrk)
+	WEAK_ALIAS(_sbrk, __sys_sbrk)
+	PIC_PROLOGUE(__sys_sbrk)
+	PTR_LA	t0, _C_LABEL(__curbrk)
+	PTR_L	t0, 0(t0)
+	PTR_ADDU a0, a0, t0
+
+	li	v0, SYS_break
+	syscall
+
+	bne	a3, zero, 1f
+	nop
+	move	v0, t0			# return old val of curbrk from above
+	PTR_LA	t0, _C_LABEL(__curbrk)
+	PTR_S	a0, 0(t0)		# save current val of curbrk from above
+	PIC_RETURN()
+	j	ra
+
+1:
+	PIC_TAILCALL(__cerror)
+END(__sys_sbrk)


Property changes on: trunk/lib/libc/mips/sys/sbrk.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/shmat.S
===================================================================
--- trunk/lib/libc/mips/sys/shmat.S	                        (rev 0)
+++ trunk/lib/libc/mips/sys/shmat.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,8 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: shmat.S,v 1.1 2000/07/07 08:20:52 itohy Exp $	*/
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/sys/shmat.S 178580 2008-04-26 12:08:02Z imp $");
+#include "SYS.h"
+
+RSYSCALL(shmat)


Property changes on: trunk/lib/libc/mips/sys/shmat.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lib/libc/mips/sys/syscall.S
===================================================================
--- trunk/lib/libc/mips/sys/syscall.S	                        (rev 0)
+++ trunk/lib/libc/mips/sys/syscall.S	2018-06-08 02:29:48 UTC (rev 10576)
@@ -0,0 +1,45 @@
+/* $MidnightBSD$ */
+/*	$NetBSD: syscall.S,v 1.5 2003/08/07 16:42:18 agc Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 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.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD: stable/10/lib/libc/mips/sys/syscall.S 178580 2008-04-26 12:08:02Z imp $");
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	ASMSTR("from: @(#)syscall.s	8.1 (Berkeley) 6/4/93")
+	ASMSTR("$NetBSD: syscall.S,v 1.5 2003/08/07 16:42:18 agc Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+RSYSCALL(syscall)


Property changes on: trunk/lib/libc/mips/sys/syscall.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list