jcs's openbsd hax
openbsd

Add support for AArch64.

patrick c7933dde e05abaed

+1789
+61
lib/libc/arch/aarch64/DEFS.h
··· 1 + /* $OpenBSD: DEFS.h,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + 3 + /*- 4 + * Copyright (c) 1990 The Regents of the University of California. 5 + * All rights reserved. 6 + * 7 + * This code is derived from software contributed to Berkeley by 8 + * William Jolitz. 9 + * 10 + * Redistribution and use in source and binary forms, with or without 11 + * modification, are permitted provided that the following conditions 12 + * are met: 13 + * 1. Redistributions of source code must retain the above copyright 14 + * notice, this list of conditions and the following disclaimer. 15 + * 2. Redistributions in binary form must reproduce the above copyright 16 + * notice, this list of conditions and the following disclaimer in the 17 + * documentation and/or other materials provided with the distribution. 18 + * 3. Neither the name of the University nor the names of its contributors 19 + * may be used to endorse or promote products derived from this software 20 + * without specific prior written permission. 21 + * 22 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 + * SUCH DAMAGE. 33 + * 34 + * from: @(#)SYS.h 5.5 (Berkeley) 5/7/91 35 + * $NetBSD: SYS.h,v 1.5 2002/06/03 18:30:32 fvdl Exp $ 36 + */ 37 + 38 + #include <machine/asm.h> 39 + 40 + /* 41 + * We define a hidden alias with the prefix "_libc_" for each global symbol 42 + * that may be used internally. By referencing _libc_x instead of x, other 43 + * parts of libc prevent overriding by the application and avoid unnecessary 44 + * relocations. 45 + */ 46 + #define _HIDDEN(x) _libc_##x 47 + #define _HIDDEN_ALIAS(x,y) \ 48 + STRONG_ALIAS(_HIDDEN(x),y); \ 49 + .hidden _HIDDEN(x) 50 + #define _HIDDEN_FALIAS(x,y) \ 51 + _HIDDEN_ALIAS(x,y); \ 52 + .type _HIDDEN(x),@function 53 + 54 + /* 55 + * For functions implemented in ASM that aren't syscalls. 56 + * END_STRONG(x) Like DEF_STRONG() in C; for standard/reserved C names 57 + * END_WEAK(x) Like DEF_WEAK() in C; for non-ISO C names 58 + */ 59 + #define END_STRONG(x) END(x); _HIDDEN_FALIAS(x,x); END(_HIDDEN(x)) 60 + #define END_WEAK(x) END_STRONG(x); .weak x 61 +
+6
lib/libc/arch/aarch64/Makefile.inc
··· 1 + # $OpenBSD: Makefile.inc,v 1.1 2017/01/11 18:09:24 patrick Exp $ 2 + # $NetBSD: Makefile.inc,v 1.5 2002/07/10 04:29:06 thorpej Exp $ 3 + 4 + .include <bsd.own.mk> 5 + 6 + CERROR= cerror.S
+108
lib/libc/arch/aarch64/SYS.h
··· 1 + /* $OpenBSD: SYS.h,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: SYS.h,v 1.8 2003/08/07 16:42:02 agc Exp $ */ 3 + 4 + /*- 5 + * Copyright (c) 1990 The Regents of the University of California. 6 + * All rights reserved. 7 + * 8 + * This code is derived from software contributed to Berkeley by 9 + * William Jolitz. 10 + * 11 + * Redistribution and use in source and binary forms, with or without 12 + * modification, are permitted provided that the following conditions 13 + * are met: 14 + * 1. Redistributions of source code must retain the above copyright 15 + * notice, this list of conditions and the following disclaimer. 16 + * 2. Redistributions in binary form must reproduce the above copyright 17 + * notice, this list of conditions and the following disclaimer in the 18 + * documentation and/or other materials provided with the distribution. 19 + * 3. Neither the name of the University nor the names of its contributors 20 + * may be used to endorse or promote products derived from this software 21 + * without specific prior written permission. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 + * SUCH DAMAGE. 34 + * 35 + * from: @(#)SYS.h 5.5 (Berkeley) 5/7/91 36 + */ 37 + 38 + #include "DEFS.h" 39 + #include <sys/syscall.h> 40 + #include <arm64/swi.h> 41 + 42 + #define SYSENTRY(x) \ 43 + .weak _C_LABEL(x); \ 44 + _C_LABEL(x) = _C_LABEL(_thread_sys_ ## x); \ 45 + ENTRY(_thread_sys_ ## x) 46 + #define SYSENTRY_HIDDEN(x) \ 47 + ENTRY(_thread_sys_ ## x) 48 + #define __END_HIDDEN(x) \ 49 + END(_thread_sys_ ## x); \ 50 + _HIDDEN_FALIAS(x, _thread_sys_ ## x); \ 51 + END(_HIDDEN(x)) 52 + #define __END(x) \ 53 + __END_HIDDEN(x); END(x) 54 + 55 + #define SYSTRAP(x) \ 56 + ldr x8, =SYS_ ## x; \ 57 + svc 0 58 + 59 + #define CERROR _C_LABEL(__cerror) 60 + 61 + #define _SYSCALL_NOERROR(x,y) \ 62 + SYSENTRY(x); \ 63 + SYSTRAP(y) 64 + #define _SYSCALL_HIDDEN_NOERROR(x,y) \ 65 + SYSENTRY_HIDDEN(x); \ 66 + SYSTRAP(y) 67 + 68 + #define _SYSCALL(x, y) \ 69 + _SYSCALL_NOERROR(x,y); \ 70 + bcs CERROR 71 + #define _SYSCALL_HIDDEN(x, y) \ 72 + _SYSCALL_HIDDEN_NOERROR(x,y); \ 73 + bcs CERROR 74 + 75 + #define SYSCALL_NOERROR(x) \ 76 + _SYSCALL_NOERROR(x,x) 77 + 78 + #define SYSCALL(x) \ 79 + _SYSCALL(x,x) 80 + 81 + 82 + #define PSEUDO_NOERROR(x,y) \ 83 + _SYSCALL_NOERROR(x,y); \ 84 + ret; \ 85 + __END(x) 86 + 87 + #define PSEUDO(x,y) \ 88 + _SYSCALL(x,y); \ 89 + ret; \ 90 + __END(x) 91 + #define PSEUDO_HIDDEN(x,y) \ 92 + _SYSCALL_HIDDEN(x,y); \ 93 + ret; \ 94 + __END_HIDDEN(x) 95 + 96 + #define RSYSCALL_NOERROR(x) \ 97 + PSEUDO_NOERROR(x,x) 98 + 99 + #define RSYSCALL(x) \ 100 + PSEUDO(x,x) 101 + #define RSYSCALL_HIDDEN(x) \ 102 + PSEUDO_HIDDEN(x,x) 103 + #define SYSCALL_END(x) \ 104 + __END(x) 105 + #define SYSCALL_END_HIDDEN(x) \ 106 + __END_HIDDEN(x) 107 + 108 + .globl CERROR
+15
lib/libc/arch/aarch64/Symbols.list
··· 1 + __bswap16 2 + __bswap32 3 + __mcount 4 + __multf3 5 + _fpgetmask 6 + _fpgetround 7 + _fpgetsticky 8 + _fpsetmask 9 + _fpsetround 10 + _fpsetsticky 11 + _mcount 12 + _memcpy 13 + _stack 14 + end 15 + fabsl
+3
lib/libc/arch/aarch64/gdtoa/Makefile.inc
··· 1 + # $OpenBSD: Makefile.inc,v 1.1 2017/01/11 18:09:24 patrick Exp $ 2 + 3 + SRCS+= strtord.c strtorQ.c
+6
lib/libc/arch/aarch64/gdtoa/arith.h
··· 1 + #define IEEE_8087 2 + #define Arith_Kind_ASL 1 3 + #define Long int 4 + #define Intcast (int)(long) 5 + #define Double_Align 6 + #define X64_bit_pointers
+12
lib/libc/arch/aarch64/gdtoa/gd_qnan.h
··· 1 + #define f_QNAN 0x7fc00000 2 + #define d_QNAN0 0x0 3 + #define d_QNAN1 0x7ff80000 4 + #define ld_QNAN0 0x0 5 + #define ld_QNAN1 0x0 6 + #define ld_QNAN2 0x0 7 + #define ld_QNAN3 0x7fff8000 8 + #define ldus_QNAN0 0x0 9 + #define ldus_QNAN1 0x0 10 + #define ldus_QNAN2 0x0 11 + #define ldus_QNAN3 0x0 12 + #define ldus_QNAN4 0x0
+46
lib/libc/arch/aarch64/gdtoa/strtold.c
··· 1 + /* $OpenBSD: strtold.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /*- 3 + * Copyright (c) 2003 David Schultz <das@FreeBSD.ORG> 4 + * All rights reserved. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions 8 + * are met: 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 15 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 + * SUCH DAMAGE. 26 + */ 27 + 28 + /* 29 + * Machine-dependent glue to integrate David Gay's gdtoa 30 + * package into libc for architectures where a long double 31 + * uses quad precision, such as sparc64. 32 + */ 33 + 34 + #include <float.h> 35 + 36 + #include "gdtoaimp.h" 37 + 38 + long double 39 + strtold(const char * __restrict s, char ** __restrict sp) 40 + { 41 + long double result; 42 + 43 + strtorQ(s, sp, FLT_ROUNDS, &result); 44 + return result; 45 + } 46 + DEF_STRONG(strtold);
+12
lib/libc/arch/aarch64/gen/Makefile.inc
··· 1 + # $OpenBSD: Makefile.inc,v 1.1 2017/01/11 18:09:24 patrick Exp $ 2 + # $NetBSD: Makefile.inc,v 1.6 2003/08/01 17:03:47 lukem Exp $ 3 + 4 + SRCS+= byte_swap_2.S byte_swap_4.S fabs.c flt_rounds.c infinity.c 5 + SRCS+= ldexp.c modf.c nan.c 6 + SRCS+= setjmp.S _setjmp.S sigsetjmp.S 7 + SRCS+= clz_tab.c 8 + SRCS+= fpgetmask.c fpgetround.c fpgetsticky.c 9 + SRCS+= fpsetmask.c fpsetround.c fpsetsticky.c 10 + SRCS+= fpclassifyl.c 11 + SRCS+= isfinitel.c isinfl.c isnanl.c isnormall.c 12 + SRCS+= signbitl.c
+99
lib/libc/arch/aarch64/gen/_setjmp.S
··· 1 + /* $OpenBSD: _setjmp.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /*- 3 + * Copyright (c) 2014 Andrew Turner 4 + * Copyright (c) 2014 The FreeBSD Foundation 5 + * All rights reserved. 6 + * 7 + * Portions of this software were developed by Andrew Turner 8 + * under sponsorship from the FreeBSD Foundation 9 + * 10 + * Redistribution and use in source and binary forms, with or without 11 + * modification, are permitted provided that the following conditions 12 + * are met: 13 + * 1. Redistributions of source code must retain the above copyright 14 + * notice, this list of conditions and the following disclaimer. 15 + * 2. Redistributions in binary form must reproduce the above copyright 16 + * notice, this list of conditions and the following disclaimer in the 17 + * documentation and/or other materials provided with the distribution. 18 + * 19 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 20 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 23 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 + * SUCH DAMAGE. 30 + * 31 + */ 32 + 33 + #include "DEFS.h" 34 + #include <machine/setjmp.h> 35 + 36 + ENTRY(_setjmp) 37 + /* Store the magic value and stack pointer */ 38 + ldr x8, .Lmagic 39 + mov x9, sp 40 + stp x8, x9, [x0], #16 41 + 42 + /* Store the general purpose registers and lr */ 43 + stp x19, x20, [x0], #16 44 + stp x21, x22, [x0], #16 45 + stp x23, x24, [x0], #16 46 + stp x25, x26, [x0], #16 47 + stp x27, x28, [x0], #16 48 + stp x29, x30, [x0], #16 49 + 50 + #ifndef _STANDALONE 51 + /* Store the vfp registers */ 52 + stp d8, d9, [x0], #16 53 + stp d10, d11, [x0], #16 54 + stp d12, d13, [x0], #16 55 + stp d14, d15, [x0] 56 + #endif 57 + 58 + /* Return value */ 59 + mov x0, #0 60 + ret 61 + .align 3 62 + .Lmagic: 63 + .quad _JB_MAGIC__SETJMP 64 + END_STRONG(_setjmp) 65 + 66 + ENTRY(_longjmp) 67 + /* Check the magic value */ 68 + ldr x8, [x0], #8 69 + ldr x9, .Lmagic 70 + cmp x8, x9 71 + b.ne botch 72 + 73 + /* Restore the stack pointer */ 74 + ldr x8, [x0], #8 75 + mov sp, x8 76 + 77 + /* Restore the general purpose registers and lr */ 78 + ldp x19, x20, [x0], #16 79 + ldp x21, x22, [x0], #16 80 + ldp x23, x24, [x0], #16 81 + ldp x25, x26, [x0], #16 82 + ldp x27, x28, [x0], #16 83 + ldp x29, x30, [x0], #16 84 + 85 + #ifndef _STANDALONE 86 + /* Restore the vfp registers */ 87 + ldp d8, d9, [x0], #16 88 + ldp d10, d11, [x0], #16 89 + ldp d12, d13, [x0], #16 90 + ldp d14, d15, [x0] 91 + #endif 92 + 93 + /* Load the return value */ 94 + mov x0, x1 95 + ret 96 + 97 + botch: 98 + bl _HIDDEN(abort) 99 + END_STRONG(_longjmp)
+42
lib/libc/arch/aarch64/gen/byte_swap_2.S
··· 1 + /* $OpenBSD: byte_swap_2.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: byte_swap_2.S,v 1.3 2003/04/05 23:08:51 bjh21 Exp $ */ 3 + 4 + /*- 5 + * Copyright (c) 1999 The NetBSD Foundation, Inc. 6 + * All rights reserved. 7 + * 8 + * This code is derived from software contributed to The NetBSD Foundation 9 + * by Charles M. Hannum. 10 + * 11 + * Redistribution and use in source and binary forms, with or without 12 + * modification, are permitted provided that the following conditions 13 + * are met: 14 + * 1. Redistributions of source code must retain the above copyright 15 + * notice, this list of conditions and the following disclaimer. 16 + * 2. Redistributions in binary form must reproduce the above copyright 17 + * notice, this list of conditions and the following disclaimer in the 18 + * documentation and/or other materials provided with the distribution. 19 + * 20 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 + * POSSIBILITY OF SUCH DAMAGE. 31 + */ 32 + 33 + #include <machine/asm.h> 34 + 35 + _ENTRY(_C_LABEL(__bswap16)) 36 + _ENTRY(_C_LABEL(ntohs)) 37 + _ENTRY(_C_LABEL(htons)) 38 + _PROF_PROLOGUE 39 + and w8, w0, #0xffff 40 + ubfx w0, w0, #8, #8 41 + bfi w0, w8, #8, #16 42 + ret
+40
lib/libc/arch/aarch64/gen/byte_swap_4.S
··· 1 + /* $OpenBSD: byte_swap_4.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: byte_swap_4.S,v 1.2 2003/04/05 23:08:51 bjh21 Exp $ */ 3 + 4 + /*- 5 + * Copyright (c) 1997 The NetBSD Foundation, Inc. 6 + * All rights reserved. 7 + * 8 + * This code is derived from software contributed to The NetBSD Foundation 9 + * by Neil A. Carson 10 + * 11 + * Redistribution and use in source and binary forms, with or without 12 + * modification, are permitted provided that the following conditions 13 + * are met: 14 + * 1. Redistributions of source code must retain the above copyright 15 + * notice, this list of conditions and the following disclaimer. 16 + * 2. Redistributions in binary form must reproduce the above copyright 17 + * notice, this list of conditions and the following disclaimer in the 18 + * documentation and/or other materials provided with the distribution. 19 + * 20 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 + * POSSIBILITY OF SUCH DAMAGE. 31 + */ 32 + 33 + #include <machine/asm.h> 34 + 35 + _ENTRY(_C_LABEL(__bswap32)) 36 + _ENTRY(_C_LABEL(ntohl)) 37 + _ENTRY(_C_LABEL(htonl)) 38 + _PROF_PROLOGUE 39 + rev w0, w0 40 + ret
+34
lib/libc/arch/aarch64/gen/clz_tab.c
··· 1 + const unsigned char __clz_tab[] = { 2 + 0, 1, 2, 2, 3, 3, 3, 3, 3 + 4, 4, 4, 4, 4, 4, 4, 4, 4 + 5, 5, 5, 5, 5, 5, 5, 5, 5 + 5, 5, 5, 5, 5, 5, 5, 5, 6 + 6, 6, 6, 6, 6, 6, 6, 6, 7 + 6, 6, 6, 6, 6, 6, 6, 6, 8 + 6, 6, 6, 6, 6, 6, 6, 6, 9 + 6, 6, 6, 6, 6, 6, 6, 6, 10 + 7, 7, 7, 7, 7, 7, 7, 7, 11 + 7, 7, 7, 7, 7, 7, 7, 7, 12 + 7, 7, 7, 7, 7, 7, 7, 7, 13 + 7, 7, 7, 7, 7, 7, 7, 7, 14 + 7, 7, 7, 7, 7, 7, 7, 7, 15 + 7, 7, 7, 7, 7, 7, 7, 7, 16 + 7, 7, 7, 7, 7, 7, 7, 7, 17 + 7, 7, 7, 7, 7, 7, 7, 7, 18 + 8, 8, 8, 8, 8, 8, 8, 8, 19 + 8, 8, 8, 8, 8, 8, 8, 8, 20 + 8, 8, 8, 8, 8, 8, 8, 8, 21 + 8, 8, 8, 8, 8, 8, 8, 8, 22 + 8, 8, 8, 8, 8, 8, 8, 8, 23 + 8, 8, 8, 8, 8, 8, 8, 8, 24 + 8, 8, 8, 8, 8, 8, 8, 8, 25 + 8, 8, 8, 8, 8, 8, 8, 8, 26 + 8, 8, 8, 8, 8, 8, 8, 8, 27 + 8, 8, 8, 8, 8, 8, 8, 8, 28 + 8, 8, 8, 8, 8, 8, 8, 8, 29 + 8, 8, 8, 8, 8, 8, 8, 8, 30 + 8, 8, 8, 8, 8, 8, 8, 8, 31 + 8, 8, 8, 8, 8, 8, 8, 8, 32 + 8, 8, 8, 8, 8, 8, 8, 8, 33 + 8, 8, 8, 8, 8, 8, 8, 8 34 + };
+35
lib/libc/arch/aarch64/gen/fabs.c
··· 1 + /* $OpenBSD: fabs.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> 4 + * 5 + * Permission to use, copy, modify, and distribute this software for any 6 + * purpose with or without fee is hereby granted, provided that the above 7 + * copyright notice and this permission notice appear in all copies. 8 + * 9 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 + */ 17 + 18 + #include <sys/types.h> 19 + #include <machine/ieee.h> 20 + #include <math.h> 21 + 22 + /* 23 + * fabs(d) returns the absolute value of d. 24 + */ 25 + double 26 + fabs(double d) 27 + { 28 + struct ieee_double *p = (struct ieee_double *)&d; 29 + 30 + p->dbl_sign = 0; 31 + 32 + return(d); 33 + } 34 + 35 + __strong_alias(fabsl, fabs);
+77
lib/libc/arch/aarch64/gen/flt_rounds.c
··· 1 + /* $OpenBSD: flt_rounds.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: flt_rounds.c,v 1.1 2000/12/29 20:13:48 bjh21 Exp $ */ 3 + 4 + /* 5 + * Copyright (c) 1996 Mark Brinicombe 6 + * All rights reserved. 7 + * 8 + * Redistribution and use in source and binary forms, with or without 9 + * modification, are permitted provided that the following conditions 10 + * are met: 11 + * 1. Redistributions of source code must retain the above copyright 12 + * notice, this list of conditions and the following disclaimer. 13 + * 2. Redistributions in binary form must reproduce the above copyright 14 + * notice, this list of conditions and the following disclaimer in the 15 + * documentation and/or other materials provided with the distribution. 16 + * 3. All advertising materials mentioning features or use of this software 17 + * must display the following acknowledgement: 18 + * This product includes software developed by Mark Brinicombe 19 + * for the NetBSD Project. 20 + * 4. The name of the author may not be used to endorse or promote products 21 + * derived from this software without specific prior written permission 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 24 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 25 + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26 + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 27 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + #include <sys/types.h> 36 + #include <ieeefp.h> 37 + #include <float.h> 38 + 39 + static const int map[] = { 40 + 1, /* round to nearest */ 41 + 2, /* round to positive infinity */ 42 + 3, /* round to negative infinity */ 43 + 0 /* round to zero */ 44 + }; 45 + 46 + /* 47 + * Return the current FP rounding mode 48 + * 49 + * Returns: 50 + * 0 - round to zero 51 + * 1 - round to nearest 52 + * 2 - round to postive infinity 53 + * 3 - round to negative infinity 54 + * 55 + * ok all we need to do is get the current FP rounding mode 56 + * index our map table and return the appropriate value. 57 + * 58 + * HOWEVER: 59 + * The ARM FPA codes the rounding mode into the actual FP instructions 60 + * so there is no such thing as a global rounding mode. 61 + * The default is round to nearest if rounding is not explicitly specified. 62 + * FP instructions generated by GCC will not explicitly specify a rounding 63 + * mode. 64 + * 65 + * So the best we can do it to return the rounding mode FP instructions 66 + * use if rounding is not specified which is round to nearest. 67 + * 68 + * This could change in the future with new floating point emulators or 69 + * soft float FP libraries. 70 + */ 71 + 72 + int 73 + __flt_rounds() 74 + { 75 + return(map[fpgetround()]); 76 + } 77 + DEF_STRONG(__flt_rounds);
+45
lib/libc/arch/aarch64/gen/fpclassifyl.c
··· 1 + /* $OpenBSD: fpclassifyl.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> 4 + * 5 + * Permission to use, copy, modify, and distribute this software for any 6 + * purpose with or without fee is hereby granted, provided that the above 7 + * copyright notice and this permission notice appear in all copies. 8 + * 9 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 + */ 17 + 18 + #include <sys/types.h> 19 + #include <machine/ieee.h> 20 + #include <math.h> 21 + 22 + int 23 + __fpclassifyl(long double e) 24 + { 25 + struct ieee_ext *p = (struct ieee_ext *)&e; 26 + 27 + if (p->ext_exp == 0) { 28 + if (p->ext_frach == 0 && p->ext_frachm == 0 && 29 + p->ext_fraclm == 0 && p->ext_fracl == 0) 30 + return FP_ZERO; 31 + else 32 + return FP_SUBNORMAL; 33 + } 34 + 35 + if (p->ext_exp == EXT_EXP_INFNAN) { 36 + if (p->ext_frach == 0 && p->ext_frachm == 0 && 37 + p->ext_fraclm == 0 && p->ext_fracl == 0) 38 + return FP_INFINITE; 39 + else 40 + return FP_NAN; 41 + } 42 + 43 + return FP_NORMAL; 44 + } 45 + DEF_STRONG(__fpclassifyl);
+48
lib/libc/arch/aarch64/gen/fpgetmask.c
··· 1 + /* $OpenBSD: fpgetmask.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (C) 2014 Andrew Turner 4 + * All rights reserved. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions 8 + * are met: 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 15 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 + * SUCH DAMAGE. 26 + * 27 + */ 28 + 29 + #include <sys/cdefs.h> 30 + 31 + #include <sys/types.h> 32 + #include <ieeefp.h> 33 + 34 + #ifdef __weak_alias 35 + __weak_alias(_fpgetmask,fpgetmask); 36 + #endif 37 + 38 + #define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) 39 + 40 + fp_except 41 + fpgetmask(void) 42 + { 43 + fp_except mask; 44 + 45 + __asm __volatile("mrs %x0, fpcr" : "=&r"(mask)); 46 + 47 + return ((mask >> 8) & FP_X_MASK); 48 + }
+46
lib/libc/arch/aarch64/gen/fpgetround.c
··· 1 + /* $OpenBSD: fpgetround.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (C) 2014 Andrew Turner 4 + * All rights reserved. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions 8 + * are met: 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 15 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 + * SUCH DAMAGE. 26 + * 27 + */ 28 + 29 + #include <sys/cdefs.h> 30 + 31 + #include <sys/types.h> 32 + #include <ieeefp.h> 33 + 34 + #ifdef __weak_alias 35 + __weak_alias(_fpgetround,fpgetround); 36 + #endif 37 + 38 + fp_rnd 39 + fpgetround(void) 40 + { 41 + uint32_t fpscr; 42 + 43 + __asm __volatile("mrs %x0, fpcr" : "=&r"(fpscr)); 44 + 45 + return ((fpscr >> 22) & 3); 46 + }
+48
lib/libc/arch/aarch64/gen/fpgetsticky.c
··· 1 + /* $OpenBSD: fpgetsticky.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (C) 2014 Andrew Turner 4 + * All rights reserved. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions 8 + * are met: 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 15 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 + * SUCH DAMAGE. 26 + * 27 + */ 28 + 29 + #include <sys/cdefs.h> 30 + 31 + #include <sys/types.h> 32 + #include <ieeefp.h> 33 + 34 + #ifdef __weak_alias 35 + __weak_alias(_fpgetsticky,fpgetsticky); 36 + #endif 37 + 38 + #define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) 39 + 40 + fp_except 41 + fpgetsticky(void) 42 + { 43 + fp_except old; 44 + 45 + __asm __volatile("mrs %x0, fpcr" : "=&r"(old)); 46 + 47 + return (old & FP_X_MASK); 48 + }
+51
lib/libc/arch/aarch64/gen/fpsetmask.c
··· 1 + /* $OpenBSD: fpsetmask.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (C) 2014 Andrew Turner 4 + * All rights reserved. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions 8 + * are met: 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 15 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 + * SUCH DAMAGE. 26 + * 27 + */ 28 + 29 + #include <sys/cdefs.h> 30 + 31 + #include <sys/types.h> 32 + #include <ieeefp.h> 33 + 34 + #ifdef __weak_alias 35 + __weak_alias(_fpsetmask,fpsetmask); 36 + #endif 37 + 38 + #define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) 39 + 40 + fp_except 41 + fpsetmask(fp_except mask) 42 + { 43 + fp_except old, new; 44 + 45 + __asm __volatile("mrs %x0, fpcr" : "=&r"(old)); 46 + mask = (mask & FP_X_MASK) << 8; 47 + new = (old & ~(FP_X_MASK << 8)) | mask; 48 + __asm __volatile("msr fpcr, %x0" : : "r"(new)); 49 + 50 + return ((old >> 8) & FP_X_MASK); 51 + }
+49
lib/libc/arch/aarch64/gen/fpsetround.c
··· 1 + /* $OpenBSD: fpsetround.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (C) 2014 Andrew Turner 4 + * All rights reserved. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions 8 + * are met: 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 15 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 + * SUCH DAMAGE. 26 + * 27 + */ 28 + 29 + #include <sys/cdefs.h> 30 + 31 + #include <sys/types.h> 32 + #include <ieeefp.h> 33 + 34 + #ifdef __weak_alias 35 + __weak_alias(_fpsetround,fpsetround); 36 + #endif 37 + 38 + fp_rnd 39 + fpsetround(fp_rnd rnd_dir) 40 + { 41 + uint32_t old, new; 42 + 43 + __asm __volatile("mrs %x0, fpcr" : "=&r"(old)); 44 + new = old & ~(3 << 22); 45 + new |= rnd_dir << 22; 46 + __asm __volatile("msr fpcr, %x0" : : "r"(new)); 47 + 48 + return ((old >> 22) & 3); 49 + }
+51
lib/libc/arch/aarch64/gen/fpsetsticky.c
··· 1 + /* $OpenBSD: fpsetsticky.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (C) 2014 Andrew Turner 4 + * All rights reserved. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions 8 + * are met: 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 15 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 + * SUCH DAMAGE. 26 + * 27 + */ 28 + 29 + #include <sys/cdefs.h> 30 + 31 + #include <sys/types.h> 32 + #include <ieeefp.h> 33 + 34 + #ifdef __weak_alias 35 + __weak_alias(_fpsetsticky,fpsetsticky); 36 + #endif 37 + 38 + #define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) 39 + 40 + fp_except 41 + fpsetsticky(fp_except except) 42 + { 43 + fp_except old, new; 44 + 45 + __asm __volatile("mrs %x0, fpcr" : "=&r"(old)); 46 + new = old & ~(FP_X_MASK); 47 + new &= ~except; 48 + __asm __volatile("msr fpcr, %x0" : : "r"(new)); 49 + 50 + return (old & except); 51 + }
+16
lib/libc/arch/aarch64/gen/infinity.c
··· 1 + /* $OpenBSD: infinity.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: infinity.c,v 1.3 2002/02/19 20:08:19 bjh21 Exp $ */ 3 + 4 + /* 5 + * IEEE-compatible infinity.c -- public domain. 6 + */ 7 + 8 + #include <endian.h> 9 + #include <math.h> 10 + 11 + char __infinity[] __attribute__((__aligned__(sizeof(double)))) = 12 + #if BYTE_ORDER == BIG_ENDIAN 13 + { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0}; 14 + #else 15 + { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f}; 16 + #endif
+28
lib/libc/arch/aarch64/gen/isfinitel.c
··· 1 + /* $OpenBSD: isfinitel.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> 4 + * 5 + * Permission to use, copy, modify, and distribute this software for any 6 + * purpose with or without fee is hereby granted, provided that the above 7 + * copyright notice and this permission notice appear in all copies. 8 + * 9 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 + */ 17 + 18 + #include <sys/types.h> 19 + #include <machine/ieee.h> 20 + #include <math.h> 21 + 22 + int 23 + __isfinitel(long double e) 24 + { 25 + struct ieee_ext *p = (struct ieee_ext *)&e; 26 + 27 + return (p->ext_exp != EXT_EXP_INFNAN); 28 + }
+30
lib/libc/arch/aarch64/gen/isinfl.c
··· 1 + /* $OpenBSD: isinfl.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> 4 + * 5 + * Permission to use, copy, modify, and distribute this software for any 6 + * purpose with or without fee is hereby granted, provided that the above 7 + * copyright notice and this permission notice appear in all copies. 8 + * 9 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 + */ 17 + 18 + #include <sys/types.h> 19 + #include <machine/ieee.h> 20 + #include <math.h> 21 + 22 + int 23 + __isinfl(long double e) 24 + { 25 + struct ieee_ext *p = (struct ieee_ext *)&e; 26 + 27 + return (p->ext_exp == EXT_EXP_INFNAN && 28 + p->ext_frach == 0 && p->ext_frachm == 0 && 29 + p->ext_fraclm == 0 && p->ext_fracl == 0); 30 + }
+30
lib/libc/arch/aarch64/gen/isnanl.c
··· 1 + /* $OpenBSD: isnanl.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> 4 + * 5 + * Permission to use, copy, modify, and distribute this software for any 6 + * purpose with or without fee is hereby granted, provided that the above 7 + * copyright notice and this permission notice appear in all copies. 8 + * 9 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 + */ 17 + 18 + #include <sys/types.h> 19 + #include <machine/ieee.h> 20 + #include <math.h> 21 + 22 + int 23 + __isnanl(long double e) 24 + { 25 + struct ieee_ext *p = (struct ieee_ext *)&e; 26 + 27 + return (p->ext_exp == EXT_EXP_INFNAN && 28 + (p->ext_frach != 0 || p->ext_frachm != 0 || 29 + p->ext_fraclm != 0 || p->ext_fracl != 0)); 30 + }
+28
lib/libc/arch/aarch64/gen/isnormall.c
··· 1 + /* $OpenBSD: isnormall.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> 4 + * 5 + * Permission to use, copy, modify, and distribute this software for any 6 + * purpose with or without fee is hereby granted, provided that the above 7 + * copyright notice and this permission notice appear in all copies. 8 + * 9 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 + */ 17 + 18 + #include <sys/types.h> 19 + #include <machine/ieee.h> 20 + #include <math.h> 21 + 22 + int 23 + __isnormall(long double e) 24 + { 25 + struct ieee_ext *p = (struct ieee_ext *)&e; 26 + 27 + return (p->ext_exp != 0 && p->ext_exp != EXT_EXP_INFNAN); 28 + }
+14
lib/libc/arch/aarch64/gen/nan.c
··· 1 + /* $OpenBSD: nan.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + 3 + /* Written by Martynas Venckus. Public Domain. */ 4 + 5 + #include <endian.h> 6 + #include <math.h> 7 + 8 + /* bytes for qNaN on an arm (IEEE single format) */ 9 + char __nan[] __attribute__((__aligned__(sizeof(float)))) = 10 + #if BYTE_ORDER == BIG_ENDIAN 11 + { 0x7f, 0xc0, 0, 0 }; 12 + #else /* BYTE_ORDER == BIG_ENDIAN */ 13 + { 0, 0, 0xc0, 0x7f }; 14 + #endif /* BYTE_ORDER == BIG_ENDIAN */
+118
lib/libc/arch/aarch64/gen/setjmp.S
··· 1 + /* $OpenBSD: setjmp.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /*- 3 + * Copyright (c) 2014 Andrew Turner 4 + * Copyright (c) 2014 The FreeBSD Foundation 5 + * All rights reserved. 6 + * 7 + * Portions of this software were developed by Andrew Turner 8 + * under sponsorship from the FreeBSD Foundation 9 + * 10 + * Redistribution and use in source and binary forms, with or without 11 + * modification, are permitted provided that the following conditions 12 + * are met: 13 + * 1. Redistributions of source code must retain the above copyright 14 + * notice, this list of conditions and the following disclaimer. 15 + * 2. Redistributions in binary form must reproduce the above copyright 16 + * notice, this list of conditions and the following disclaimer in the 17 + * documentation and/or other materials provided with the distribution. 18 + * 19 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 20 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 23 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 + * SUCH DAMAGE. 30 + * 31 + */ 32 + 33 + #include "SYS.h" 34 + #include <machine/setjmp.h> 35 + 36 + ENTRY(setjmp) 37 + stp x0, x30, [sp, #-16]! 38 + 39 + /* Store the signal mask */ 40 + add x2, x0, #(_JB_SIGMASK * 8) /* oset */ 41 + mov x1, #0 /* set */ 42 + mov x0, #1 /* SIG_BLOCK */ 43 + SYSTRAP(sigprocmask) 44 + 45 + ldp x0, x30, [sp], #16 46 + 47 + /* Store the magic value and stack pointer */ 48 + ldr x8, .Lmagic 49 + mov x9, sp 50 + stp x8, x9, [x0], #16 51 + 52 + /* Store the general purpose registers and lr */ 53 + stp x19, x20, [x0], #16 54 + stp x21, x22, [x0], #16 55 + stp x23, x24, [x0], #16 56 + stp x25, x26, [x0], #16 57 + stp x27, x28, [x0], #16 58 + stp x29, x30, [x0], #16 59 + 60 + /* Store the vfp registers */ 61 + stp d8, d9, [x0], #16 62 + stp d10, d11, [x0], #16 63 + stp d12, d13, [x0], #16 64 + stp d14, d15, [x0] 65 + 66 + /* Return value */ 67 + mov x0, #0 68 + ret 69 + 70 + .align 3 71 + .Lmagic: 72 + .quad _JB_MAGIC_SETJMP 73 + END_STRONG(setjmp) 74 + 75 + ENTRY(longjmp) 76 + stp x0, x1, [sp, #-32]! 77 + str x30, [sp, #24] 78 + 79 + /* Restore the signal mask */ 80 + mov x2, #0 /* oset */ 81 + add x1, x0, #(_JB_SIGMASK * 8) /* set */ 82 + mov x0, #3 /* SIG_SETMASK */ 83 + SYSTRAP(sigprocmask) 84 + 85 + ldr x30, [sp, #24] 86 + ldp x0, x1, [sp], #32 87 + 88 + /* Check the magic value */ 89 + ldr x8, [x0], #8 90 + ldr x9, .Lmagic 91 + cmp x8, x9 92 + b.ne botch 93 + 94 + /* Restore the stack pointer */ 95 + ldr x8, [x0], #8 96 + mov sp, x8 97 + 98 + /* Restore the general purpose registers and lr */ 99 + ldp x19, x20, [x0], #16 100 + ldp x21, x22, [x0], #16 101 + ldp x23, x24, [x0], #16 102 + ldp x25, x26, [x0], #16 103 + ldp x27, x28, [x0], #16 104 + ldp x29, x30, [x0], #16 105 + 106 + /* Restore the vfp registers */ 107 + ldp d8, d9, [x0], #16 108 + ldp d10, d11, [x0], #16 109 + ldp d12, d13, [x0], #16 110 + ldp d14, d15, [x0] 111 + 112 + /* Load the return value */ 113 + mov x0, x1 114 + ret 115 + 116 + botch: 117 + bl _HIDDEN(abort) 118 + END_STRONG(longjmp)
+28
lib/libc/arch/aarch64/gen/signbitl.c
··· 1 + /* $OpenBSD: signbitl.c,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> 4 + * 5 + * Permission to use, copy, modify, and distribute this software for any 6 + * purpose with or without fee is hereby granted, provided that the above 7 + * copyright notice and this permission notice appear in all copies. 8 + * 9 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 + */ 17 + 18 + #include <sys/types.h> 19 + #include <machine/ieee.h> 20 + #include <math.h> 21 + 22 + int 23 + __signbitl(long double e) 24 + { 25 + struct ieee_ext *p = (struct ieee_ext *)&e; 26 + 27 + return p->ext_sign; 28 + }
+53
lib/libc/arch/aarch64/gen/sigsetjmp.S
··· 1 + /* $OpenBSD: sigsetjmp.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /*- 3 + * Copyright (c) 2014 The FreeBSD Foundation 4 + * All rights reserved. 5 + * 6 + * This software was developed by Andrew Turner under 7 + * sponsorship from the FreeBSD Foundation. 8 + * 9 + * Redistribution and use in source and binary forms, with or without 10 + * modification, are permitted provided that the following conditions 11 + * are met: 12 + * 1. Redistributions of source code must retain the above copyright 13 + * notice, this list of conditions and the following disclaimer. 14 + * 2. Redistributions in binary form must reproduce the above copyright 15 + * notice, this list of conditions and the following disclaimer in the 16 + * documentation and/or other materials provided with the distribution. 17 + * 18 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 + * SUCH DAMAGE. 29 + */ 30 + 31 + #include <machine/asm.h> 32 + 33 + #include <machine/setjmp.h> 34 + 35 + ENTRY(sigsetjmp) 36 + cmp x1, #0 37 + b.eq _C_LABEL(_setjmp) 38 + b _C_LABEL(setjmp) 39 + //END(sigsetjmp) 40 + 41 + ENTRY(siglongjmp) 42 + /* Load the _setjmp magic */ 43 + ldr x2, .Lmagic 44 + ldr x3, [x0] 45 + 46 + /* Check the magic */ 47 + cmp x2, x3 48 + b.eq _C_LABEL(_longjmp) 49 + b _C_LABEL(longjmp) 50 + .Lmagic: 51 + .align 3 52 + .quad _JB_MAGIC__SETJMP 53 + //END(siglongjmp)
+5
lib/libc/arch/aarch64/net/Makefile.inc
··· 1 + # $OpenBSD: Makefile.inc,v 1.1 2017/01/11 18:09:24 patrick Exp $ 2 + # $NetBSD: Makefile.inc,v 1.1 2000/12/29 20:13:53 bjh21 Exp $ 3 + 4 + # hton* and nto* functions provided by ../gen/byte_swap_*.S 5 + SRCS+=
+9
lib/libc/arch/aarch64/string/Makefile.inc
··· 1 + # $OpenBSD: Makefile.inc,v 1.1 2017/01/11 18:09:24 patrick Exp $ 2 + 3 + SRCS+= bcopy.c memcpy.c memmove.c \ 4 + strchr.c strrchr.c \ 5 + bcmp.c bzero.c ffs.c memchr.c memcmp.c memset.c \ 6 + strcmp.c strncmp.c \ 7 + strcat.c strcpy.c strcspn.c strlen.c strlcat.c strlcpy.c \ 8 + strncat.c strncpy.c strpbrk.c strsep.c \ 9 + strspn.c swab.c strstr.c
+55
lib/libc/arch/aarch64/sys/Ovfork.S
··· 1 + /* $OpenBSD: Ovfork.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: Ovfork.S,v 1.6 2003/08/07 16:42:03 agc Exp $ */ 3 + 4 + /*- 5 + * Copyright (c) 1990 The Regents of the University of California. 6 + * All rights reserved. 7 + * 8 + * Redistribution and use in source and binary forms, with or without 9 + * modification, are permitted provided that the following conditions 10 + * are met: 11 + * 1. Redistributions of source code must retain the above copyright 12 + * notice, this list of conditions and the following disclaimer. 13 + * 2. Redistributions in binary form must reproduce the above copyright 14 + * notice, this list of conditions and the following disclaimer in the 15 + * documentation and/or other materials provided with the distribution. 16 + * 3. Neither the name of the University nor the names of its contributors 17 + * may be used to endorse or promote products derived from this software 18 + * without specific prior written permission. 19 + * 20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 + * SUCH DAMAGE. 31 + * 32 + * from: @(#)Ovfork.s 5.1 (Berkeley) 4/23/90 33 + */ 34 + 35 + #include "SYS.h" 36 + 37 + /* 38 + * pid = vfork(); 39 + * 40 + * On return from the SWI: 41 + * r1 == 0 in parent process, r1 == 1 in child process. 42 + * r0 == pid of child in parent, r0 == pid of parent in child. 43 + */ 44 + .text 45 + .align 0 46 + 47 + SYSENTRY_HIDDEN(vfork) 48 + mov x2, x30 49 + SYSTRAP(vfork) 50 + bcs CERROR 51 + sub x1, x1, #1 /* r1 == 0xffffffff if parent, 0 if child */ 52 + and x0, x0, x1 /* r0 == 0 if child, else unchanged */ 53 + mov x30, x2 54 + ret 55 + SYSCALL_END_HIDDEN(vfork)
+96
lib/libc/arch/aarch64/sys/brk.S
··· 1 + /* $OpenBSD: brk.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: brk.S,v 1.7 2003/12/26 11:23:44 martin Exp $ */ 3 + 4 + /*- 5 + * Copyright (c) 1990 The Regents of the University of California. 6 + * All rights reserved. 7 + * 8 + * Redistribution and use in source and binary forms, with or without 9 + * modification, are permitted provided that the following conditions 10 + * are met: 11 + * 1. Redistributions of source code must retain the above copyright 12 + * notice, this list of conditions and the following disclaimer. 13 + * 2. Redistributions in binary form must reproduce the above copyright 14 + * notice, this list of conditions and the following disclaimer in the 15 + * documentation and/or other materials provided with the distribution. 16 + * 3. Neither the name of the University nor the names of its contributors 17 + * may be used to endorse or promote products derived from this software 18 + * without specific prior written permission. 19 + * 20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 + * SUCH DAMAGE. 31 + * 32 + * from: @(#)brk.s 5.2 (Berkeley) 12/17/90 33 + */ 34 + 35 + #include "SYS.h" 36 + 37 + .globl _C_LABEL(end) 38 + .globl CURBRK 39 + 40 + #ifdef WEAK_ALIAS 41 + WEAK_ALIAS(brk, _brk) 42 + #endif 43 + 44 + .data 45 + .align 0 46 + .globl _C_LABEL(__minbrk) 47 + .type _C_LABEL(__minbrk),#object 48 + _C_LABEL(__minbrk): 49 + .quad _C_LABEL(end) 50 + 51 + /* 52 + * Change the data segment size 53 + */ 54 + SYSENTRY(_brk) 55 + #ifdef __PIC__ 56 + /* Setup the GOT */ 57 + adrp x3, :got:minbrk 58 + ldr x1, [x3, #:got_lo12:minbrk] 59 + #else 60 + ldr x1, .Lminbrk 61 + #endif 62 + /* Get the minimum allowable brk address */ 63 + ldr x1, [x1] 64 + 65 + /* 66 + * Valid the address specified and set to the minimum 67 + * if the address is below minbrk. 68 + */ 69 + cmp x0, x1 70 + b.ge 1f 71 + mov x0, x1 72 + 1: 73 + mov x2, x0 74 + SYSTRAP(break) 75 + bcs CERROR 76 + 77 + #ifdef __PIC__ 78 + adrp x3, :got:minbrk 79 + ldr x1, [x3, #:got_lo12:minbrk] 80 + #else 81 + ldr x1, .Lcurbrk 82 + #endif 83 + /* Store the new address in curbrk */ 84 + str x2, [x1] 85 + 86 + /* Return 0 for success */ 87 + mov x0, #0x00000000 88 + ret 89 + 90 + .align 3 91 + #if !defined(__PIC__) 92 + .Lminbrk: 93 + .quad _C_LABEL(__minbrk) 94 + .Lcurbrk: 95 + .quad CURBRK 96 + #endif
+44
lib/libc/arch/aarch64/sys/cerror.S
··· 1 + /* $OpenBSD: cerror.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /*- 3 + * Copyright (c) 2014 Andrew Turner 4 + * All rights reserved. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions 8 + * are met: 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 15 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 + * SUCH DAMAGE. 26 + * 27 + */ 28 + 29 + #include "SYS.h" 30 + 31 + _ENTRY(CERROR) 32 + stp x0, x30, [sp,#-16]! 33 + bl _C_LABEL(__errno) 34 + ldp x1, x30, [sp],#16 35 + str x1, [x0] 36 + movn x0, #0 37 + movn x1, #0 38 + ret 39 + END(CERROR) 40 + 41 + #if !defined(__PIC__) 42 + .Lerrno: 43 + .word errno 44 + #endif
+86
lib/libc/arch/aarch64/sys/sbrk.S
··· 1 + /* $OpenBSD: sbrk.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: sbrk.S,v 1.7 2003/08/07 16:42:05 agc Exp $ */ 3 + 4 + /*- 5 + * Copyright (c) 1990 The Regents of the University of California. 6 + * All rights reserved. 7 + * 8 + * Redistribution and use in source and binary forms, with or without 9 + * modification, are permitted provided that the following conditions 10 + * are met: 11 + * 1. Redistributions of source code must retain the above copyright 12 + * notice, this list of conditions and the following disclaimer. 13 + * 2. Redistributions in binary form must reproduce the above copyright 14 + * notice, this list of conditions and the following disclaimer in the 15 + * documentation and/or other materials provided with the distribution. 16 + * 3. Neither the name of the University nor the names of its contributors 17 + * may be used to endorse or promote products derived from this software 18 + * without specific prior written permission. 19 + * 20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 + * SUCH DAMAGE. 31 + * 32 + * from: @(#)sbrk.s 5.1 (Berkeley) 4/23/90 33 + */ 34 + 35 + #include "SYS.h" 36 + 37 + .globl _C_LABEL(end) 38 + 39 + #ifdef WEAK_ALIAS 40 + WEAK_ALIAS(sbrk, _sbrk) 41 + #endif 42 + 43 + .data 44 + .align 0 45 + .globl CURBRK 46 + .type CURBRK,#object 47 + .globl minbrk 48 + .type minbrk,#object 49 + CURBRK: 50 + .quad _C_LABEL(end) 51 + _ASM_LABEL(minbrk): 52 + .quad _C_LABEL(end) 53 + 54 + /* 55 + * Change the data segment size 56 + */ 57 + SYSENTRY(_sbrk) 58 + #ifdef __PIC__ 59 + /* Setup the GOT */ 60 + adrp x3, :got:CURBRK 61 + ldr x2, [x3, #:got_lo12:CURBRK] 62 + #else 63 + ldr x2, .Lcurbrk 64 + #endif 65 + /* Get the current brk address */ 66 + ldr x1, [x2] 67 + 68 + /* Calculate new value */ 69 + mov x3, x0 70 + add x0, x0, x1 71 + SYSTRAP(break) 72 + bcs CERROR 73 + 74 + /* Store new curbrk value */ 75 + ldr x0, [x2] 76 + add x1, x0, x3 77 + str x1, [x2] 78 + 79 + /* Return old curbrk value */ 80 + ret 81 + 82 + .align 0 83 + #if !defined(__PIC__) 84 + .Lcurbrk: 85 + .word CURBRK 86 + #endif
+43
lib/libc/arch/aarch64/sys/sigpending.S
··· 1 + /* $OpenBSD: sigpending.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: sigpending.S,v 1.5 2003/08/07 16:42:05 agc Exp $ */ 3 + 4 + /*- 5 + * Copyright (c) 1990 The Regents of the University of California. 6 + * All rights reserved. 7 + * 8 + * Redistribution and use in source and binary forms, with or without 9 + * modification, are permitted provided that the following conditions 10 + * are met: 11 + * 1. Redistributions of source code must retain the above copyright 12 + * notice, this list of conditions and the following disclaimer. 13 + * 2. Redistributions in binary form must reproduce the above copyright 14 + * notice, this list of conditions and the following disclaimer in the 15 + * documentation and/or other materials provided with the distribution. 16 + * 3. Neither the name of the University nor the names of its contributors 17 + * may be used to endorse or promote products derived from this software 18 + * without specific prior written permission. 19 + * 20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 + * SUCH DAMAGE. 31 + * 32 + * from: @(#)sigpending.s 5.1 (Berkeley) 7/1/90 33 + */ 34 + 35 + #include "SYS.h" 36 + 37 + SYSENTRY(sigpending) 38 + ldr w0, [x0] 39 + SYSTRAP(sigpending) 40 + bcs CERROR 41 + mov x0, #0 42 + ret 43 + SYSCALL_END(sigpending)
+53
lib/libc/arch/aarch64/sys/sigprocmask.S
··· 1 + /* $OpenBSD: sigprocmask.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: sigprocmask.S,v 1.5 2003/08/07 16:42:05 agc Exp $ */ 3 + 4 + /*- 5 + * Copyright (c) 1990 The Regents of the University of California. 6 + * All rights reserved. 7 + * 8 + * Redistribution and use in source and binary forms, with or without 9 + * modification, are permitted provided that the following conditions 10 + * are met: 11 + * 1. Redistributions of source code must retain the above copyright 12 + * notice, this list of conditions and the following disclaimer. 13 + * 2. Redistributions in binary form must reproduce the above copyright 14 + * notice, this list of conditions and the following disclaimer in the 15 + * documentation and/or other materials provided with the distribution. 16 + * 3. Neither the name of the University nor the names of its contributors 17 + * may be used to endorse or promote products derived from this software 18 + * without specific prior written permission. 19 + * 20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 + * SUCH DAMAGE. 31 + * 32 + * from: @(#)sigprocmask.s 5.2 (Berkeley) 12/17/90 33 + */ 34 + 35 + #include "SYS.h" 36 + 37 + SYSENTRY_HIDDEN(sigprocmask) 38 + cbz x1, 2f 39 + ldr w1, [x1] 40 + b 2f 41 + 1: 42 + mov w0, #0x00000001 43 + mov x1, #0x00000000 44 + 2: 45 + 46 + SYSTRAP(sigprocmask) 47 + bcs CERROR 48 + cbz x2, 1f 49 + str w0, [x2] 50 + 1: 51 + mov x0, #0x00000000 52 + ret 53 + SYSCALL_END_HIDDEN(sigprocmask)
+43
lib/libc/arch/aarch64/sys/sigsuspend.S
··· 1 + /* $OpenBSD: sigsuspend.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: sigsuspend.S,v 1.6 2003/08/07 16:42:05 agc Exp $ */ 3 + 4 + /*- 5 + * Copyright (c) 1990 The Regents of the University of California. 6 + * All rights reserved. 7 + * 8 + * Redistribution and use in source and binary forms, with or without 9 + * modification, are permitted provided that the following conditions 10 + * are met: 11 + * 1. Redistributions of source code must retain the above copyright 12 + * notice, this list of conditions and the following disclaimer. 13 + * 2. Redistributions in binary form must reproduce the above copyright 14 + * notice, this list of conditions and the following disclaimer in the 15 + * documentation and/or other materials provided with the distribution. 16 + * 3. Neither the name of the University nor the names of its contributors 17 + * may be used to endorse or promote products derived from this software 18 + * without specific prior written permission. 19 + * 20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 + * SUCH DAMAGE. 31 + * 32 + * from: @(#)sigsuspend.s 5.2 (Berkeley) 12/17/90 33 + */ 34 + 35 + #include "SYS.h" 36 + 37 + SYSENTRY_HIDDEN(sigsuspend) 38 + ldr w0, [x0] 39 + SYSTRAP(sigsuspend) 40 + bcs CERROR 41 + mov x0, #0 42 + ret 43 + SYSCALL_END_HIDDEN(sigsuspend)
+37
lib/libc/arch/aarch64/sys/syscall.S
··· 1 + /* $OpenBSD: syscall.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* $NetBSD: syscall.S,v 1.4 2003/08/07 16:42:05 agc Exp $ */ 3 + 4 + /*- 5 + * Copyright (c) 1990 The Regents of the University of California. 6 + * All rights reserved. 7 + * 8 + * Redistribution and use in source and binary forms, with or without 9 + * modification, are permitted provided that the following conditions 10 + * are met: 11 + * 1. Redistributions of source code must retain the above copyright 12 + * notice, this list of conditions and the following disclaimer. 13 + * 2. Redistributions in binary form must reproduce the above copyright 14 + * notice, this list of conditions and the following disclaimer in the 15 + * documentation and/or other materials provided with the distribution. 16 + * 3. Neither the name of the University nor the names of its contributors 17 + * may be used to endorse or promote products derived from this software 18 + * without specific prior written permission. 19 + * 20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 + * SUCH DAMAGE. 31 + * 32 + * from: @(#)syscall.s 5.1 (Berkeley) 4/23/90 33 + */ 34 + 35 + #include "SYS.h" 36 + 37 + RSYSCALL(syscall)
+39
lib/libc/arch/aarch64/sys/tfork_thread.S
··· 1 + /* $OpenBSD: tfork_thread.S,v 1.1 2017/01/11 18:09:24 patrick Exp $ */ 2 + /* 3 + * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> 4 + * 5 + * Permission to use, copy, modify, and distribute this software for any 6 + * purpose with or without fee is hereby granted, provided that the above 7 + * copyright notice and this permission notice appear in all copies. 8 + * 9 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 + */ 17 + #include <sys/syscall.h> 18 + #include <machine/asm.h> 19 + #include "SYS.h" 20 + 21 + /* 22 + * r0 r1 r2 r3 23 + * __tfork_thread(param, psize, start_fnc, start_arg); 24 + */ 25 + 26 + ENTRY(__tfork_thread) 27 + SYSTRAP(__tfork) 28 + bcs CERROR 29 + 30 + /* check if we are parent or child */ 31 + cbz x1, 1f 32 + ret 33 + 34 + 1: 35 + /* child */ 36 + mov x0, x3 37 + blr x2 38 + SYSTRAP(__threxit) 39 + END(__tfork_thread)