]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Rename additional arm64 userland directories to aarch64
authorEd Maste <emaste@freebsd.org>
Mon, 23 Mar 2015 18:39:06 +0000 (14:39 -0400)
committerAndrew Turner <andrew@fubar.geek.nz>
Tue, 24 Mar 2015 11:46:41 +0000 (11:46 +0000)
62 files changed:
lib/csu/aarch64/Makefile [new file with mode: 0644]
lib/csu/aarch64/crt1.c [new file with mode: 0644]
lib/csu/aarch64/crti.S [new file with mode: 0644]
lib/csu/aarch64/crtn.S [new file with mode: 0644]
lib/csu/arm64/Makefile [deleted file]
lib/csu/arm64/crt1.c [deleted file]
lib/csu/arm64/crti.S [deleted file]
lib/csu/arm64/crtn.S [deleted file]
lib/libc/aarch64/Makefile.inc [new file with mode: 0644]
lib/libc/aarch64/SYS.h [new file with mode: 0644]
lib/libc/aarch64/Symbol.map [new file with mode: 0644]
lib/libc/aarch64/_fpmath.h [new file with mode: 0644]
lib/libc/aarch64/arith.h [new file with mode: 0644]
lib/libc/aarch64/gd_qnan.h [new file with mode: 0644]
lib/libc/aarch64/gen/Makefile.inc [new file with mode: 0644]
lib/libc/aarch64/gen/_set_tp.c [new file with mode: 0644]
lib/libc/aarch64/gen/_setjmp.S [new file with mode: 0644]
lib/libc/aarch64/gen/flt_rounds.c [new file with mode: 0644]
lib/libc/aarch64/gen/setjmp.S [new file with mode: 0644]
lib/libc/aarch64/gen/sigsetjmp.S [new file with mode: 0644]
lib/libc/aarch64/sys/Makefile.inc [new file with mode: 0644]
lib/libc/aarch64/sys/__vdso_gettc.c [new file with mode: 0644]
lib/libc/aarch64/sys/brk.S [new file with mode: 0644]
lib/libc/aarch64/sys/cerror.S [new file with mode: 0644]
lib/libc/aarch64/sys/pipe.S [new file with mode: 0644]
lib/libc/aarch64/sys/sbrk.S [new file with mode: 0644]
lib/libc/aarch64/sys/shmat.S [new file with mode: 0644]
lib/libc/aarch64/sys/sigreturn.S [new file with mode: 0644]
lib/libc/aarch64/sys/syscall.S [new file with mode: 0644]
lib/libc/aarch64/sys/vfork.S [new file with mode: 0644]
lib/libc/arm64/Makefile.inc [deleted file]
lib/libc/arm64/SYS.h [deleted file]
lib/libc/arm64/Symbol.map [deleted file]
lib/libc/arm64/_fpmath.h [deleted file]
lib/libc/arm64/arith.h [deleted file]
lib/libc/arm64/gd_qnan.h [deleted file]
lib/libc/arm64/gen/Makefile.inc [deleted file]
lib/libc/arm64/gen/_set_tp.c [deleted file]
lib/libc/arm64/gen/_setjmp.S [deleted file]
lib/libc/arm64/gen/flt_rounds.c [deleted file]
lib/libc/arm64/gen/setjmp.S [deleted file]
lib/libc/arm64/gen/sigsetjmp.S [deleted file]
lib/libc/arm64/sys/Makefile.inc [deleted file]
lib/libc/arm64/sys/__vdso_gettc.c [deleted file]
lib/libc/arm64/sys/brk.S [deleted file]
lib/libc/arm64/sys/cerror.S [deleted file]
lib/libc/arm64/sys/pipe.S [deleted file]
lib/libc/arm64/sys/sbrk.S [deleted file]
lib/libc/arm64/sys/shmat.S [deleted file]
lib/libc/arm64/sys/sigreturn.S [deleted file]
lib/libc/arm64/sys/syscall.S [deleted file]
lib/libc/arm64/sys/vfork.S [deleted file]
lib/libthr/arch/aarch64/Makefile.inc [new file with mode: 0644]
lib/libthr/arch/aarch64/include/pthread_md.h [new file with mode: 0644]
lib/libthr/arch/arm64/Makefile.inc [deleted file]
lib/libthr/arch/arm64/include/pthread_md.h [deleted file]
lib/msun/aarch64/Makefile.inc [new file with mode: 0644]
lib/msun/aarch64/fenv.c [new file with mode: 0644]
lib/msun/aarch64/fenv.h [new file with mode: 0644]
lib/msun/arm64/Makefile.inc [deleted file]
lib/msun/arm64/fenv.c [deleted file]
lib/msun/arm64/fenv.h [deleted file]

diff --git a/lib/csu/aarch64/Makefile b/lib/csu/aarch64/Makefile
new file mode 100644 (file)
index 0000000..bf4c7b1
--- /dev/null
@@ -0,0 +1,44 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../common
+
+SRCS=          crt1.c crti.S crtn.S
+OBJS=          ${SRCS:N*.h:R:S/$/.o/g}
+OBJS+=         Scrt1.o gcrt1.o
+CFLAGS+=       -I${.CURDIR}/../common \
+               -I${.CURDIR}/../../libc/include
+
+all: ${OBJS}
+
+CLEANFILES=    ${OBJS}
+CLEANFILES+=   crt1.s gcrt1.s Scrt1.s
+
+# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
+# directly compiled to .o files.
+
+crt1.s: crt1.c
+       ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
+       sed ${SED_FIX_NOTE} ${.TARGET}
+
+crt1.o: crt1.s
+       ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
+
+gcrt1.s: crt1.c
+       ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
+       sed ${SED_FIX_NOTE} ${.TARGET}
+
+gcrt1.o: gcrt1.s
+       ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
+
+Scrt1.s: crt1.c
+       ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
+       sed ${SED_FIX_NOTE} ${.TARGET}
+
+Scrt1.o: Scrt1.s
+       ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
+
+realinstall:
+       ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+           ${OBJS} ${DESTDIR}${LIBDIR}
+
+.include <bsd.lib.mk>
diff --git a/lib/csu/aarch64/crt1.c b/lib/csu/aarch64/crt1.c
new file mode 100644 (file)
index 0000000..6518e8d
--- /dev/null
@@ -0,0 +1,89 @@
+/* LINTLIBRARY */
+/*-
+ * Copyright 1996-1998 John D. Polstra.
+ * Copyright 2014 Andrew Turner.
+ * Copyright 2014-2015 The FreeBSD Foundation.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * 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$");
+
+#ifndef lint
+#ifndef __GNUC__
+#error "GCC is needed to compile this file"
+#endif
+#endif /* lint */
+
+#include <stdlib.h>
+
+#include "libc_private.h"
+#include "crtbrand.c"
+#include "ignore_init.c"
+
+#ifdef GCRT
+extern void _mcleanup(void);
+extern void monstartup(void *, void *);
+extern int eprol;
+extern int etext;
+#endif
+
+void __start(int, char **, char **, void (*)(void));
+
+/* The entry function. */
+__asm("        .text                   \n"
+"      .align  0               \n"
+"      .globl  _start          \n"
+"      _start:                 \n"
+"      mov     x3, x2          \n" /* cleanup */
+"      ldr     x0, [sp]        \n" /* Load argc */
+"      add     x1, sp, #8      \n" /* load argv */
+"      add     x2, x1, x0, lsl #3 \n" /* env is after argv */
+"      add     x2, x2, #8      \n" /* argv is null terminated */
+"      b        __start  ");
+
+
+/* The entry function. */
+void
+__start(int argc, char *argv[], char *env[], void (*cleanup)(void))
+{
+
+       handle_argv(argc, argv, env);
+
+       if (&_DYNAMIC != NULL)
+               atexit(cleanup);
+       else
+               _init_tls();
+
+#ifdef GCRT
+       atexit(_mcleanup);
+       monstartup(&eprol, &etext);
+__asm__("eprol:");
+#endif
+
+       handle_static_init(argc, argv, env);
+       exit(main(argc, argv, env));
+}
diff --git a/lib/csu/aarch64/crti.S b/lib/csu/aarch64/crti.S
new file mode 100644 (file)
index 0000000..13e3b74
--- /dev/null
@@ -0,0 +1,48 @@
+/*-
+ * Copyright 2001 David E. O'Brien
+ * Copyright 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * 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 <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+       .section .init,"ax",@progbits
+       .align 4
+       .globl  _init
+       .type   _init,@function
+_init:
+       sub     sp, sp, #16
+       str     lr, [sp]
+
+       .section .fini,"ax",@progbits
+       .align 4
+       .globl  _fini
+       .type   _fini,@function
+_fini:
+       sub     sp, sp, #16
+       str     lr, [sp]
+
diff --git a/lib/csu/aarch64/crtn.S b/lib/csu/aarch64/crtn.S
new file mode 100644 (file)
index 0000000..ebb59b7
--- /dev/null
@@ -0,0 +1,44 @@
+/*-
+ * Copyright 2001 David E. O'Brien
+ * Copyright 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * 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 <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+       .section .init,"ax",@progbits
+       ldr     lr, [sp]
+       add     sp, sp, #16
+       ret
+
+
+       .section .fini,"ax",@progbits
+       ldr     lr, [sp]
+       add     sp, sp, #16
+       ret
+
+       .section .note.GNU-stack,"",%progbits
diff --git a/lib/csu/arm64/Makefile b/lib/csu/arm64/Makefile
deleted file mode 100644 (file)
index bf4c7b1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# $FreeBSD$
-
-.PATH: ${.CURDIR}/../common
-
-SRCS=          crt1.c crti.S crtn.S
-OBJS=          ${SRCS:N*.h:R:S/$/.o/g}
-OBJS+=         Scrt1.o gcrt1.o
-CFLAGS+=       -I${.CURDIR}/../common \
-               -I${.CURDIR}/../../libc/include
-
-all: ${OBJS}
-
-CLEANFILES=    ${OBJS}
-CLEANFILES+=   crt1.s gcrt1.s Scrt1.s
-
-# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
-# directly compiled to .o files.
-
-crt1.s: crt1.c
-       ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
-       sed ${SED_FIX_NOTE} ${.TARGET}
-
-crt1.o: crt1.s
-       ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
-
-gcrt1.s: crt1.c
-       ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
-       sed ${SED_FIX_NOTE} ${.TARGET}
-
-gcrt1.o: gcrt1.s
-       ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
-
-Scrt1.s: crt1.c
-       ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
-       sed ${SED_FIX_NOTE} ${.TARGET}
-
-Scrt1.o: Scrt1.s
-       ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
-
-realinstall:
-       ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-           ${OBJS} ${DESTDIR}${LIBDIR}
-
-.include <bsd.lib.mk>
diff --git a/lib/csu/arm64/crt1.c b/lib/csu/arm64/crt1.c
deleted file mode 100644 (file)
index 6518e8d..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/* LINTLIBRARY */
-/*-
- * Copyright 1996-1998 John D. Polstra.
- * Copyright 2014 Andrew Turner.
- * Copyright 2014-2015 The FreeBSD Foundation.
- * All rights reserved.
- *
- * Portions of this software were developed by Andrew Turner
- * under sponsorship from the FreeBSD Foundation.
- *
- * 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$");
-
-#ifndef lint
-#ifndef __GNUC__
-#error "GCC is needed to compile this file"
-#endif
-#endif /* lint */
-
-#include <stdlib.h>
-
-#include "libc_private.h"
-#include "crtbrand.c"
-#include "ignore_init.c"
-
-#ifdef GCRT
-extern void _mcleanup(void);
-extern void monstartup(void *, void *);
-extern int eprol;
-extern int etext;
-#endif
-
-void __start(int, char **, char **, void (*)(void));
-
-/* The entry function. */
-__asm("        .text                   \n"
-"      .align  0               \n"
-"      .globl  _start          \n"
-"      _start:                 \n"
-"      mov     x3, x2          \n" /* cleanup */
-"      ldr     x0, [sp]        \n" /* Load argc */
-"      add     x1, sp, #8      \n" /* load argv */
-"      add     x2, x1, x0, lsl #3 \n" /* env is after argv */
-"      add     x2, x2, #8      \n" /* argv is null terminated */
-"      b        __start  ");
-
-
-/* The entry function. */
-void
-__start(int argc, char *argv[], char *env[], void (*cleanup)(void))
-{
-
-       handle_argv(argc, argv, env);
-
-       if (&_DYNAMIC != NULL)
-               atexit(cleanup);
-       else
-               _init_tls();
-
-#ifdef GCRT
-       atexit(_mcleanup);
-       monstartup(&eprol, &etext);
-__asm__("eprol:");
-#endif
-
-       handle_static_init(argc, argv, env);
-       exit(main(argc, argv, env));
-}
diff --git a/lib/csu/arm64/crti.S b/lib/csu/arm64/crti.S
deleted file mode 100644 (file)
index 13e3b74..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * Copyright 2001 David E. O'Brien
- * Copyright 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * Portions of this software were developed by Andrew Turner
- * under sponsorship from the FreeBSD Foundation.
- *
- * 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-       .section .init,"ax",@progbits
-       .align 4
-       .globl  _init
-       .type   _init,@function
-_init:
-       sub     sp, sp, #16
-       str     lr, [sp]
-
-       .section .fini,"ax",@progbits
-       .align 4
-       .globl  _fini
-       .type   _fini,@function
-_fini:
-       sub     sp, sp, #16
-       str     lr, [sp]
-
diff --git a/lib/csu/arm64/crtn.S b/lib/csu/arm64/crtn.S
deleted file mode 100644 (file)
index ebb59b7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * Copyright 2001 David E. O'Brien
- * Copyright 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * Portions of this software were developed by Andrew Turner
- * under sponsorship from the FreeBSD Foundation.
- *
- * 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 <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-       .section .init,"ax",@progbits
-       ldr     lr, [sp]
-       add     sp, sp, #16
-       ret
-
-
-       .section .fini,"ax",@progbits
-       ldr     lr, [sp]
-       add     sp, sp, #16
-       ret
-
-       .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/aarch64/Makefile.inc b/lib/libc/aarch64/Makefile.inc
new file mode 100644 (file)
index 0000000..5f17200
--- /dev/null
@@ -0,0 +1,9 @@
+# $FreeBSD$
+#
+# Machine dependent definitions for the arm 64-bit architecture.
+#
+
+# Long double is quad precision
+GDTOASRCS+=strtorQ.c
+MDSRCS+=machdep_ldisQ.c
+SYM_MAPS+=${LIBC_SRCTOP}/aarch64/Symbol.map
diff --git a/lib/libc/aarch64/SYS.h b/lib/libc/aarch64/SYS.h
new file mode 100644 (file)
index 0000000..b06765d
--- /dev/null
@@ -0,0 +1,63 @@
+/*-
+ * Copyright (c) 2002 Benno Rice.  All rights reserved.
+ * Copyright (c) 2002 David E. O'Brien.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of any 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 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.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/syscall.h>
+#include <machine/asm.h>
+
+#define        _SYSCALL(name)                                          \
+       mov     x8, SYS_ ## name;                               \
+       svc     0
+
+#define        SYSCALL(name)                                           \
+ENTRY(__sys_##name);                                           \
+       WEAK_REFERENCE(__sys_##name, name);                     \
+       WEAK_REFERENCE(__sys_##name, _##name);                  \
+       _SYSCALL(name);                                         \
+       ret;                                                    \
+END(__sys_##name)
+
+#define        PSEUDO(name)                                            \
+ENTRY(__sys_##name);                                           \
+       WEAK_REFERENCE(__sys_##name, _##name);                  \
+       _SYSCALL(name);                                         \
+       b.cs    cerror;                                         \
+       ret;                                                    \
+END(__sys_##name)
+
+#define        RSYSCALL(name)                                          \
+ENTRY(__sys_##name);                                           \
+       WEAK_REFERENCE(__sys_##name, name);                     \
+       WEAK_REFERENCE(__sys_##name, _##name);                  \
+       _SYSCALL(name);                                         \
+       b.cs    cerror;                                         \
+       ret;                                                    \
+END(__sys_##name)
+
diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map
new file mode 100644 (file)
index 0000000..5b21000
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * $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;
+
+       _setjmp;
+       _longjmp;
+       setjmp;
+       longjmp;
+       sigsetjmp;
+       siglongjmp;
+       vfork;
+       brk;
+       sbrk;
+};
+
+FBSDprivate_1.0 {
+       _set_tp;
+       curbrk;
+       minbrk;
+};
diff --git a/lib/libc/aarch64/_fpmath.h b/lib/libc/aarch64/_fpmath.h
new file mode 100644 (file)
index 0000000..71d0a71
--- /dev/null
@@ -0,0 +1,58 @@
+/*-
+ * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
+ * Copyright (2) 2014 The FreeBSD Foundation
+ * 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 {
+               unsigned long   manl    :64;
+               unsigned long   manh    :48;
+               unsigned int    exp     :15;
+               unsigned int    sign    :1;
+       } bits;
+       /* TODO andrew: Check the packing here */
+       struct {
+               unsigned long   manl    :64;
+               unsigned long   manh    :48;
+               unsigned int    expsign :16;
+       } xbits;
+};
+
+#define        LDBL_NBIT       0
+#define        LDBL_IMPLICIT_NBIT
+#define        mask_nbit_l(u)  ((void)0)
+
+#define        LDBL_MANH_SIZE  48
+#define        LDBL_MANL_SIZE  64
+
+#define        LDBL_TO_ARRAY32(u, a) do {                      \
+       (a)[0] = (uint32_t)(u).bits.manl;               \
+       (a)[1] = (uint32_t)((u).bits.manl >> 32);       \
+       (a)[2] = (uint32_t)(u).bits.manh;               \
+       (a)[3] = (uint32_t)((u).bits.manh >> 32);       \
+} while(0)
diff --git a/lib/libc/aarch64/arith.h b/lib/libc/aarch64/arith.h
new file mode 100644 (file)
index 0000000..b3eb0ef
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
+
+#define IEEE_8087
+#define Arith_Kind_ASL 1
+#define Double_Align
diff --git a/lib/libc/aarch64/gd_qnan.h b/lib/libc/aarch64/gd_qnan.h
new file mode 100644 (file)
index 0000000..8fa9edd
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ *
+ * XXX I don't have ARM hardware, so I just guessed.  --das
+ *
+ * $FreeBSD$
+ */
+
+#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
diff --git a/lib/libc/aarch64/gen/Makefile.inc b/lib/libc/aarch64/gen/Makefile.inc
new file mode 100644 (file)
index 0000000..32dea00
--- /dev/null
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+SRCS+= flt_rounds.c \
+       ldexp.c \
+       _setjmp.S \
+       _set_tp.c \
+       setjmp.S \
+       sigsetjmp.S \
+       trivial-getcontextx.c
diff --git a/lib/libc/aarch64/gen/_set_tp.c b/lib/libc/aarch64/gen/_set_tp.c
new file mode 100644 (file)
index 0000000..0e75b56
--- /dev/null
@@ -0,0 +1,41 @@
+/*-
+ * 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$
+ */
+
+#include <string.h>
+#include <sys/types.h>
+
+#include <machine/sysarch.h>
+
+#include <stdlib.h>
+
+void
+_set_tp(void *tp)
+{
+
+       asm volatile("msr       tpidr_el0, %0" : : "r"(tp));
+}
diff --git a/lib/libc/aarch64/gen/_setjmp.S b/lib/libc/aarch64/gen/_setjmp.S
new file mode 100644 (file)
index 0000000..0cb10c3
--- /dev/null
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 2014 Andrew Turner
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation
+ *
+ * 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$");
+
+#include <machine/setjmp.h>
+
+ENTRY(_setjmp)
+       /* Store the magic value and stack pointer */
+       ldr     x8, .Lmagic
+       mov     x9, sp
+       stp     x8, x9, [x0], #16
+
+       /* Store the general purpose registers and lr */
+       stp     x19, x20, [x0], #16
+       stp     x21, x22, [x0], #16
+       stp     x23, x24, [x0], #16
+       stp     x25, x26, [x0], #16
+       stp     x27, x28, [x0], #16
+       stp     x29, lr, [x0], #16
+
+#ifndef _STANDALONE
+       /* Store the vfp registers */
+       stp     d8, d9, [x0], #16
+       stp     d10, d11, [x0], #16
+       stp     d12, d13, [x0], #16
+       stp     d14, d15, [x0]
+#endif
+
+       /* Return value */
+       mov     x0, #0
+       ret
+.Lmagic:
+       .align  3
+       .quad   _JB_MAGIC__SETJMP
+END(_setjmp)
+
+ENTRY(_longjmp)
+       /* Check the magic value */
+       ldr     x8, [x0], #8
+       ldr     x9, .Lmagic
+       cmp     x8, x9
+       b.ne    botch
+
+       /* Restore the stack pointer */
+       ldr     x8, [x0], #8
+       mov     sp, x8
+
+       /* Restore the general purpose registers and lr */
+       ldp     x19, x20, [x0], #16
+       ldp     x21, x22, [x0], #16
+       ldp     x23, x24, [x0], #16
+       ldp     x25, x26, [x0], #16
+       ldp     x27, x28, [x0], #16
+       ldp     x29, lr, [x0], #16
+
+#ifndef _STANDALONE
+       /* Restore the vfp registers */
+       ldp     d8, d9, [x0], #16
+       ldp     d10, d11, [x0], #16
+       ldp     d12, d13, [x0], #16
+       ldp     d14, d15, [x0]
+#endif
+
+       /* Load the return value */
+       mov     x0, x1
+       ret
+
+botch:
+#ifdef _STANDALONE
+       b       botch
+#else
+       bl      _C_LABEL(longjmperror)
+       bl      _C_LABEL(abort)
+#endif
+END(_longjmp)
+
diff --git a/lib/libc/aarch64/gen/flt_rounds.c b/lib/libc/aarch64/gen/flt_rounds.c
new file mode 100644 (file)
index 0000000..8883825
--- /dev/null
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2012 Ian Lepore <freebsd@damnhippie.dyndns.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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <fenv.h>
+#include <float.h>
+
+int
+__flt_rounds(void)
+{
+       return (-1);
+}
diff --git a/lib/libc/aarch64/gen/setjmp.S b/lib/libc/aarch64/gen/setjmp.S
new file mode 100644 (file)
index 0000000..80a9484
--- /dev/null
@@ -0,0 +1,123 @@
+/*-
+ * Copyright (c) 2014 Andrew Turner
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation
+ *
+ * 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$");
+
+#include <machine/setjmp.h>
+
+ENTRY(setjmp)
+       sub     sp, sp, #16
+       stp     x0, lr, [sp]
+
+       /* Store the signal mask */
+       add     x2, x0, #(_JB_SIGMASK * 8)      /* oset */
+       mov     x1, #0                          /* set */
+       mov     x0, #1                          /* SIG_BLOCK */
+       bl      sigprocmask
+
+       ldp     x0, lr, [sp]
+       add     sp, sp, #16
+
+       /* Store the magic value and stack pointer */
+       ldr     x8, .Lmagic
+       mov     x9, sp
+       stp     x8, x9, [x0], #16
+
+       /* Store the general purpose registers and lr */
+       stp     x19, x20, [x0], #16
+       stp     x21, x22, [x0], #16
+       stp     x23, x24, [x0], #16
+       stp     x25, x26, [x0], #16
+       stp     x27, x28, [x0], #16
+       stp     x29, lr, [x0], #16
+
+       /* Store the vfp registers */
+       stp     d8, d9, [x0], #16
+       stp     d10, d11, [x0], #16
+       stp     d12, d13, [x0], #16
+       stp     d14, d15, [x0]
+
+       /* Return value */
+       mov     x0, #0
+       ret
+.Lmagic:
+       .align  3
+       .quad   _JB_MAGIC_SETJMP
+END(setjmp)
+
+ENTRY(longjmp)
+       sub     sp, sp, #32
+       stp     x0, lr, [sp]
+       str     x1, [sp, #16]
+
+       /* Restore the signal mask */
+       mov     x1, #0                          /* oset */
+       add     x1, x0, #(_JB_SIGMASK * 8)      /* set */
+       mov     x0, #3                          /* SIG_BLOCK */
+       bl      sigprocmask
+
+       ldr     x1, [sp, #16]
+       ldp     x0, lr, [sp]
+       add     sp, sp, #32
+
+       /* Check the magic value */
+       ldr     x8, [x0], #8
+       ldr     x9, .Lmagic
+       cmp     x8, x9
+       b.ne    botch
+
+       /* Restore the stack pointer */
+       ldr     x8, [x0], #8
+       mov     sp, x8
+
+       /* Restore the general purpose registers and lr */
+       ldp     x19, x20, [x0], #16
+       ldp     x21, x22, [x0], #16
+       ldp     x23, x24, [x0], #16
+       ldp     x25, x26, [x0], #16
+       ldp     x27, x28, [x0], #16
+       ldp     x29, lr, [x0], #16
+
+       /* Restore the vfp registers */
+       ldp     d8, d9, [x0], #16
+       ldp     d10, d11, [x0], #16
+       ldp     d12, d13, [x0], #16
+       ldp     d14, d15, [x0]
+
+       /* Load the return value */
+       mov     x0, x1
+       ret
+
+botch:
+       bl      _C_LABEL(longjmperror)
+       bl      _C_LABEL(abort)
+END(longjmp)
diff --git a/lib/libc/aarch64/gen/sigsetjmp.S b/lib/libc/aarch64/gen/sigsetjmp.S
new file mode 100644 (file)
index 0000000..8a13c9f
--- /dev/null
@@ -0,0 +1,53 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * 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$");
+
+#include <machine/setjmp.h>
+
+ENTRY(sigsetjmp)
+       cmp     x1, #0
+       b.eq    _C_LABEL(_setjmp)
+       b       _C_LABEL(setjmp)
+END(sigsetjmp)
+
+ENTRY(siglongjmp)
+       /* Load the _setjmp magic */
+       ldr     x2, .Lmagic
+       ldr     x3, [x0]
+
+       /* Check the magic */
+       cmp     x2, x3
+       b.eq    _C_LABEL(_longjmp)
+       b       _C_LABEL(longjmp)
+.Lmagic:
+       .align  3
+       .quad   _JB_MAGIC__SETJMP
+END(siglongjmp)
diff --git a/lib/libc/aarch64/sys/Makefile.inc b/lib/libc/aarch64/sys/Makefile.inc
new file mode 100644 (file)
index 0000000..2c937f8
--- /dev/null
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+SRCS+= __vdso_gettc.c
+
+#MDASM= ptrace.S
+MDASM= brk.S \
+       cerror.S \
+       pipe.S \
+       sbrk.S \
+       shmat.S \
+       sigreturn.S \
+       syscall.S \
+       vfork.S
+
+# Don't generate default code for these syscalls:
+NOASM= break.o \
+       exit.o \
+       getlogin.o \
+       openbsd_poll.o \
+       sstk.o \
+       vfork.o \
+       yield.o
+
+PSEUDO= _exit.o \
+       _getlogin.o
+.if ${MK_SYSCALL_COMPAT} != "no"
+PSEUDO+= _pread.o \
+       _pwrite.o \
+       _lseek.o \
+       _mmap.o \
+       _ftruncate.o \
+       _truncate.o
+.endif
diff --git a/lib/libc/aarch64/sys/__vdso_gettc.c b/lib/libc/aarch64/sys/__vdso_gettc.c
new file mode 100644 (file)
index 0000000..b99bbc4
--- /dev/null
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Konstantin Belousov <kib@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$");
+
+#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);
+}
diff --git a/lib/libc/aarch64/sys/brk.S b/lib/libc/aarch64/sys/brk.S
new file mode 100644 (file)
index 0000000..09167b6
--- /dev/null
@@ -0,0 +1,93 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * 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$");
+
+#include "SYS.h"
+
+       .data
+       .align  3
+       .globl  _C_LABEL(minbrk)
+       .type   _C_LABEL(minbrk),#object
+_C_LABEL(minbrk):
+       .quad   _C_LABEL(_end)
+
+       .text
+/*
+ * int brk(const void *addr);
+ */
+ENTRY(_brk)
+       WEAK_REFERENCE(_brk, brk)
+
+       /* Load the address of minbrk */
+#ifdef __PIC__
+       adrp    x2, :got:minbrk
+       ldr     x3, [x2, #:got_lo12:minbrk]
+#else
+       ldr     x3, .Lminbrk
+#endif
+
+       /* Get the minimum allowable brk address */
+       ldr     x2, [x3]
+
+       /* Validate the address */
+       cmp     x0, x2
+       b.ge    1f
+       /* Invalid, set it to the minimum */
+       mov     x0, x2
+
+       /* Backup the new address */
+1:     mov     x4, x0
+
+       /* Update for this value, will overwrite x0 and x1 */
+       _SYSCALL(break)
+       b.cs    cerror
+
+#ifdef __PIC__
+       adrp    x2, :got:curbrk
+       ldr     x3, [x2, #:got_lo12:curbrk]
+#else
+       ldr     x3, .Lcurbrk
+#endif
+
+       /* Store the new curbrk value */
+       str     x4, [x3]
+
+       /* Return success */
+       mov     x0, #0
+       ret
+
+#ifndef __PIC__
+.Lcurbrk:
+       .quad   _C_LABEL(curbrk)
+.Lminbrk:
+       .quad   _C_LABEL(minbrk)
+#endif
+END(_brk)
diff --git a/lib/libc/aarch64/sys/cerror.S b/lib/libc/aarch64/sys/cerror.S
new file mode 100644 (file)
index 0000000..26c61bc
--- /dev/null
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2014 Andrew Turner
+ * 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$");
+
+ENTRY(cerror)
+       sub     sp, sp, #16
+       stp     x0, lr, [sp]
+       bl      _C_LABEL(__error)
+       ldp     x1, lr, [sp]
+       str     x1, [x0]
+       movn    x0, #0
+       movn    x1, #0
+       add     sp, sp, #16
+       ret
+END(cerror)
diff --git a/lib/libc/aarch64/sys/pipe.S b/lib/libc/aarch64/sys/pipe.S
new file mode 100644 (file)
index 0000000..6b1cf24
--- /dev/null
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * 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$");
+
+#include "SYS.h"
+
+ENTRY(__sys_pipe)
+       WEAK_REFERENCE(__sys_pipe, pipe)
+
+       /* Backup the pointer passed to us */
+       mov     x2, x0
+
+       /* Make the syscall */
+       _SYSCALL(pipe)
+       b.cs    cerror
+
+       /* Store the result */
+       str     w0, [x2, #0]
+       str     w1, [x2, #4]
+
+       /* Return */
+       mov     x0, #0
+       ret
+END(__sys_pipe)
diff --git a/lib/libc/aarch64/sys/sbrk.S b/lib/libc/aarch64/sys/sbrk.S
new file mode 100644 (file)
index 0000000..db9d7e1
--- /dev/null
@@ -0,0 +1,79 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * 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$");
+
+#include "SYS.h"
+
+       .data
+       .align  3
+       .global _C_LABEL(curbrk)
+       .type   _C_LABEL(curbrk),#object
+_C_LABEL(curbrk):
+       .quad   _C_LABEL(_end)
+
+       .text
+/*
+ * void *sbrk(intptr_t incr);
+ */
+ENTRY(_sbrk)
+       WEAK_REFERENCE(_sbrk, sbrk)
+
+       /* Load the address of curbrk */
+#ifdef __PIC__
+       adrp    x2, :got:curbrk
+       ldr     x3, [x2, #:got_lo12:curbrk]
+#else
+       ldr     x3, .Lcurbrk
+#endif
+
+       /* Get the current brk address */
+       ldr     x2, [x3]
+
+       /* Calculate the new value */
+       add     x0, x2, x0
+       mov     x4, x0
+
+       /* Update for this value, will overwrite x0 and x1 */
+       _SYSCALL(break)
+       b.cs    cerror
+
+       /* Load the old value to return */
+       ldr     x0, [x3]
+
+       /* Store the new curbrk value */
+       str     x4, [x3]
+
+       ret
+#ifndef __PIC__
+.Lcurbrk:
+       .quad   _C_LABEL(curbrk)
+#endif
+END(_sbrk)
diff --git a/lib/libc/aarch64/sys/shmat.S b/lib/libc/aarch64/sys/shmat.S
new file mode 100644 (file)
index 0000000..c0fb34f
--- /dev/null
@@ -0,0 +1,35 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * 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$");
+
+#include "SYS.h"
+
+RSYSCALL(shmat)
diff --git a/lib/libc/aarch64/sys/sigreturn.S b/lib/libc/aarch64/sys/sigreturn.S
new file mode 100644 (file)
index 0000000..21ec1e4
--- /dev/null
@@ -0,0 +1,35 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * 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$");
+
+#include "SYS.h"
+
+RSYSCALL(sigreturn)
diff --git a/lib/libc/aarch64/sys/syscall.S b/lib/libc/aarch64/sys/syscall.S
new file mode 100644 (file)
index 0000000..6314835
--- /dev/null
@@ -0,0 +1,35 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * 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$");
+
+#include "SYS.h"
+
+RSYSCALL(syscall)
diff --git a/lib/libc/aarch64/sys/vfork.S b/lib/libc/aarch64/sys/vfork.S
new file mode 100644 (file)
index 0000000..daecd1f
--- /dev/null
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 2014 Andrew Turner
+ * 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$");
+#include "SYS.h"
+
+ENTRY(__sys_vfork)
+       WEAK_REFERENCE(__sys_vfork, vfork)
+       WEAK_REFERENCE(__sys_vfork, _vfork)
+       mov     x2, lr
+       _SYSCALL(vfork)
+       b.cs    cerror
+       sub     x1, x1, #1
+       and     x0, x0, x1
+       mov     lr, x2
+       ret
+END(__sys_vfork)
diff --git a/lib/libc/arm64/Makefile.inc b/lib/libc/arm64/Makefile.inc
deleted file mode 100644 (file)
index 5f17200..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# $FreeBSD$
-#
-# Machine dependent definitions for the arm 64-bit architecture.
-#
-
-# Long double is quad precision
-GDTOASRCS+=strtorQ.c
-MDSRCS+=machdep_ldisQ.c
-SYM_MAPS+=${LIBC_SRCTOP}/aarch64/Symbol.map
diff --git a/lib/libc/arm64/SYS.h b/lib/libc/arm64/SYS.h
deleted file mode 100644 (file)
index b06765d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * Copyright (c) 2002 Benno Rice.  All rights reserved.
- * Copyright (c) 2002 David E. O'Brien.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any 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 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.
- *
- * $FreeBSD$
- */
-
-#include <sys/syscall.h>
-#include <machine/asm.h>
-
-#define        _SYSCALL(name)                                          \
-       mov     x8, SYS_ ## name;                               \
-       svc     0
-
-#define        SYSCALL(name)                                           \
-ENTRY(__sys_##name);                                           \
-       WEAK_REFERENCE(__sys_##name, name);                     \
-       WEAK_REFERENCE(__sys_##name, _##name);                  \
-       _SYSCALL(name);                                         \
-       ret;                                                    \
-END(__sys_##name)
-
-#define        PSEUDO(name)                                            \
-ENTRY(__sys_##name);                                           \
-       WEAK_REFERENCE(__sys_##name, _##name);                  \
-       _SYSCALL(name);                                         \
-       b.cs    cerror;                                         \
-       ret;                                                    \
-END(__sys_##name)
-
-#define        RSYSCALL(name)                                          \
-ENTRY(__sys_##name);                                           \
-       WEAK_REFERENCE(__sys_##name, name);                     \
-       WEAK_REFERENCE(__sys_##name, _##name);                  \
-       _SYSCALL(name);                                         \
-       b.cs    cerror;                                         \
-       ret;                                                    \
-END(__sys_##name)
-
diff --git a/lib/libc/arm64/Symbol.map b/lib/libc/arm64/Symbol.map
deleted file mode 100644 (file)
index 5b21000..0000000
+++ /dev/null
@@ -1,29 +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;
-
-       _setjmp;
-       _longjmp;
-       setjmp;
-       longjmp;
-       sigsetjmp;
-       siglongjmp;
-       vfork;
-       brk;
-       sbrk;
-};
-
-FBSDprivate_1.0 {
-       _set_tp;
-       curbrk;
-       minbrk;
-};
diff --git a/lib/libc/arm64/_fpmath.h b/lib/libc/arm64/_fpmath.h
deleted file mode 100644 (file)
index 71d0a71..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
- * Copyright (2) 2014 The FreeBSD Foundation
- * 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 {
-               unsigned long   manl    :64;
-               unsigned long   manh    :48;
-               unsigned int    exp     :15;
-               unsigned int    sign    :1;
-       } bits;
-       /* TODO andrew: Check the packing here */
-       struct {
-               unsigned long   manl    :64;
-               unsigned long   manh    :48;
-               unsigned int    expsign :16;
-       } xbits;
-};
-
-#define        LDBL_NBIT       0
-#define        LDBL_IMPLICIT_NBIT
-#define        mask_nbit_l(u)  ((void)0)
-
-#define        LDBL_MANH_SIZE  48
-#define        LDBL_MANL_SIZE  64
-
-#define        LDBL_TO_ARRAY32(u, a) do {                      \
-       (a)[0] = (uint32_t)(u).bits.manl;               \
-       (a)[1] = (uint32_t)((u).bits.manl >> 32);       \
-       (a)[2] = (uint32_t)(u).bits.manh;               \
-       (a)[3] = (uint32_t)((u).bits.manh >> 32);       \
-} while(0)
diff --git a/lib/libc/arm64/arith.h b/lib/libc/arm64/arith.h
deleted file mode 100644 (file)
index b3eb0ef..0000000
+++ /dev/null
@@ -1,16 +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.
- */
-
-#define IEEE_8087
-#define Arith_Kind_ASL 1
-#define Double_Align
diff --git a/lib/libc/arm64/gd_qnan.h b/lib/libc/arm64/gd_qnan.h
deleted file mode 100644 (file)
index 8fa9edd..0000000
+++ /dev/null
@@ -1,23 +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.
- *
- * XXX I don't have ARM hardware, so I just guessed.  --das
- *
- * $FreeBSD$
- */
-
-#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
diff --git a/lib/libc/arm64/gen/Makefile.inc b/lib/libc/arm64/gen/Makefile.inc
deleted file mode 100644 (file)
index 32dea00..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# $FreeBSD$
-
-SRCS+= flt_rounds.c \
-       ldexp.c \
-       _setjmp.S \
-       _set_tp.c \
-       setjmp.S \
-       sigsetjmp.S \
-       trivial-getcontextx.c
diff --git a/lib/libc/arm64/gen/_set_tp.c b/lib/libc/arm64/gen/_set_tp.c
deleted file mode 100644 (file)
index 0e75b56..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * 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$
- */
-
-#include <string.h>
-#include <sys/types.h>
-
-#include <machine/sysarch.h>
-
-#include <stdlib.h>
-
-void
-_set_tp(void *tp)
-{
-
-       asm volatile("msr       tpidr_el0, %0" : : "r"(tp));
-}
diff --git a/lib/libc/arm64/gen/_setjmp.S b/lib/libc/arm64/gen/_setjmp.S
deleted file mode 100644 (file)
index 0cb10c3..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * Portions of this software were developed by Andrew Turner
- * under sponsorship from the FreeBSD Foundation
- *
- * 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$");
-
-#include <machine/setjmp.h>
-
-ENTRY(_setjmp)
-       /* Store the magic value and stack pointer */
-       ldr     x8, .Lmagic
-       mov     x9, sp
-       stp     x8, x9, [x0], #16
-
-       /* Store the general purpose registers and lr */
-       stp     x19, x20, [x0], #16
-       stp     x21, x22, [x0], #16
-       stp     x23, x24, [x0], #16
-       stp     x25, x26, [x0], #16
-       stp     x27, x28, [x0], #16
-       stp     x29, lr, [x0], #16
-
-#ifndef _STANDALONE
-       /* Store the vfp registers */
-       stp     d8, d9, [x0], #16
-       stp     d10, d11, [x0], #16
-       stp     d12, d13, [x0], #16
-       stp     d14, d15, [x0]
-#endif
-
-       /* Return value */
-       mov     x0, #0
-       ret
-.Lmagic:
-       .align  3
-       .quad   _JB_MAGIC__SETJMP
-END(_setjmp)
-
-ENTRY(_longjmp)
-       /* Check the magic value */
-       ldr     x8, [x0], #8
-       ldr     x9, .Lmagic
-       cmp     x8, x9
-       b.ne    botch
-
-       /* Restore the stack pointer */
-       ldr     x8, [x0], #8
-       mov     sp, x8
-
-       /* Restore the general purpose registers and lr */
-       ldp     x19, x20, [x0], #16
-       ldp     x21, x22, [x0], #16
-       ldp     x23, x24, [x0], #16
-       ldp     x25, x26, [x0], #16
-       ldp     x27, x28, [x0], #16
-       ldp     x29, lr, [x0], #16
-
-#ifndef _STANDALONE
-       /* Restore the vfp registers */
-       ldp     d8, d9, [x0], #16
-       ldp     d10, d11, [x0], #16
-       ldp     d12, d13, [x0], #16
-       ldp     d14, d15, [x0]
-#endif
-
-       /* Load the return value */
-       mov     x0, x1
-       ret
-
-botch:
-#ifdef _STANDALONE
-       b       botch
-#else
-       bl      _C_LABEL(longjmperror)
-       bl      _C_LABEL(abort)
-#endif
-END(_longjmp)
-
diff --git a/lib/libc/arm64/gen/flt_rounds.c b/lib/libc/arm64/gen/flt_rounds.c
deleted file mode 100644 (file)
index 8883825..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * Copyright (c) 2012 Ian Lepore <freebsd@damnhippie.dyndns.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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <fenv.h>
-#include <float.h>
-
-int
-__flt_rounds(void)
-{
-       return (-1);
-}
diff --git a/lib/libc/arm64/gen/setjmp.S b/lib/libc/arm64/gen/setjmp.S
deleted file mode 100644 (file)
index 80a9484..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * Portions of this software were developed by Andrew Turner
- * under sponsorship from the FreeBSD Foundation
- *
- * 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$");
-
-#include <machine/setjmp.h>
-
-ENTRY(setjmp)
-       sub     sp, sp, #16
-       stp     x0, lr, [sp]
-
-       /* Store the signal mask */
-       add     x2, x0, #(_JB_SIGMASK * 8)      /* oset */
-       mov     x1, #0                          /* set */
-       mov     x0, #1                          /* SIG_BLOCK */
-       bl      sigprocmask
-
-       ldp     x0, lr, [sp]
-       add     sp, sp, #16
-
-       /* Store the magic value and stack pointer */
-       ldr     x8, .Lmagic
-       mov     x9, sp
-       stp     x8, x9, [x0], #16
-
-       /* Store the general purpose registers and lr */
-       stp     x19, x20, [x0], #16
-       stp     x21, x22, [x0], #16
-       stp     x23, x24, [x0], #16
-       stp     x25, x26, [x0], #16
-       stp     x27, x28, [x0], #16
-       stp     x29, lr, [x0], #16
-
-       /* Store the vfp registers */
-       stp     d8, d9, [x0], #16
-       stp     d10, d11, [x0], #16
-       stp     d12, d13, [x0], #16
-       stp     d14, d15, [x0]
-
-       /* Return value */
-       mov     x0, #0
-       ret
-.Lmagic:
-       .align  3
-       .quad   _JB_MAGIC_SETJMP
-END(setjmp)
-
-ENTRY(longjmp)
-       sub     sp, sp, #32
-       stp     x0, lr, [sp]
-       str     x1, [sp, #16]
-
-       /* Restore the signal mask */
-       mov     x1, #0                          /* oset */
-       add     x1, x0, #(_JB_SIGMASK * 8)      /* set */
-       mov     x0, #3                          /* SIG_BLOCK */
-       bl      sigprocmask
-
-       ldr     x1, [sp, #16]
-       ldp     x0, lr, [sp]
-       add     sp, sp, #32
-
-       /* Check the magic value */
-       ldr     x8, [x0], #8
-       ldr     x9, .Lmagic
-       cmp     x8, x9
-       b.ne    botch
-
-       /* Restore the stack pointer */
-       ldr     x8, [x0], #8
-       mov     sp, x8
-
-       /* Restore the general purpose registers and lr */
-       ldp     x19, x20, [x0], #16
-       ldp     x21, x22, [x0], #16
-       ldp     x23, x24, [x0], #16
-       ldp     x25, x26, [x0], #16
-       ldp     x27, x28, [x0], #16
-       ldp     x29, lr, [x0], #16
-
-       /* Restore the vfp registers */
-       ldp     d8, d9, [x0], #16
-       ldp     d10, d11, [x0], #16
-       ldp     d12, d13, [x0], #16
-       ldp     d14, d15, [x0]
-
-       /* Load the return value */
-       mov     x0, x1
-       ret
-
-botch:
-       bl      _C_LABEL(longjmperror)
-       bl      _C_LABEL(abort)
-END(longjmp)
diff --git a/lib/libc/arm64/gen/sigsetjmp.S b/lib/libc/arm64/gen/sigsetjmp.S
deleted file mode 100644 (file)
index 8a13c9f..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner under
- * sponsorship from the FreeBSD Foundation.
- *
- * 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$");
-
-#include <machine/setjmp.h>
-
-ENTRY(sigsetjmp)
-       cmp     x1, #0
-       b.eq    _C_LABEL(_setjmp)
-       b       _C_LABEL(setjmp)
-END(sigsetjmp)
-
-ENTRY(siglongjmp)
-       /* Load the _setjmp magic */
-       ldr     x2, .Lmagic
-       ldr     x3, [x0]
-
-       /* Check the magic */
-       cmp     x2, x3
-       b.eq    _C_LABEL(_longjmp)
-       b       _C_LABEL(longjmp)
-.Lmagic:
-       .align  3
-       .quad   _JB_MAGIC__SETJMP
-END(siglongjmp)
diff --git a/lib/libc/arm64/sys/Makefile.inc b/lib/libc/arm64/sys/Makefile.inc
deleted file mode 100644 (file)
index 2c937f8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# $FreeBSD$
-
-SRCS+= __vdso_gettc.c
-
-#MDASM= ptrace.S
-MDASM= brk.S \
-       cerror.S \
-       pipe.S \
-       sbrk.S \
-       shmat.S \
-       sigreturn.S \
-       syscall.S \
-       vfork.S
-
-# Don't generate default code for these syscalls:
-NOASM= break.o \
-       exit.o \
-       getlogin.o \
-       openbsd_poll.o \
-       sstk.o \
-       vfork.o \
-       yield.o
-
-PSEUDO= _exit.o \
-       _getlogin.o
-.if ${MK_SYSCALL_COMPAT} != "no"
-PSEUDO+= _pread.o \
-       _pwrite.o \
-       _lseek.o \
-       _mmap.o \
-       _ftruncate.o \
-       _truncate.o
-.endif
diff --git a/lib/libc/arm64/sys/__vdso_gettc.c b/lib/libc/arm64/sys/__vdso_gettc.c
deleted file mode 100644 (file)
index b99bbc4..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * Copyright (c) 2013 Konstantin Belousov <kib@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$");
-
-#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);
-}
diff --git a/lib/libc/arm64/sys/brk.S b/lib/libc/arm64/sys/brk.S
deleted file mode 100644 (file)
index 09167b6..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner under
- * sponsorship from the FreeBSD Foundation.
- *
- * 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$");
-
-#include "SYS.h"
-
-       .data
-       .align  3
-       .globl  _C_LABEL(minbrk)
-       .type   _C_LABEL(minbrk),#object
-_C_LABEL(minbrk):
-       .quad   _C_LABEL(_end)
-
-       .text
-/*
- * int brk(const void *addr);
- */
-ENTRY(_brk)
-       WEAK_REFERENCE(_brk, brk)
-
-       /* Load the address of minbrk */
-#ifdef __PIC__
-       adrp    x2, :got:minbrk
-       ldr     x3, [x2, #:got_lo12:minbrk]
-#else
-       ldr     x3, .Lminbrk
-#endif
-
-       /* Get the minimum allowable brk address */
-       ldr     x2, [x3]
-
-       /* Validate the address */
-       cmp     x0, x2
-       b.ge    1f
-       /* Invalid, set it to the minimum */
-       mov     x0, x2
-
-       /* Backup the new address */
-1:     mov     x4, x0
-
-       /* Update for this value, will overwrite x0 and x1 */
-       _SYSCALL(break)
-       b.cs    cerror
-
-#ifdef __PIC__
-       adrp    x2, :got:curbrk
-       ldr     x3, [x2, #:got_lo12:curbrk]
-#else
-       ldr     x3, .Lcurbrk
-#endif
-
-       /* Store the new curbrk value */
-       str     x4, [x3]
-
-       /* Return success */
-       mov     x0, #0
-       ret
-
-#ifndef __PIC__
-.Lcurbrk:
-       .quad   _C_LABEL(curbrk)
-.Lminbrk:
-       .quad   _C_LABEL(minbrk)
-#endif
-END(_brk)
diff --git a/lib/libc/arm64/sys/cerror.S b/lib/libc/arm64/sys/cerror.S
deleted file mode 100644 (file)
index 26c61bc..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
- * 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$");
-
-ENTRY(cerror)
-       sub     sp, sp, #16
-       stp     x0, lr, [sp]
-       bl      _C_LABEL(__error)
-       ldp     x1, lr, [sp]
-       str     x1, [x0]
-       movn    x0, #0
-       movn    x1, #0
-       add     sp, sp, #16
-       ret
-END(cerror)
diff --git a/lib/libc/arm64/sys/pipe.S b/lib/libc/arm64/sys/pipe.S
deleted file mode 100644 (file)
index 6b1cf24..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner under
- * sponsorship from the FreeBSD Foundation.
- *
- * 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$");
-
-#include "SYS.h"
-
-ENTRY(__sys_pipe)
-       WEAK_REFERENCE(__sys_pipe, pipe)
-
-       /* Backup the pointer passed to us */
-       mov     x2, x0
-
-       /* Make the syscall */
-       _SYSCALL(pipe)
-       b.cs    cerror
-
-       /* Store the result */
-       str     w0, [x2, #0]
-       str     w1, [x2, #4]
-
-       /* Return */
-       mov     x0, #0
-       ret
-END(__sys_pipe)
diff --git a/lib/libc/arm64/sys/sbrk.S b/lib/libc/arm64/sys/sbrk.S
deleted file mode 100644 (file)
index db9d7e1..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner under
- * sponsorship from the FreeBSD Foundation.
- *
- * 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$");
-
-#include "SYS.h"
-
-       .data
-       .align  3
-       .global _C_LABEL(curbrk)
-       .type   _C_LABEL(curbrk),#object
-_C_LABEL(curbrk):
-       .quad   _C_LABEL(_end)
-
-       .text
-/*
- * void *sbrk(intptr_t incr);
- */
-ENTRY(_sbrk)
-       WEAK_REFERENCE(_sbrk, sbrk)
-
-       /* Load the address of curbrk */
-#ifdef __PIC__
-       adrp    x2, :got:curbrk
-       ldr     x3, [x2, #:got_lo12:curbrk]
-#else
-       ldr     x3, .Lcurbrk
-#endif
-
-       /* Get the current brk address */
-       ldr     x2, [x3]
-
-       /* Calculate the new value */
-       add     x0, x2, x0
-       mov     x4, x0
-
-       /* Update for this value, will overwrite x0 and x1 */
-       _SYSCALL(break)
-       b.cs    cerror
-
-       /* Load the old value to return */
-       ldr     x0, [x3]
-
-       /* Store the new curbrk value */
-       str     x4, [x3]
-
-       ret
-#ifndef __PIC__
-.Lcurbrk:
-       .quad   _C_LABEL(curbrk)
-#endif
-END(_sbrk)
diff --git a/lib/libc/arm64/sys/shmat.S b/lib/libc/arm64/sys/shmat.S
deleted file mode 100644 (file)
index c0fb34f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner under
- * sponsorship from the FreeBSD Foundation.
- *
- * 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$");
-
-#include "SYS.h"
-
-RSYSCALL(shmat)
diff --git a/lib/libc/arm64/sys/sigreturn.S b/lib/libc/arm64/sys/sigreturn.S
deleted file mode 100644 (file)
index 21ec1e4..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner under
- * sponsorship from the FreeBSD Foundation.
- *
- * 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$");
-
-#include "SYS.h"
-
-RSYSCALL(sigreturn)
diff --git a/lib/libc/arm64/sys/syscall.S b/lib/libc/arm64/sys/syscall.S
deleted file mode 100644 (file)
index 6314835..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Andrew Turner under
- * sponsorship from the FreeBSD Foundation.
- *
- * 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$");
-
-#include "SYS.h"
-
-RSYSCALL(syscall)
diff --git a/lib/libc/arm64/sys/vfork.S b/lib/libc/arm64/sys/vfork.S
deleted file mode 100644 (file)
index daecd1f..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
- * 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$");
-#include "SYS.h"
-
-ENTRY(__sys_vfork)
-       WEAK_REFERENCE(__sys_vfork, vfork)
-       WEAK_REFERENCE(__sys_vfork, _vfork)
-       mov     x2, lr
-       _SYSCALL(vfork)
-       b.cs    cerror
-       sub     x1, x1, #1
-       and     x0, x0, x1
-       mov     lr, x2
-       ret
-END(__sys_vfork)
diff --git a/lib/libthr/arch/aarch64/Makefile.inc b/lib/libthr/arch/aarch64/Makefile.inc
new file mode 100644 (file)
index 0000000..b720e3d
--- /dev/null
@@ -0,0 +1,2 @@
+# $FreeBSD$
+
diff --git a/lib/libthr/arch/aarch64/include/pthread_md.h b/lib/libthr/arch/aarch64/include/pthread_md.h
new file mode 100644 (file)
index 0000000..baec687
--- /dev/null
@@ -0,0 +1,83 @@
+/*-
+ * Copyright (c) 2005 David Xu <davidxu@freebsd.org>.
+ * Copyright (c) 2014 the FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation
+ *
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * Machine-dependent thread prototypes/definitions.
+ */
+#ifndef _PTHREAD_MD_H_
+#define        _PTHREAD_MD_H_
+
+#include <sys/types.h>
+#include <machine/sysarch.h>
+#include <stddef.h>
+
+#define        CPU_SPINWAIT
+#define        DTV_OFFSET              offsetof(struct tcb, tcb_dtv)
+
+/*
+ * Variant II tcb, first two members are required by rtld.
+ */
+struct tcb {
+       void                    *tcb_dtv;       /* required by rtld */
+       struct pthread          *tcb_thread;    /* our hook */
+};
+
+/* Called from the thread to set its private data. */
+static __inline void
+_tcb_set(struct tcb *tcb)
+{
+       __asm __volatile("msr   tpidr_el0, %x0" :: "r" (tcb));
+}
+
+/*
+ * Get the current tcb.
+ */
+static __inline struct tcb *
+_tcb_get(void)
+{
+       struct tcb *tcb;
+
+       __asm __volatile("mrs   %x0, tpidr_el0" : "=r" (tcb));
+       return (tcb);
+}
+
+extern struct pthread *_thr_initial;
+
+static __inline struct pthread *
+_get_curthread(void)
+{
+       if (_thr_initial)
+               return (_tcb_get()->tcb_thread);
+       return (NULL);
+}
+
+#endif /* _PTHREAD_MD_H_ */
diff --git a/lib/libthr/arch/arm64/Makefile.inc b/lib/libthr/arch/arm64/Makefile.inc
deleted file mode 100644 (file)
index b720e3d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# $FreeBSD$
-
diff --git a/lib/libthr/arch/arm64/include/pthread_md.h b/lib/libthr/arch/arm64/include/pthread_md.h
deleted file mode 100644 (file)
index baec687..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*-
- * Copyright (c) 2005 David Xu <davidxu@freebsd.org>.
- * Copyright (c) 2014 the FreeBSD Foundation
- * All rights reserved.
- *
- * Portions of this software were developed by Andrew Turner
- * under sponsorship from the FreeBSD Foundation
- *
- * 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.
- *
- * $FreeBSD$
- */
-
-/*
- * Machine-dependent thread prototypes/definitions.
- */
-#ifndef _PTHREAD_MD_H_
-#define        _PTHREAD_MD_H_
-
-#include <sys/types.h>
-#include <machine/sysarch.h>
-#include <stddef.h>
-
-#define        CPU_SPINWAIT
-#define        DTV_OFFSET              offsetof(struct tcb, tcb_dtv)
-
-/*
- * Variant II tcb, first two members are required by rtld.
- */
-struct tcb {
-       void                    *tcb_dtv;       /* required by rtld */
-       struct pthread          *tcb_thread;    /* our hook */
-};
-
-/* Called from the thread to set its private data. */
-static __inline void
-_tcb_set(struct tcb *tcb)
-{
-       __asm __volatile("msr   tpidr_el0, %x0" :: "r" (tcb));
-}
-
-/*
- * Get the current tcb.
- */
-static __inline struct tcb *
-_tcb_get(void)
-{
-       struct tcb *tcb;
-
-       __asm __volatile("mrs   %x0, tpidr_el0" : "=r" (tcb));
-       return (tcb);
-}
-
-extern struct pthread *_thr_initial;
-
-static __inline struct pthread *
-_get_curthread(void)
-{
-       if (_thr_initial)
-               return (_tcb_get()->tcb_thread);
-       return (NULL);
-}
-
-#endif /* _PTHREAD_MD_H_ */
diff --git a/lib/msun/aarch64/Makefile.inc b/lib/msun/aarch64/Makefile.inc
new file mode 100644 (file)
index 0000000..286a608
--- /dev/null
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+LDBL_PREC = 113
+
diff --git a/lib/msun/aarch64/fenv.c b/lib/msun/aarch64/fenv.c
new file mode 100644 (file)
index 0000000..4ec362f
--- /dev/null
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
+ * Copyright (c) 2013 Andrew Turner <andrew@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$
+ */
+
+#define        __fenv_static
+#include "fenv.h"
+
+/*
+ * Hopefully the system ID byte is immutable, so it's valid to use
+ * this as a default environment.
+ */
+const fenv_t __fe_dfl_env = 0;
+
+#ifdef __GNUC_GNU_INLINE__
+#error "This file must be compiled with C99 'inline' semantics"
+#endif
+
+extern inline int feclearexcept(int __excepts);
+extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts);
+extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
+extern inline int feraiseexcept(int __excepts);
+extern inline int fetestexcept(int __excepts);
+extern inline int fegetround(void);
+extern inline int fesetround(int __round);
+extern inline int fegetenv(fenv_t *__envp);
+extern inline int feholdexcept(fenv_t *__envp);
+extern inline int fesetenv(const fenv_t *__envp);
+extern inline int feupdateenv(const fenv_t *__envp);
+extern inline int feenableexcept(int __mask);
+extern inline int fedisableexcept(int __mask);
+extern inline int fegetexcept(void);
diff --git a/lib/msun/aarch64/fenv.h b/lib/msun/aarch64/fenv.h
new file mode 100644 (file)
index 0000000..2bd2987
--- /dev/null
@@ -0,0 +1,246 @@
+/*-
+ * Copyright (c) 2004-2005 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$
+ */
+
+#ifndef        _FENV_H_
+#define        _FENV_H_
+
+#include <sys/_types.h>
+
+#ifndef        __fenv_static
+#define        __fenv_static   static
+#endif
+
+typedef        __uint64_t      fenv_t;
+typedef        __uint64_t      fexcept_t;
+
+/* Exception flags */
+#define        FE_INVALID      0x00000001
+#define        FE_DIVBYZERO    0x00000002
+#define        FE_OVERFLOW     0x00000004
+#define        FE_UNDERFLOW    0x00000008
+#define        FE_INEXACT      0x00000010
+#define        FE_ALL_EXCEPT   (FE_DIVBYZERO | FE_INEXACT | \
+                        FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
+
+/*
+ * Rounding modes
+ *
+ * We can't just use the hardware bit values here, because that would
+ * make FE_UPWARD and FE_DOWNWARD negative, which is not allowed.
+ */
+#define        FE_TONEAREST    0x0
+#define        FE_UPWARD       0x1
+#define        FE_DOWNWARD     0x2
+#define        FE_TOWARDZERO   0x3
+#define        _ROUND_MASK     (FE_TONEAREST | FE_DOWNWARD | \
+                        FE_UPWARD | FE_TOWARDZERO)
+#define        _ROUND_SHIFT    22
+
+__BEGIN_DECLS
+
+/* Default floating-point environment */
+extern const fenv_t    __fe_dfl_env;
+#define        FE_DFL_ENV      (&__fe_dfl_env)
+
+/* We need to be able to map status flag positions to mask flag positions */
+#define _FPUSW_SHIFT   8
+#define        _ENABLE_MASK    (FE_ALL_EXCEPT << _FPUSW_SHIFT)
+
+#define        __mrs_fpcr(__r) __asm __volatile("mrs %0, fpcr" : "=r" (__r))
+#define        __msr_fpcr(__r) __asm __volatile("msr fpcr, %0" : : "r" (__r))
+
+#define        __mrs_fpsr(__r) __asm __volatile("mrs %0, fpsr" : "=r" (__r))
+#define        __msr_fpsr(__r) __asm __volatile("msr fpsr, %0" : : "r" (__r))
+
+__fenv_static __inline int
+feclearexcept(int __excepts)
+{
+       fexcept_t __r;
+
+       __mrs_fpsr(__r);
+       __r &= ~__excepts;
+       __msr_fpsr(__r);
+       return (0);
+}
+
+__fenv_static inline int
+fegetexceptflag(fexcept_t *__flagp, int __excepts)
+{
+       fexcept_t __r;
+
+       __mrs_fpsr(__r);
+       *__flagp = __r & __excepts;
+       return (0);
+}
+
+__fenv_static inline int
+fesetexceptflag(const fexcept_t *__flagp, int __excepts)
+{
+       fexcept_t __r;
+
+       __mrs_fpsr(__r);
+       __r &= ~__excepts;
+       __r |= *__flagp & __excepts;
+       __msr_fpsr(__r);
+       return (0);
+}
+
+__fenv_static inline int
+feraiseexcept(int __excepts)
+{
+       fexcept_t __r;
+
+       __mrs_fpsr(__r);
+       __r |= __excepts;
+       __msr_fpsr(__r);
+       return (0);
+}
+
+__fenv_static inline int
+fetestexcept(int __excepts)
+{
+       fexcept_t __r;
+
+       __mrs_fpsr(__r);
+       return (__r & __excepts);
+}
+
+__fenv_static inline int
+fegetround(void)
+{
+       fenv_t __r;
+
+       __mrs_fpcr(__r);
+       return ((__r >> _ROUND_SHIFT) & _ROUND_MASK);
+}
+
+__fenv_static inline int
+fesetround(int __round)
+{
+       fenv_t __r;
+
+       if (__round & ~_ROUND_MASK)
+               return (-1);
+       __mrs_fpcr(__r);
+       __r &= ~(_ROUND_MASK << _ROUND_SHIFT);
+       __r |= __round << _ROUND_SHIFT;
+       __msr_fpcr(__r);
+       return (0);
+}
+
+__fenv_static inline int
+fegetenv(fenv_t *__envp)
+{
+       fenv_t __r;
+
+       __mrs_fpcr(__r);
+       *__envp = __r & _ENABLE_MASK;
+
+       __mrs_fpsr(__r);
+       *__envp |= __r & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT));
+
+       return (0);
+}
+
+__fenv_static inline int
+feholdexcept(fenv_t *__envp)
+{
+       fenv_t __r;
+
+       __mrs_fpcr(__r);
+       *__envp = __r & _ENABLE_MASK;
+       __r &= ~(_ENABLE_MASK);
+       __msr_fpcr(__r);
+
+       __mrs_fpsr(__r);
+       *__envp |= __r & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT));
+       __r &= ~(_ENABLE_MASK);
+       __msr_fpsr(__r);
+       return (0);
+}
+
+__fenv_static inline int
+fesetenv(const fenv_t *__envp)
+{
+
+       __msr_fpcr((*__envp) & _ENABLE_MASK);
+       __msr_fpsr((*__envp) & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT)));
+       return (0);
+}
+
+__fenv_static inline int
+feupdateenv(const fenv_t *__envp)
+{
+       fexcept_t __r;
+
+       __mrs_fpsr(__r);
+       fesetenv(__envp);
+       feraiseexcept(__r & FE_ALL_EXCEPT);
+       return (0);
+}
+
+#if __BSD_VISIBLE
+
+/* We currently provide no external definitions of the functions below. */
+
+static inline int
+feenableexcept(int __mask)
+{
+       fenv_t __old_r, __new_r;
+
+       __mrs_fpcr(__old_r);
+       __new_r = __old_r | ((__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT);
+       __msr_fpcr(__new_r);
+       return ((__old_r >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
+}
+
+static inline int
+fedisableexcept(int __mask)
+{
+       fenv_t __old_r, __new_r;
+
+       __mrs_fpcr(__old_r);
+       __new_r = __old_r & ~((__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT);
+       __msr_fpcr(__new_r);
+       return ((__old_r >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
+}
+
+static inline int
+fegetexcept(void)
+{
+       fenv_t __r;
+
+       __mrs_fpcr(__r);
+       return ((__r & _ENABLE_MASK) >> _FPUSW_SHIFT);
+}
+
+#endif /* __BSD_VISIBLE */
+
+__END_DECLS
+
+#endif /* !_FENV_H_ */
diff --git a/lib/msun/arm64/Makefile.inc b/lib/msun/arm64/Makefile.inc
deleted file mode 100644 (file)
index 286a608..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-LDBL_PREC = 113
-
diff --git a/lib/msun/arm64/fenv.c b/lib/msun/arm64/fenv.c
deleted file mode 100644 (file)
index 4ec362f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
- * Copyright (c) 2013 Andrew Turner <andrew@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$
- */
-
-#define        __fenv_static
-#include "fenv.h"
-
-/*
- * Hopefully the system ID byte is immutable, so it's valid to use
- * this as a default environment.
- */
-const fenv_t __fe_dfl_env = 0;
-
-#ifdef __GNUC_GNU_INLINE__
-#error "This file must be compiled with C99 'inline' semantics"
-#endif
-
-extern inline int feclearexcept(int __excepts);
-extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts);
-extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
-extern inline int feraiseexcept(int __excepts);
-extern inline int fetestexcept(int __excepts);
-extern inline int fegetround(void);
-extern inline int fesetround(int __round);
-extern inline int fegetenv(fenv_t *__envp);
-extern inline int feholdexcept(fenv_t *__envp);
-extern inline int fesetenv(const fenv_t *__envp);
-extern inline int feupdateenv(const fenv_t *__envp);
-extern inline int feenableexcept(int __mask);
-extern inline int fedisableexcept(int __mask);
-extern inline int fegetexcept(void);
diff --git a/lib/msun/arm64/fenv.h b/lib/msun/arm64/fenv.h
deleted file mode 100644 (file)
index 2bd2987..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*-
- * Copyright (c) 2004-2005 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$
- */
-
-#ifndef        _FENV_H_
-#define        _FENV_H_
-
-#include <sys/_types.h>
-
-#ifndef        __fenv_static
-#define        __fenv_static   static
-#endif
-
-typedef        __uint64_t      fenv_t;
-typedef        __uint64_t      fexcept_t;
-
-/* Exception flags */
-#define        FE_INVALID      0x00000001
-#define        FE_DIVBYZERO    0x00000002
-#define        FE_OVERFLOW     0x00000004
-#define        FE_UNDERFLOW    0x00000008
-#define        FE_INEXACT      0x00000010
-#define        FE_ALL_EXCEPT   (FE_DIVBYZERO | FE_INEXACT | \
-                        FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
-
-/*
- * Rounding modes
- *
- * We can't just use the hardware bit values here, because that would
- * make FE_UPWARD and FE_DOWNWARD negative, which is not allowed.
- */
-#define        FE_TONEAREST    0x0
-#define        FE_UPWARD       0x1
-#define        FE_DOWNWARD     0x2
-#define        FE_TOWARDZERO   0x3
-#define        _ROUND_MASK     (FE_TONEAREST | FE_DOWNWARD | \
-                        FE_UPWARD | FE_TOWARDZERO)
-#define        _ROUND_SHIFT    22
-
-__BEGIN_DECLS
-
-/* Default floating-point environment */
-extern const fenv_t    __fe_dfl_env;
-#define        FE_DFL_ENV      (&__fe_dfl_env)
-
-/* We need to be able to map status flag positions to mask flag positions */
-#define _FPUSW_SHIFT   8
-#define        _ENABLE_MASK    (FE_ALL_EXCEPT << _FPUSW_SHIFT)
-
-#define        __mrs_fpcr(__r) __asm __volatile("mrs %0, fpcr" : "=r" (__r))
-#define        __msr_fpcr(__r) __asm __volatile("msr fpcr, %0" : : "r" (__r))
-
-#define        __mrs_fpsr(__r) __asm __volatile("mrs %0, fpsr" : "=r" (__r))
-#define        __msr_fpsr(__r) __asm __volatile("msr fpsr, %0" : : "r" (__r))
-
-__fenv_static __inline int
-feclearexcept(int __excepts)
-{
-       fexcept_t __r;
-
-       __mrs_fpsr(__r);
-       __r &= ~__excepts;
-       __msr_fpsr(__r);
-       return (0);
-}
-
-__fenv_static inline int
-fegetexceptflag(fexcept_t *__flagp, int __excepts)
-{
-       fexcept_t __r;
-
-       __mrs_fpsr(__r);
-       *__flagp = __r & __excepts;
-       return (0);
-}
-
-__fenv_static inline int
-fesetexceptflag(const fexcept_t *__flagp, int __excepts)
-{
-       fexcept_t __r;
-
-       __mrs_fpsr(__r);
-       __r &= ~__excepts;
-       __r |= *__flagp & __excepts;
-       __msr_fpsr(__r);
-       return (0);
-}
-
-__fenv_static inline int
-feraiseexcept(int __excepts)
-{
-       fexcept_t __r;
-
-       __mrs_fpsr(__r);
-       __r |= __excepts;
-       __msr_fpsr(__r);
-       return (0);
-}
-
-__fenv_static inline int
-fetestexcept(int __excepts)
-{
-       fexcept_t __r;
-
-       __mrs_fpsr(__r);
-       return (__r & __excepts);
-}
-
-__fenv_static inline int
-fegetround(void)
-{
-       fenv_t __r;
-
-       __mrs_fpcr(__r);
-       return ((__r >> _ROUND_SHIFT) & _ROUND_MASK);
-}
-
-__fenv_static inline int
-fesetround(int __round)
-{
-       fenv_t __r;
-
-       if (__round & ~_ROUND_MASK)
-               return (-1);
-       __mrs_fpcr(__r);
-       __r &= ~(_ROUND_MASK << _ROUND_SHIFT);
-       __r |= __round << _ROUND_SHIFT;
-       __msr_fpcr(__r);
-       return (0);
-}
-
-__fenv_static inline int
-fegetenv(fenv_t *__envp)
-{
-       fenv_t __r;
-
-       __mrs_fpcr(__r);
-       *__envp = __r & _ENABLE_MASK;
-
-       __mrs_fpsr(__r);
-       *__envp |= __r & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT));
-
-       return (0);
-}
-
-__fenv_static inline int
-feholdexcept(fenv_t *__envp)
-{
-       fenv_t __r;
-
-       __mrs_fpcr(__r);
-       *__envp = __r & _ENABLE_MASK;
-       __r &= ~(_ENABLE_MASK);
-       __msr_fpcr(__r);
-
-       __mrs_fpsr(__r);
-       *__envp |= __r & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT));
-       __r &= ~(_ENABLE_MASK);
-       __msr_fpsr(__r);
-       return (0);
-}
-
-__fenv_static inline int
-fesetenv(const fenv_t *__envp)
-{
-
-       __msr_fpcr((*__envp) & _ENABLE_MASK);
-       __msr_fpsr((*__envp) & (FE_ALL_EXCEPT | (_ROUND_MASK << _ROUND_SHIFT)));
-       return (0);
-}
-
-__fenv_static inline int
-feupdateenv(const fenv_t *__envp)
-{
-       fexcept_t __r;
-
-       __mrs_fpsr(__r);
-       fesetenv(__envp);
-       feraiseexcept(__r & FE_ALL_EXCEPT);
-       return (0);
-}
-
-#if __BSD_VISIBLE
-
-/* We currently provide no external definitions of the functions below. */
-
-static inline int
-feenableexcept(int __mask)
-{
-       fenv_t __old_r, __new_r;
-
-       __mrs_fpcr(__old_r);
-       __new_r = __old_r | ((__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT);
-       __msr_fpcr(__new_r);
-       return ((__old_r >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
-}
-
-static inline int
-fedisableexcept(int __mask)
-{
-       fenv_t __old_r, __new_r;
-
-       __mrs_fpcr(__old_r);
-       __new_r = __old_r & ~((__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT);
-       __msr_fpcr(__new_r);
-       return ((__old_r >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
-}
-
-static inline int
-fegetexcept(void)
-{
-       fenv_t __r;
-
-       __mrs_fpcr(__r);
-       return ((__r & _ENABLE_MASK) >> _FPUSW_SHIFT);
-}
-
-#endif /* __BSD_VISIBLE */
-
-__END_DECLS
-
-#endif /* !_FENV_H_ */