git: 8ff32ab58e32 - main - mips: remove libc
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 31 Dec 2021 07:15:34 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=8ff32ab58e3294a02cdf760faaff5210866fe285
commit 8ff32ab58e3294a02cdf760faaff5210866fe285
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-12-31 05:50:28 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-12-31 07:14:53 +0000
mips: remove libc
Remove mips specific libc code and build infrasturcture.
Sponsored by: Netflix
---
lib/libc/Makefile | 5 +-
lib/libc/mips/Makefile.inc | 5 -
lib/libc/mips/SYS.h | 153 ---------------
lib/libc/mips/Symbol.map | 52 -----
lib/libc/mips/_fpmath.h | 58 ------
lib/libc/mips/arith.h | 26 ---
lib/libc/mips/gd_qnan.h | 48 -----
lib/libc/mips/gen/Makefile.inc | 11 --
lib/libc/mips/gen/_ctx_start.S | 55 ------
lib/libc/mips/gen/_setjmp.S | 200 -------------------
lib/libc/mips/gen/fabs.S | 58 ------
lib/libc/mips/gen/fabs.c | 47 -----
lib/libc/mips/gen/flt_rounds.c | 42 ----
lib/libc/mips/gen/hardfloat/fpgetmask.c | 29 ---
lib/libc/mips/gen/hardfloat/fpgetround.c | 29 ---
lib/libc/mips/gen/hardfloat/fpgetsticky.c | 29 ---
lib/libc/mips/gen/hardfloat/fpsetmask.c | 38 ----
lib/libc/mips/gen/hardfloat/fpsetround.c | 37 ----
lib/libc/mips/gen/hardfloat/fpsetsticky.c | 38 ----
lib/libc/mips/gen/infinity.c | 26 ---
lib/libc/mips/gen/ldexp.S | 219 ---------------------
lib/libc/mips/gen/makecontext.c | 123 ------------
lib/libc/mips/gen/setjmp.S | 237 ----------------------
lib/libc/mips/gen/signalcontext.c | 55 ------
lib/libc/mips/gen/sigsetjmp.S | 76 -------
lib/libc/mips/net/Makefile.inc | 4 -
lib/libc/mips/net/htonl.S | 51 -----
lib/libc/mips/net/htons.S | 47 -----
lib/libc/mips/net/ntohl.S | 51 -----
lib/libc/mips/net/ntohs.S | 46 -----
lib/libc/mips/softfloat/milieu.h | 48 -----
lib/libc/mips/softfloat/mips-gcc.h | 91 ---------
lib/libc/mips/softfloat/softfloat.h | 315 ------------------------------
lib/libc/mips/static_tls.h | 58 ------
lib/libc/mips/string/Makefile.inc | 13 --
lib/libc/mips/string/bcmp.S | 130 ------------
lib/libc/mips/string/bcopy.S | 297 ----------------------------
lib/libc/mips/string/bzero.S | 83 --------
lib/libc/mips/string/ffs.S | 59 ------
lib/libc/mips/string/memcpy.S | 7 -
lib/libc/mips/string/memmove.S | 7 -
lib/libc/mips/string/strchr.S | 66 -------
lib/libc/mips/string/strcmp.S | 68 -------
lib/libc/mips/string/strlen.S | 55 ------
lib/libc/mips/string/strrchr.S | 64 ------
lib/libc/mips/sys/Makefile.inc | 9 -
lib/libc/mips/sys/Ovfork.S | 64 ------
lib/libc/mips/sys/cerror.S | 72 -------
lib/libc/mips/sys/syscall.S | 44 -----
49 files changed, 1 insertion(+), 3444 deletions(-)
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index fdf6aa49932b..b6e4dd1787b4 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -111,9 +111,7 @@ NOASM=
.if ${LIBC_ARCH} != "aarch64" && \
${LIBC_ARCH} != "amd64" && \
${LIBC_ARCH} != "powerpc64" && \
- ${LIBC_ARCH} != "riscv" && \
- ${MACHINE_ARCH:Mmipsn32*} == "" && \
- ${MACHINE_ARCH:Mmips64*} == ""
+ ${LIBC_ARCH} != "riscv"
.include "${LIBC_SRCTOP}/quad/Makefile.inc"
.endif
.include "${LIBC_SRCTOP}/regex/Makefile.inc"
@@ -130,7 +128,6 @@ NOASM=
.include "${LIBC_SRCTOP}/xdr/Makefile.inc"
.if (${LIBC_ARCH} == "arm" && \
(${MACHINE_ARCH:Marmv[67]*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \
- (${LIBC_ARCH} == "mips" && ${MACHINE_ARCH:Mmips*hf} == "") || \
(${LIBC_ARCH} == "riscv" && ${MACHINE_ARCH:Mriscv*sf} != "")
.include "${LIBC_SRCTOP}/softfloat/Makefile.inc"
.endif
diff --git a/lib/libc/mips/Makefile.inc b/lib/libc/mips/Makefile.inc
deleted file mode 100644
index f340477ad22a..000000000000
--- a/lib/libc/mips/Makefile.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.7 2005/09/17 11:49:39 tsutsui Exp $
-# $FreeBSD$
-
-SRCS+= machdep_ldisd.c
-SYM_MAPS+= ${LIBC_SRCTOP}/mips/Symbol.map
diff --git a/lib/libc/mips/SYS.h b/lib/libc/mips/SYS.h
deleted file mode 100644
index c4767a5cd96b..000000000000
--- a/lib/libc/mips/SYS.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* $NetBSD: SYS.h,v 1.19 2009/12/14 01:07:41 matt Exp $ */
-/* $FreeBSD$ */
-
-/*-
- * SPDX-License-Identifier: (BSD-4-Clause AND BSD-3-Clause)
- *
- * 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)
diff --git a/lib/libc/mips/Symbol.map b/lib/libc/mips/Symbol.map
deleted file mode 100644
index 03c6ef2057c0..000000000000
--- a/lib/libc/mips/Symbol.map
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * $FreeBSD$
- */
-
-/*
- * 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;
-
- _mcount;
- _setjmp;
- _longjmp;
- alloca;
- fabs;
- __infinity;
- __nan;
- makecontext;
- setjmp;
- longjmp;
- sigsetjmp;
- siglongjmp;
- htonl;
- htons;
- ntohl;
- ntohs;
- vfork;
- brk;
- sbrk;
-};
-
-FBSD_1.3 {
- __flt_rounds;
-};
-
-FBSDprivate_1.0 {
- /* PSEUDO syscalls */
- _getlogin;
-
- ___longjmp;
- __makecontext;
- __longjmp;
- signalcontext;
- _signalcontext;
- __siglongjmp;
- _vfork;
- _brk;
- _sbrk;
-};
diff --git a/lib/libc/mips/_fpmath.h b/lib/libc/mips/_fpmath.h
deleted file mode 100644
index cece2fa81cb6..000000000000
--- a/lib/libc/mips/_fpmath.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2002, 2003 David Schultz <das@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$
- */
-
-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)
diff --git a/lib/libc/mips/arith.h b/lib/libc/mips/arith.h
deleted file mode 100644
index 61f3930f4a89..000000000000
--- a/lib/libc/mips/arith.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * MD header for contrib/gdtoa
- *
- * $FreeBSD$
- */
-
-/*
- * 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 */
-#define IEEE_8087
-#define Arith_Kind_ASL 1
-#define Long int
-#define Intcast (int)(long)
-#define Double_Align
-#endif
diff --git a/lib/libc/mips/gd_qnan.h b/lib/libc/mips/gd_qnan.h
deleted file mode 100644
index 69eeaf988fa0..000000000000
--- a/lib/libc/mips/gd_qnan.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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$
- */
-
-
-#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
diff --git a/lib/libc/mips/gen/Makefile.inc b/lib/libc/mips/gen/Makefile.inc
deleted file mode 100644
index c04f5356698f..000000000000
--- a/lib/libc/mips/gen/Makefile.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.27 2005/10/07 17:16:40 tsutsui Exp $
-# $FreeBSD$
-
-SRCS+= infinity.c fabs.c ldexp.c flt_rounds.c
-
-# SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
-# fpsetround.c fpsetsticky.c
-
-SRCS+= _ctx_start.S _setjmp.S makecontext.c \
- setjmp.S signalcontext.c sigsetjmp.S \
- trivial-getcontextx.c
diff --git a/lib/libc/mips/gen/_ctx_start.S b/lib/libc/mips/gen/_ctx_start.S
deleted file mode 100644
index f1f5cdc32641..000000000000
--- a/lib/libc/mips/gen/_ctx_start.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * 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$");
-
-/*
- * This requires makecontext() to setup a valid GP for locating
- * _ctx_done rather than deriving GP from T9 on entry. Currently this
- * uses the GP inherited from getcontext() assuming that getcontext()
- * is in the same shared object as _ctx_done(). For N32 and N64, GP
- * is caller-save so will be preserved across the call to the callback
- * function. For O32, GP is callee-save, so save it in a different
- * caller-save register (S1) while invoking the callback. This is
- * done instead of the usual SETUP_GP/SAVE_GP to avoid disturbing the
- * stack frame setup by makecontext() for the callback function.
- */
-ENTRY(_ctx_start)
-#ifdef __mips_o32
- move s1, gp
-#endif
- jalr t9
-
-#ifdef __mips_o32
- move gp, s1
-#endif
- move a0, s0
- PTR_LA t9, _ctx_done
- jalr t9
-
- break 0
-END(_ctx_start)
diff --git a/lib/libc/mips/gen/_setjmp.S b/lib/libc/mips/gen/_setjmp.S
deleted file mode 100644
index 10c4cda5e0c1..000000000000
--- a/lib/libc/mips/gen/_setjmp.S
+++ /dev/null
@@ -1,200 +0,0 @@
-/* $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$");
-
-#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 __mips_soft_float
- 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 /* ! __mips_soft_float */
- 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 __mips_soft_float
- # 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 /* ! __mips_soft_float */
-
- 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)
diff --git a/lib/libc/mips/gen/fabs.S b/lib/libc/mips/gen/fabs.S
deleted file mode 100644
index 3b79249864d1..000000000000
--- a/lib/libc/mips/gen/fabs.S
+++ /dev/null
@@ -1,58 +0,0 @@
-/* $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$");
-
-#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)
diff --git a/lib/libc/mips/gen/fabs.c b/lib/libc/mips/gen/fabs.c
deleted file mode 100644
index 9c51f43ff4e7..000000000000
--- a/lib/libc/mips/gen/fabs.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $NetBSD: fabs.c,v 1.2 2002/05/26 11:48:01 wiz Exp $ */
-
-/*-
- * SPDX-License-Identifier: BSD-4-Clause
- *
- * 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$");
-
-double
-fabs(double x)
-{
-
- return (__builtin_fabs(x));
-}
diff --git a/lib/libc/mips/gen/flt_rounds.c b/lib/libc/mips/gen/flt_rounds.c
deleted file mode 100644
index 27d8bf35315f..000000000000
--- a/lib/libc/mips/gen/flt_rounds.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $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$");
-#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 <fenv.h>
-#include <float.h>
-
-#ifdef __mips_soft_float
-#include "softfloat-for-gcc.h"
-#include "milieu.h"
-#include "softfloat.h"
-#endif
-
-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 mode;
-
-#ifdef __mips_soft_float
- mode = __softfloat_float_rounding_mode;
-#else
- __asm __volatile("cfc1 %0,$31" : "=r" (mode));
-#endif
-
- return map[mode & 0x03];
-}
diff --git a/lib/libc/mips/gen/hardfloat/fpgetmask.c b/lib/libc/mips/gen/hardfloat/fpgetmask.c
deleted file mode 100644
index 505a74c68466..000000000000
--- a/lib/libc/mips/gen/hardfloat/fpgetmask.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* $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$");
-#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;
-}
diff --git a/lib/libc/mips/gen/hardfloat/fpgetround.c b/lib/libc/mips/gen/hardfloat/fpgetround.c
deleted file mode 100644
index 6d0f11a5cb6e..000000000000
--- a/lib/libc/mips/gen/hardfloat/fpgetround.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* $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$");
-#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;
-}
*** 2831 LINES SKIPPED ***