Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)

- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
This commit is contained in:
2013-12-06 12:04:52 +01:00
parent ff10274392
commit 84d9c625bf
4655 changed files with 379317 additions and 151059 deletions

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.149 2012/01/20 16:31:29 joerg Exp $
# $NetBSD: Makefile,v 1.160 2013/10/14 16:00:17 joerg Exp $
# @(#)Makefile 8.2 (Berkeley) 2/3/94
#
# All library objects contain sccsid strings by default; they may be
@@ -19,6 +19,8 @@
.include "Makefile.inc"
LIBC_MACHINE_ARCH?= ${MACHINE_ARCH} # for MKCOMPAT
LIB= c
CPPFLAGS+= -I${.CURDIR}/include -I${.CURDIR}
@@ -35,22 +37,24 @@ CLEANFILES+= assym.h assym.h.tmp
assym.h: ${ARCHDIR}/genassym.cf
${_MKTARGET_CREATE}
${TOOL_GENASSYM} -- ${CC} ${CFLAGS} \
${TOOL_GENASSYM} -- ${CC} ${CFLAGS:N-Wa,--fatal-warnings} \
${CPPFLAGS} ${CPPFLAGS.assym.h} ${PROF} \
< ${ARCHDIR}/genassym.cf > assym.h.tmp && \
mv -f assym.h.tmp assym.h
.endif
# The following controls how to build compatibility code for old NetBSD
# binaries. If BUILDCOLD is yes, then we build a separate library; otherwise
# binaries. If BUILD_LEGACY is yes, then we build a separate library; otherwise
# we include the code in libc.
BUILDCOLD?= no
.if "${BUILDCOLD}" == "yes"
BUILD_LEGACY?= no
.if "${BUILD_LEGACY}" == "yes"
SUBDIR=compat
.include <bsd.subdir.mk>
.else
COMPATDIR=${.CURDIR}/compat
.include "${.CURDIR}/compat/Makefile.inc"
# Marker for compat code that can't be easily isolated
CPPFLAGS+= -D__BUILD_LEGACY
.endif
.if defined(__MINIX)
@@ -64,6 +68,9 @@ SUBDIR+= pkgconfig
.include "${.CURDIR}/db/Makefile.inc"
.include "${.CURDIR}/citrus/Makefile.inc"
.include "${.CURDIR}/compat-43/Makefile.inc"
.if ${HAVE_LIBGCC} == "no"
.include "${.CURDIR}/compiler_rt/Makefile.inc"
.endif
.include "${.CURDIR}/dlfcn/Makefile.inc"
.include "${.CURDIR}/gdtoa/Makefile.inc"
.include "${.CURDIR}/gen/Makefile.inc"
@@ -109,6 +116,9 @@ SUBDIR+= pkgconfig
.include "${.CURDIR}/tls/Makefile.inc"
.endif
.include "${.CURDIR}/sys/Makefile.inc"
.if ${HAVE_LIBGCC} == "no"
.include "${NETBSDSRCDIR}/sys/lib/libunwind/Makefile.inc"
.endif
.include "${.CURDIR}/uuid/Makefile.inc"
.if (${MKYP} != "no")
.include "${.CURDIR}/yp/Makefile.inc"
@@ -167,3 +177,6 @@ CSHLIBFLAGS+= -D_I18N_DYNAMIC
# force the dynamic linker to initialize libc first
SHLIB_SHFLAGS+= -Wl,-z,initfirst
.if ${HAVE_LIBGCC} == "no"
SHLIB_SHFLAGS+= -Wl,-z,defs
.endif

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.14 2012/03/21 14:52:40 christos Exp $
# $NetBSD: Makefile.inc,v 1.16 2013/09/19 21:18:17 christos Exp $
# @(#)Makefile 8.2 (Berkeley) 2/3/94
#
# All library objects contain sccsid strings by default; they may be
@@ -38,9 +38,10 @@ USE_SHLIBDIR= yes
WARNS=5
.if defined(__MINIX)
CPPFLAGS+= -D_LIBC
CPPFLAGS+= -DMLIBDIR=\"${MLIBDIR}\"
.else
CPPFLAGS+= -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT
CPPFLAGS+= -D_DIAGNOSTIC
CPPFLAGS+= -D_DIAGNOSTIC -DMLIBDIR=\"${MLIBDIR}\"
.endif
.if (${USE_HESIOD} != "no")
@@ -58,7 +59,7 @@ CPPFLAGS+= -DYP
.endif
# Set lint to exit on warnings
LINTFLAGS+= -w
#LINTFLAGS+= -w
# ignore 'empty translation unit' warnings.
LINTFLAGS+= -X 272

View File

@@ -1,4 +1,4 @@
/* $NetBSD: __longjmp14.c,v 1.5 2008/04/28 20:22:55 martin Exp $ */
/* $NetBSD: __longjmp14.c,v 1.7 2013/03/13 08:05:46 martin Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -74,6 +74,7 @@ __longjmp14(jmp_buf env, int val)
uc.uc_mcontext.__gregs[_REG_S5] = sc->sc_regs[R_S5];
uc.uc_mcontext.__gregs[_REG_S6] = sc->sc_regs[R_S6];
uc.uc_mcontext.__gregs[_REG_RA] = sc->sc_regs[R_RA];
uc.uc_mcontext.__gregs[_REG_GP] = sc->sc_regs[R_GP];
uc.uc_mcontext.__gregs[_REG_SP] = sc->sc_sp;
uc.uc_mcontext.__gregs[_REG_PC] = sc->sc_pc;
uc.uc_mcontext.__gregs[_REG_PS] =

View File

@@ -1,4 +1,4 @@
/* $NetBSD: __setjmp14.S,v 1.5 2011/06/12 05:44:36 matt Exp $ */
/* $NetBSD: __setjmp14.S,v 1.6 2013/03/12 19:38:20 martin Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -55,6 +55,7 @@ LEAF(__setjmp14, 1)
stq s6, (SC_REGS+_REG_S6)(a0)
stq ra, (SC_REGS+_REG_RA)(a0)
stq sp, (SC_REGS+_REG_SP)(a0)
stq gp, (SC_REGS+_REG_GP)(a0)
/*
* get signal information

View File

@@ -1,4 +1,4 @@
/* $NetBSD: fpsetmask.c,v 1.4 2005/06/12 05:21:25 lukem Exp $ */
/* $NetBSD: fpsetmask.c,v 1.5 2013/11/02 23:54:04 christos Exp $ */
/*
* Copyright (c) 1995 Ross Harvey
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetmask.c,v 1.4 2005/06/12 05:21:25 lukem Exp $");
__RCSID("$NetBSD: fpsetmask.c,v 1.5 2013/11/02 23:54:04 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -46,8 +46,7 @@ __weak_alias(fpsetmask,_fpsetmask)
#endif
fp_except
fpsetmask(mask)
fp_except mask;
fpsetmask(fp_except mask)
{
struct alpha_fp_except_args a;

View File

@@ -1,4 +1,4 @@
/* $NetBSD: fpsetsticky.c,v 1.4 2005/06/12 05:21:25 lukem Exp $ */
/* $NetBSD: fpsetsticky.c,v 1.5 2013/11/02 23:54:04 christos Exp $ */
/*
* Copyright (c) 1999 Ross Harvey
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetsticky.c,v 1.4 2005/06/12 05:21:25 lukem Exp $");
__RCSID("$NetBSD: fpsetsticky.c,v 1.5 2013/11/02 23:54:04 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -46,8 +46,7 @@ __weak_alias(fpsetsticky,_fpsetsticky)
#endif
fp_except
fpsetsticky(sticky)
fp_except sticky;
fpsetsticky(fp_except sticky)
{
struct alpha_fp_except_args a;

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.16 2012/09/27 11:20:20 skrll Exp $
# $NetBSD: Makefile.inc,v 1.25 2013/09/03 00:30:19 matt Exp $
.include <bsd.own.mk>
@@ -6,23 +6,36 @@
SRCS+= __aeabi_read_tp.S __sigaction14_sigtramp.c __sigtramp2.S
.endif
CPPFLAGS += -I.
CPPFLAGS += -DSOFTFLOAT
.if empty(LIBC_MACHINE_ARCH:Mearmv7*)
AFLAGS+= -marm
.endif
.if ${MACHINE_ARCH} == "earm" || ${MACHINE_ARCH} == "earmeb" || defined(__MINIX)
CPPFLAGS += -I.
.if !empty(LIBC_MACHINE_ARCH:Mearm*)
SRCS+= __aeabi_ldivmod.S __aeabi_uldivmod.S
SRCS+= __aeabi_lcmp.c __aeabi_ulcmp.c
SRCS+= fixunsgen_ieee754.c fixunssfsi_ieee754.c
SRCS+= fixunsgen64_ieee754.c fixunsdfsi_ieee754.c
SRCS+= arm_initfini.c
.endif
.if ${MKSOFTFLOAT} != "no"
CPPFLAGS += -DSOFTFLOAT
# for earm, use the 64-bit softfloat
.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "armeb"
.if ${LIBC_MACHINE_ARCH} == "arm" || ${LIBC_MACHINE_ARCH} == "armeb"
SOFTFLOAT_BITS=32
#SRCS+= floatunsidf_ieee754.c floatunsisf_ieee754.c
.endif
.if defined(__MINIX)
.include "${LIBCDIR}/softfloat/Makefile.inc"
.else
.include <softfloat/Makefile.inc>
.else
.PATH : ${ARCHDIR}/hardfloat
SRCS.hardfloat+= fpgetround.c fpgetsticky.S fpgetmask.S
SRCS.hardfloat+= fpsetround.c fpsetmask.S fpsetsticky.S
.for f in ${SRCS.hardfloat}
CPPFLAGS.${f} += -mfpu=vfp
.endfor
SRCS+= ${SRCS.hardfloat}
.endif

View File

@@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.10 2011/01/14 06:12:16 matt Exp $ */
/* $NetBSD: SYS.h,v 1.15 2013/08/19 22:13:34 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -34,31 +34,63 @@
* from: @(#)SYS.h 5.5 (Berkeley) 5/7/91
*/
#define _TEXT_SECTION .section .text.hot, "ax"
#include <machine/asm.h>
#include <sys/syscall.h>
#include <arm/swi.h>
#ifdef __STDC__
#define SYSTRAP(x) swi SWI_OS_NETBSD | SYS_ ## x
#else
#define SYSTRAP(x) swi SWI_OS_NETBSD | SYS_/**/x
#ifndef __STDC__
#error __STDC__ not defined
#endif
#ifdef __ELF__
#if !defined(__thumb__)
#define SYSTRAP(x) svc #SWI_OS_NETBSD | SYS_ ## x
#else
.macro emitsvc x
mov ip, r0
.ifeq \x / 256
movs r0, #\x
.else
#if defined(_ARM_ARCH_7)
movw r0, #\x
#else
.ifeq (\x & 3)
movs r0, #(\x / 4)
lsls r0, r0, #3
.else
.ifeq (\x & 1)
movs r0, #(\x / 2)
lsls r0, r0, #1
.else
movs r0, #(\x / 256)
lsls r0, r0, #8
adds r0, r0, #(\x & 255)
.endif
.endif
#endif /* !_ARM_ARCH_7 */
.endif
svc #255
.endm
#define SYSTRAP(x) emitsvc SYS_ ## x
#endif /* __thumb__ */
#define CERROR _C_LABEL(__cerror)
#define CURBRK _C_LABEL(__curbrk)
#else
#define CERROR _ASM_LABEL(cerror)
#define CURBRK _ASM_LABEL(curbrk)
#endif
#define _SYSCALL_NOERROR(x,y) \
ENTRY(x); \
SYSTRAP(y)
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
#define _INVOKE_CERROR() bcs CERROR
#else
#define _INVOKE_CERROR() \
bcc 86f; push {r3,lr}; bl CERROR; pop {r3,pc}; 86:
#endif
#define _SYSCALL(x, y) \
_SYSCALL_NOERROR(x,y); \
bcs CERROR
_INVOKE_CERROR()
#define SYSCALL_NOERROR(x) \
_SYSCALL_NOERROR(x,x)
@@ -69,11 +101,13 @@
#define PSEUDO_NOERROR(x,y) \
_SYSCALL_NOERROR(x,y); \
RET
RET; \
END(x)
#define PSEUDO(x,y) \
_SYSCALL(x,y); \
RET
RET; \
END(x)
#define RSYSCALL_NOERROR(x) \
@@ -91,4 +125,5 @@
PSEUDO(weak,weak)
#endif
.hidden CERROR
.globl CERROR

View File

@@ -1,7 +1,9 @@
# $NetBSD: Makefile.inc,v 1.19 2012/10/10 02:15:03 christos Exp $
# $NetBSD: Makefile.inc,v 1.25 2013/08/21 03:09:39 matt Exp $
SRCS+= alloca.S byte_swap_2.S byte_swap_4.S bswap64.c divsi3.S \
fabs.c flt_rounds.c modsi3.S umodsi3.S
SRCS+= alloca.S byte_swap_2.S byte_swap_4.S bswap64.c divide.S divsi3.S \
fabs.c flt_rounds.c udivsi3.S
CPUFLAGS.divide.S+= -marm
# Common ieee754 constants and functions
SRCS+= infinityf_ieee754.c infinity_ieee754.c infinityl_dbl_ieee754.c
@@ -11,6 +13,13 @@ SRCS+= isinff_ieee754.c isinfd_ieee754.c
SRCS+= isnanf_ieee754.c isnand_ieee754.c
SRCS+= signbitf_ieee754.c signbitd_ieee754.c
.if !empty(LIBC_MACHINE_ARCH:Mearm*)
SRCS+= __aeabi_fcmpun.c __aeabi_dcmpun.c
SRCS+= __aeabi_idiv0.c __aeabi_ldiv0.c
.else
SRCS+= modsi3.S umodsi3.S
.endif
SRCS+= nanf.c
SRCS+= setjmp.S

View File

@@ -0,0 +1,54 @@
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_dcmpun.c,v 1.1 2013/01/26 07:04:22 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include <arm/aeabi.h>
#include <arm/ieee.h>
#include <math.h>
/*
* result (1, 0) denotes (?, <=>) [2], use for C99 isunordered()
*/
int
__aeabi_dcmpun(double x, double y)
{
const union ieee_double_u ux = { .dblu_d = x };
const union ieee_double_u uy = { .dblu_d = y };
return (ux.dblu_dbl.dbl_exp == DBL_EXP_INFNAN
&& (ux.dblu_dbl.dbl_frach|ux.dblu_dbl.dbl_fracl) != 0)
|| (uy.dblu_dbl.dbl_exp == DBL_EXP_INFNAN
&& (uy.dblu_dbl.dbl_frach|uy.dblu_dbl.dbl_fracl) != 0);
}

View File

@@ -0,0 +1,54 @@
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_fcmpun.c,v 1.1 2013/01/26 07:04:22 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include <arm/aeabi.h>
#include <arm/ieee.h>
#include <math.h>
/*
* result (1, 0) denotes (?, <=>) [2], use for C99 isunordered()
*/
int
__aeabi_fcmpun(float x, float y)
{
const union ieee_single_u ux = { .sngu_f = x };
const union ieee_single_u uy = { .sngu_f = y };
return (ux.sngu_sng.sng_exp == SNG_EXP_INFNAN
&& ux.sngu_sng.sng_frac != 0)
|| (uy.sngu_sng.sng_exp == SNG_EXP_INFNAN
&& uy.sngu_sng.sng_frac != 0);
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: _setjmp.S,v 1.7 2012/08/01 06:02:13 matt Exp $ */
/* $NetBSD: _setjmp.S,v 1.16 2013/11/30 20:20:42 joerg Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe
@@ -32,6 +32,14 @@
* SUCH DAMAGE.
*/
#if !defined(__SOFTFP__) && !defined(__VFP_FP__) && !defined(__ARM_PCS)
#error FPA is not supported anymore
#endif
#if defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)
.fpu vfp
#endif
#include <machine/asm.h>
#include <machine/setjmp.h>
@@ -45,65 +53,142 @@
* The previous signal state is NOT restored.
*
* Note: r0 is the return value
* r1-r3 are scratch registers in functions
* r1-r3,ip are scratch registers in functions
*/
ENTRY(_setjmp)
ldr r1, .L_setjmp_magic
str r1, [r0], #4
#ifdef SOFTFLOAT
add r0, r0, #52
#elif defined(__VFP_FP__)
#error _setjmp VFP support missing
#else
/* Store fp registers */
sfm f4, 4, [r0], #48
/* Store fpsr */
rfs r1
str r1, [r0], #0x0004
#endif /* SOFTFLOAT */
/* Store integer registers */
stmia r0, {r4-r14}
mov r0, #0x00000000
#if defined(__ARM_EABI__) && (!defined(__thumb__) || defined(_ARM_ARCH_T2))
ldr r2, .Lfpu_present
#ifdef __PIC__
add r2, r2, pc /* pc = &.LPIC0 */
#endif
ldr r2, [r2]
.LPIC0:
#if defined(__thumb__) && defined(_ARM_ARCH_T2)
cbz r2, 1f
#else
cmp r2, #0 /* do we have a FPU? */
beq 1f /* no, don't save VFP registers */
#endif
orrs r1, r1, #(_JB_MAGIC__SETJMP ^ _JB_MAGIC__SETJMP_VFP)
/* change magic to VFP magic */
adds r2, r0, #(_JB_REG_D8 * 4)
vstmia r2, {d8-d15}
vmrs r2, fpscr
str r2, [r0, #(_JB_REG_FPSCR * 4)]
1:
#endif /* __ARM_EABI__ && (_ARM_ARCH_T2 || !__thumb__) */
str r1, [r0]
adds r0, r0, #(_JB_REG_R4 * 4)
/* Store integer registers */
#if !defined(__thumb__) || defined(_ARCH_ARCH_T2)
stmia r0, {r4-r14}
#else
stmia r0!, {r4-r7}
mov r1, r8
mov r2, r9
mov r3, r10
stmia r0!, {r1-r3}
mov r2, r11
mov r3, r12
stmia r0!, {r2-r3}
mov r2, sp
mov r3, lr
stmia r0!, {r2-r3}
#endif
movs r0, #0
RET
.L_setjmp_magic:
.word _JB_MAGIC__SETJMP
#if defined(__ARM_EABI__) && (!defined(__thumb__) || defined(_ARM_ARCH_T2))
.align 0
.Lfpu_present:
.word REL_SYM(_libc_arm_fpu_present, .LPIC0)
#endif /* __ARM_EABI__ && (_ARM_ARCH_T2 || !__thumb__) */
END(_setjmp)
ENTRY(_longjmp)
ldr r2, .L_setjmp_magic
ldr r3, [r0], #4
teq r2, r3
bne botch
#ifdef SOFTFLOAT
add r0, r0, #52
#elif defined(__VFP_FP__)
#error _longjmp VFP support missing
ldr r2, [r0] /* get magic from jmp_buf */
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
bics r3, r2, #(_JB_MAGIC__SETJMP ^ _JB_MAGIC__SETJMP_VFP)
/* ignore VFP-ness of magic */
ldr ip, .L_setjmp_magic /* load magic */
#else
/* Restore fp registers */
lfm f4, 4, [r0], #48
/* Restore fpsr */
ldr r4, [r0], #0x0004
wfs r4
#endif /* SOFTFLOAT */
ldr r3, .L_setjmp_magic /* load magic */
mov ip, r3
movs r3, #(_JB_MAGIC__SETJMP ^ _JB_MAGIC__SETJMP_VFP)
ands r3, r3, r2
eors r3, r3, r2 /* ignore VFP-ness of magic */
#endif
cmp ip, r3 /* magic correct? */
bne botch /* no, botch */
#if defined(__ARM_EABI__) && (!defined(__thumb__) || defined(_ARM_ARCH_T2))
cmp r3, r2 /* did magic change? */
beq 1f /* no, don't restore VFP */
adds r3, r0, #(_JB_REG_D8 * 4)
vldmia r3, {d8-d15}
ldr r3, [r0, #(_JB_REG_FPSCR * 4)]
vmsr fpscr, r3
1:
#endif /* __ARM_EABI__ && (_ARM_ARCH_T2 || !__thumb__) */
adds r0, r0, #(_JB_REG_R4 * 4)
/* Restore integer registers */
ldmia r0, {r4-r14}
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
ldmia r0!, {r4-r12}
#else
ldmia r0!, {r4-r7}
ldmia r0!, {r2-r3}
mov r8, r2
mov r9, r3
ldmia r0!, {r2-r3}
mov r10, r2
mov r1, r3
adds r0, r0, #4 /* skip r12 */
#endif
ldmia r0!, {r2-r3} /* r2 = sp, r3 = lr */
/* Validate sp and r14 */
teq sp, #0
teqne r14, #0
#if defined(__thumb__) && defined(_ARM_ARCH_T2)
cbz r2, botch
#else
cmp r2, #0
beq botch
#endif
mov sp, r2
#if defined(__thumb__) && defined(_ARM_ARCH_T2)
cbz r3, botch
#else
cmp r3, #0
beq botch
#endif
mov lr, r3
/* Set return value */
mov r0, r1
teq r0, #0x00000000
moveq r0, #0x00000001
movs r0, r1
#ifdef __thumb__
bne 1f
movs r0, #1
1:
#else
moveq r0, #1
#endif
RET
/* validation failed, die die die. */
botch:
bl PIC_SYM(_C_LABEL(longjmperror), PLT)
bl PIC_SYM(_C_LABEL(abort), PLT)
b . - 8 /* Cannot get here */
bl PLT_SYM(_C_LABEL(longjmperror))
bl PLT_SYM(_C_LABEL(abort))
1: b 1b /* Cannot get here */
.align 0
.L_setjmp_magic:
.word _JB_MAGIC__SETJMP
END(_longjmp)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: alloca.S,v 1.4 2004/08/21 11:20:10 rearnsha Exp $ */
/* $NetBSD: alloca.S,v 1.5 2013/08/17 01:07:45 matt Exp $ */
/*
* Copyright (c) 1995 Mark Brinicombe
@@ -37,8 +37,17 @@
#include <machine/asm.h>
ENTRY(alloca)
add r0, r0, #0x00000007 /* round up to next 8 byte alignment */
bic r0, r0, #0x00000007
sub sp, sp, r0 /* Adjust the stack pointer */
mov r0, sp /* r0 = base of new space */
adds r0, r0, #7 /* round up to next 8 byte alignment */
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
bics r0, r0, #7
sub sp, sp, r0 /* Adjust the stack pointer */
mov r0, sp /* r0 = base of new space */
#else
lsrs r0, r0, #3
lsls r0, r0, #3
mov r1, sp
subs r0, r1, r0 /* Adjust the stack pointer */
mov sp, r0 /* r0 = base of new space */
#endif
RET
END(alloca)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: setjmp.S,v 1.9 2012/08/01 06:02:13 matt Exp $ */
/* $NetBSD: setjmp.S,v 1.17 2013/11/30 20:20:42 joerg Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe
@@ -32,6 +32,14 @@
* SUCH DAMAGE.
*/
#if !defined(__SOFTFP__) && !defined(__VFP_FP__) && !defined(__ARM_PCS)
#error FPA is not supported anymore
#endif
#if defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)
.fpu vfp
#endif
#include <machine/asm.h>
#include <machine/setjmp.h>
@@ -47,79 +55,174 @@
ENTRY(__setjmp14)
/* Get the signal mask. */
stmfd sp!, {r0-r2, r14}
add r2, r0, #(_JB_SIGMASK * 4)
mov r1, #0x00000000
mov r0, #0x00000000
bl PIC_SYM(_C_LABEL(__sigprocmask14), PLT)
ldmfd sp!, {r0-r2, r14}
push {r0-r2, lr}
#if !defined(__thumb__)
adds r2, r0, #(_JB_SIGMASK * 4)
#else
mov r2, r0
adds r2, r2, #(_JB_SIGMASK * 4)
#endif
movs r1, #0
movs r0, #0
bl PLT_SYM(_C_LABEL(__sigprocmask14))
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
pop {r0-r2, lr}
#else
pop {r0-r3}
mov lr, r3
#endif
ldr r1, .Lsetjmp_magic
str r1, [r0], #4
#ifdef SOFTFLOAT
add r0, r0, #52
#elif defined(__VFP_FP__)
#error __setjmp14 VFP support missing
#if defined(__ARM_EABI__) && (!defined(__thumb__) || defined(_ARM_ARCH_T2))
ldr r2, .Lfpu_present
#ifdef __PIC__
add r2, r2, pc /* pc = &.LPIC0 */
#endif
ldr r2, [r2]
.LPIC0:
#if defined(__thumb__) && defined(_ARM_ARCH_T2)
cbz r2, 1f /* don't save if we don't have a FPU */
#else
/* Store fp registers */
sfm f4, 4, [r0], #48
/* Store fpsr */
rfs r1
str r1, [r0], #0x0004
#endif /*SOFTFLOAT*/
cmp r2, #0 /* do we have a FPU? */
beq 1f /* no, don't save VFP registers */
#endif
orrs r1, r1, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP)
/* change magic to VFP magic */
adds r2, r0, #(_JB_REG_D8 * 4)
vstmia r2, {d8-d15}
vmrs r2, fpscr
str r2, [r0, #(_JB_REG_FPSCR * 4)]
1:
#endif /* __ARM_EABI__ && (!__thumb__ || _ARM_ARCH_T2) */
str r1, [r0] /* store magic */
/* Store integer registers */
stmia r0, {r4-r14}
mov r0, #0x00000000
RET
.Lsetjmp_magic:
.word _JB_MAGIC_SETJMP
adds r0, r0, #(_JB_REG_R4 * 4)
#if !defined(__thumb__)
stmia r0!, {r4-lr}
#else
stmia r0!, {r4-r7}
mov r2, r8
mov r3, r9
stmia r0!, {r2-r3}
mov r2, r10
mov r3, r11
stmia r0!, {r2-r3}
mov r2, sp
mov r3, lr
str r2, [r0, #4]
str r3, [r0, #8]
#endif
movs r0, #0
RET
#if defined(__ARM_EABI__) && (!defined(__thumb__) || defined(_ARM_ARCH_T2))
.align 0
.Lfpu_present:
.word REL_SYM(_libc_arm_fpu_present, .LPIC0)
#endif /* __ARM_EABI__ && (!__thumb__ || _ARM_ARCH_T2) */
END(__setjmp14)
ENTRY(__longjmp14)
ldr r2, .Lsetjmp_magic
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
ldr r2, [r0]
ldr ip, .Lsetjmp_magic
bic r3, r2, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP)
#else
ldr r3, .Lsetjmp_magic
mov ip, r3
ldr r3, [r0]
teq r2, r3
movs r2, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP)
bics r3, r2
/* r2 is not the magic but we don't need it since we can't do VFP */
#endif
cmp r3, ip
bne .Lbotch
/* Restore the signal mask. */
stmfd sp!, {r0-r2, r14}
mov r2, #0x00000000
add r1, r0, #(_JB_SIGMASK * 4)
mov r0, #3 /* SIG_SETMASK */
bl PIC_SYM(_C_LABEL(__sigprocmask14), PLT)
ldmfd sp!, {r0-r2, r14}
add r0, r0, #4
#ifdef SOFTFLOAT
add r0, r0, #52
#elif defined(__VFP_FP__)
#error __longjmp14 VFP support missing
push {r0-r2, lr}
movs r2, #0
#if !defined(__thumb__)
adds r1, r0, #(_JB_SIGMASK * 4)
#else
/* Restore fp registers */
lfm f4, 4, [r0], #48
/* Restore FPSR */
ldr r4, [r0], #0x0004
wfs r4
#endif /* SOFTFLOAT */
/* Restore integer registers */
ldmia r0, {r4-r14}
mov r1, r0
adds r1, r1, #(_JB_SIGMASK * 4)
#endif
movs r0, #3 /* SIG_SETMASK */
bl PLT_SYM(_C_LABEL(__sigprocmask14))
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
pop {r0-r2, lr}
#else
pop {r0-r3}
mov lr, r3
#endif
/* Validate sp and r14 */
teq sp, #0
teqne r14, #0
#if defined(__ARM_EABI__) && (!defined(__thumb__) || defined(_ARM_ARCH_T2))
tst r2, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP)
/* is this a VFP magic? */
beq 1f /* no, don't restore VFP */
adds r2, r0, #(_JB_REG_D8 * 4)
vldmia r2, {d8-d15}
ldr r2, [r0, #(_JB_REG_FPSCR * 4)]
vmsr fpscr, r2
1:
#endif /* __ARM_EABI__ && (!__thumb__ || _ARM_ARCH_T2) */
adds r0, r0, #(_JB_REG_R4 * 4)
/* Restore integer registers */
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
ldmia r0!, {r4-r12}
#else
ldmia r0!, {r4-r7}
ldmia r0!, {r2-r3}
mov r8, r2
mov r9, r3
ldmia r0!, {r2-r3}
mov r10, r2
mov r11, r3
adds r0, r0, #4 /* skip ip(r12) */
#endif
ldmia r0!, {r2-r3}
/* Validate sp and lr */
#if defined(__thumb__) && defined(_ARM_ARCH_T2)
cbz r2, .Lbotch
#else
cmp r2, #0
beq .Lbotch
#endif
mov sp, r2
#if defined(__thumb__) && defined(_ARM_ARCH_T2)
cbz r3, .Lbotch
#else
cmp r3, #0
beq .Lbotch
#endif
mov lr, r3
/* Set return value */
mov r0, r1
teq r0, #0x00000000
moveq r0, #0x00000001
movs r0, r1
#if !defined(__thumb__)
moveq r0, #1
#else
bne 1f
movs r0, #1
1:
#endif
RET
/* validation failed, die die die. */
.Lbotch:
bl PIC_SYM(_C_LABEL(longjmperror), PLT)
bl PIC_SYM(_C_LABEL(abort), PLT)
b . - 8 /* Cannot get here */
bl PLT_SYM(_C_LABEL(longjmperror))
bl PLT_SYM(_C_LABEL(abort))
1: b 1b /* Cannot get here */
.align 0
.Lsetjmp_magic:
.word _JB_MAGIC_SETJMP
END(__longjmp14)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: sigsetjmp.S,v 1.5 2005/10/16 17:26:24 christos Exp $ */
/* $NetBSD: sigsetjmp.S,v 1.8 2013/11/30 20:20:42 joerg Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe
@@ -46,16 +46,50 @@
*/
ENTRY(__sigsetjmp14)
teq r1, #0
beq PIC_SYM(_C_LABEL(_setjmp), PLT)
b PIC_SYM(_C_LABEL(__setjmp14), PLT)
.L_setjmp_magic:
.word _JB_MAGIC__SETJMP
#if defined(__thumb__) && defined(_ARM_ARCH_T2)
cbnz r1, 1f
b PLT_SYM(_C_LABEL(_setjmp))
1: b PLT_SYM(_C_LABEL(__setjmp14))
#elif !defined(__thumb__)
cmp r1, #0
beq PLT_SYM(_C_LABEL(_setjmp))
b PLT_SYM(_C_LABEL(__setjmp14))
#else
push {r3, lr}
beq 1f
bl PLT_SYM(_C_LABEL(__setjmp14))
b 2f
1: bl PLT_SYM(_C_LABEL(_setjmp))
2: pop {r3, pc}
#endif
END(__sigsetjmp14)
ENTRY(__siglongjmp14)
ldr r2, .L_setjmp_magic
ldr r3, [r0]
teq r2, r3
beq PIC_SYM(_C_LABEL(_longjmp), PLT)
b PIC_SYM(_C_LABEL(__longjmp14), PLT)
#if !defined(__thumb__)
bics r3, r3, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP)
#else
movs r2, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP)
bics r3, r3, r2
#endif
ldr r2, .L_setjmp_magic
cmp r2, r3
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
#ifdef __thumb__
it eq
#endif
beq PLT_SYM(_C_LABEL(_longjmp))
b PLT_SYM(_C_LABEL(__longjmp14))
#else
push {r3, lr}
beq 11f
bl PLT_SYM(_C_LABEL(__longjmp14))
pop {r3, pc}
11: bl PLT_SYM(_C_LABEL(_longjmp))
pop {r3, pc}
#endif
.align 0
.L_setjmp_magic:
.word _JB_MAGIC__SETJMP
END(__siglongjmp14)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: swapcontext.S,v 1.8 2012/09/27 11:20:20 skrll Exp $ */
/* $NetBSD: swapcontext.S,v 1.14 2013/11/30 20:20:42 joerg Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,22 +33,63 @@
#include "assym.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: swapcontext.S,v 1.8 2012/09/27 11:20:20 skrll Exp $")
RCSID("$NetBSD: swapcontext.S,v 1.14 2013/11/30 20:20:42 joerg Exp $")
#endif /* LIBC_SCCS && !lint */
ENTRY(swapcontext)
stmfd sp!, {r0-r1, lr} /* Must save oucp, ucp, lr. */
sub sp, #4
bl PIC_SYM(_C_LABEL(_getcontext), PLT) /* getcontext(oucp) */
#if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
.fnstart
.cfi_startproc
#endif
push {r0-r2, lr} /* Must save oucp, ucp, lr. */
#if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
.save {r0-r2, lr}
.cfi_def_cfa_offset 16
.cfi_offset 14, -4
.cfi_offset 2, -8
.cfi_offset 1, -12
.cfi_offset 0, -16
#endif
bl PLT_SYM(_C_LABEL(_getcontext)) /* getcontext(oucp) */
cmp r0, #0
add sp, #4
ldmfd sp!, {r0-r1, lr}
#if !defined(__thumb__)
pop {r0-r2, lr}
#if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
.cfi_def_cfa_offset 0
#endif
RETc(ne)
#else
pop {r0-r3}
beq 1f
#if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
.cfi_def_cfa_offset 0
.cfi_register 14, 3
#endif
RETr(r3)
1:
#endif
#if !defined(__thumb__)
str sp, [r0, #_UC_REGS_SP] /* Adjust saved SP. */
str lr, [r0, #_UC_REGS_PC] /* Adjust saved PC. */
str lr, [r0, #_UC_REGS_PC] /* Adjust saved SP. */
#else
mov r2, sp
str r2, [r0, #_UC_REGS_SP] /* Adjust saved SP. */
str r3, [r0, #_UC_REGS_PC] /* Adjust saved PC. */
mov lr, r3
#endif
#ifdef SOFTFLOAT
/* Ahem. */
#endif
mov r0, r1
bl PIC_SYM(_C_LABEL(setcontext), PLT)
RET
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
b PLT_SYM(_C_LABEL(setcontext))
#else
push {lr}
bl PLT_SYM(_C_LABEL(setcontext))
pop {pc}
#endif
#if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
.cfi_endproc
.fnend
#endif
END(swapcontext)

View File

@@ -0,0 +1,40 @@
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <arm/asm.h>
RCSID("$NetBSD: fabs.S,v 1.2 2013/11/30 22:39:04 joerg Exp $")
.fpu vfp
ENTRY(fabsl)
ENTRY(fabs)
vabs.f64 d0, d0
RET
END(fabs)

View File

@@ -1,9 +1,12 @@
/* $NetBSD: fpgetmask.S,v 1.5 2012/08/01 06:10:21 matt Exp $ */
/* $NetBSD: fpgetmask.S,v 1.7 2013/08/02 02:07:00 matt Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,28 +15,25 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Mark Brinicombe
* for the NetBSD project.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#ifndef __VFP_FP__
#error FPA is not supported anymore
#endif
#include <arm/asm.h>
#include <arm/vfpreg.h>
/*
* Return the current FP exception enable mask
@@ -41,15 +41,12 @@
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpgetmask, _fpgetmask)
ENTRY(_fpgetmask)
#else
#define fpgetmask _fpgetmask
#endif
ENTRY(fpgetmask)
#endif
#ifdef __VFP_FP__
#error _fpgetmask VFP support missing
#else
rfs r0
mov r0, r0, lsr #16
and r0, r0, #0x1f
vmrs r0, fpscr
mov r0, r0, lsr #8
and r0, r0, #VFP_FPSCR_CSUM
RET
#endif
END(fpgetmask)

View File

@@ -1,9 +1,12 @@
/* $NetBSD: fpgetround.c,v 1.5 2012/06/24 15:26:02 christos Exp $ */
/* $NetBSD: fpgetround.c,v 1.6 2013/01/11 13:55:26 matt Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,28 +15,27 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Mark Brinicombe
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __VFP_FP__
#error FPA is not supported anymore
#endif
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpgetround.c,v 1.5 2012/06/24 15:26:02 christos Exp $");
__RCSID("$NetBSD: fpgetround.c,v 1.6 2013/01/11 13:55:26 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -41,32 +43,24 @@ __RCSID("$NetBSD: fpgetround.c,v 1.5 2012/06/24 15:26:02 christos Exp $");
#include <sys/types.h>
#include <ieeefp.h>
#include <arm/vfpreg.h>
#ifdef __weak_alias
__weak_alias(fpgetround,_fpgetround)
#endif
/*
* Return the current FP rounding mode
*
* ok all we need to do is return the current FP rounding mode
*
* HOWEVER:
* The ARM FPA codes the rounding mode into the actual FP instructions
* so there is no such thing as a global rounding mode.
* The default is round to nearest if rounding is not explicitly specified.
* FP instructions generated by GCC will not explicitly specify a rounding
* mode.
*
* So the best we can do it to return the rounding mode FP instructions
* use if rounding is not specified which is round to nearest.
*
* This could change in the future with new floating point emulators or
* soft float FP libraries.
*/
fp_rnd
fpgetround(void)
{
return(FP_RN);
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RN, VFP_FPSCR_RMODE) == FP_RN);
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RP, VFP_FPSCR_RMODE) == FP_RP);
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RM, VFP_FPSCR_RMODE) == FP_RM);
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RZ, VFP_FPSCR_RMODE) == FP_RZ);
uint32_t fpscr;
__asm __volatile("vmrs %0, fpscr" : "=r" (fpscr));
return __SHIFTOUT(fpscr, VFP_FPSCR_RMODE);
}

View File

@@ -1,9 +1,12 @@
/* $NetBSD: fpgetsticky.S,v 1.5 2012/08/01 06:10:21 matt Exp $ */
/* $NetBSD: fpgetsticky.S,v 1.6 2013/01/11 13:55:26 matt Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,28 +15,25 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Mark Brinicombe
* for the NetBSD project.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __VFP_FP__
#error FPA is not supported anymore
#endif
#include <machine/asm.h>
#include <arm/asm.h>
#include <arm/vfpreg.h>
/*
* Return the current FP cumulative flags
@@ -41,14 +41,11 @@
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpgetsticky, _fpgetsticky)
ENTRY(_fpgetsticky)
#else
#define fpgetsticky _fpgetsticky
#endif
ENTRY(fpgetsticky)
#endif
#ifdef __VFP_FP__
#error _fpgetsticky VFP support missing
#else
rfs r0
and r0, r0, #0x1f
vmrs r0, fpscr
and r0, r0, #VFP_FPSCR_CSUM
RET
#endif
END(fpgetsticky)

View File

@@ -1,9 +1,12 @@
/* $NetBSD: fpsetmask.S,v 1.5 2012/08/01 06:10:21 matt Exp $ */
/* $NetBSD: fpsetmask.S,v 1.6 2013/01/11 13:55:26 matt Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,28 +15,26 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Mark Brinicombe
* for the NetBSD project.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#ifndef __VFP_FP__
#error FPA is not supported anymore
#endif
#include <arm/asm.h>
#include <arm/vfpreg.h>
/*
* Set the current FP exception enable mask
@@ -41,18 +42,17 @@
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpsetmask, _fpsetmask)
ENTRY(_fpsetmask)
#else
#define fpsetmask _fpsetmask
#endif
ENTRY(fpsetmask)
#endif
#ifdef __VFP_FP__
#error _fpsetmask VFP support missing
#else
rfs r1
bic r1, r1, #0x001f0000
and r0, r0, #0x0000001f
orr r0, r1, r0, lsl #16
wfs r0
mov r0, r1, lsr #16 /* Return old mask */
and r2, r0, #VFP_FPSCR_CSUM
vmrs r1, fpscr
mov r0, r1, lsr #8 /* Return old mask */
bic r1, r1, #VFP_FPSCR_ESUM
orr r1, r1, r2, lsl #8
vmsr fpscr, r1
mcr p10, 7, r1, c1, c0, 0
and r0, r0, #VFP_FPSCR_CSUM
RET
#endif
END(fpsetmask)

View File

@@ -1,9 +1,12 @@
/* $NetBSD: fpsetround.c,v 1.6 2006/02/25 02:28:55 wiz Exp $ */
/* $NetBSD: fpsetround.c,v 1.8 2013/02/03 01:50:54 matt Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,28 +15,27 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Mark Brinicombe
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __VFP_FP__
#error FPA is not supported anymore
#endif
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetround.c,v 1.6 2006/02/25 02:28:55 wiz Exp $");
__RCSID("$NetBSD: fpsetround.c,v 1.8 2013/02/03 01:50:54 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -41,30 +43,27 @@ __RCSID("$NetBSD: fpsetround.c,v 1.6 2006/02/25 02:28:55 wiz Exp $");
#include <sys/types.h>
#include <ieeefp.h>
#include <arm/vfpreg.h>
#ifdef __weak_alias
__weak_alias(fpsetround,_fpsetround)
#endif
/*
* Return the current FP rounding mode
*
* ok all we need to do is return the current FP rounding mode
*
* HOWEVER:
* The ARM FPA codes the rounding mode into the actual FP instructions
* so there is no such thing as a global rounding mode.
* The default is round to nearest if rounding is not explicitly specified.
* FP instructions generated by GCC will not explicitly specify a rounding
* mode.
*
* All we can do is abort if they ask for anything else.
*/
fp_rnd
fpsetround(fp_rnd rnd_dir)
fpsetround(fp_rnd new_rnd)
{
if (rnd_dir != FP_RN)
abort();
return (FP_RN);
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RN, VFP_FPSCR_RMODE) == FP_RN);
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RP, VFP_FPSCR_RMODE) == FP_RP);
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RM, VFP_FPSCR_RMODE) == FP_RM);
__CTASSERT(__SHIFTOUT(VFP_FPSCR_RZ, VFP_FPSCR_RMODE) == FP_RZ);
uint32_t fpscr;
__asm __volatile("vmrs %0, fpscr" : "=r" (fpscr));
fp_rnd old_rnd = __SHIFTOUT(fpscr, VFP_FPSCR_RMODE);
fpscr ^= __SHIFTIN(new_rnd ^ old_rnd, VFP_FPSCR_RMODE);
__asm __volatile("vmsr fpscr, %0" :: "r" (fpscr));
return old_rnd;
}

View File

@@ -1,9 +1,12 @@
/* $NetBSD: fpsetsticky.S,v 1.5 2012/08/01 06:10:21 matt Exp $ */
/* $NetBSD: fpsetsticky.S,v 1.6 2013/01/11 13:55:26 matt Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,28 +15,26 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Mark Brinicombe
* for the NetBSD project.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#ifndef __VFP_FP__
#error FPA is not supported anymore
#endif
#include <arm/asm.h>
#include <arm/vfpreg.h>
/*
* Set the current FP cumulative flags
@@ -41,18 +42,15 @@
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpsetsticky, _fpsetsticky)
ENTRY(_fpsetsticky)
#else
#define fpsetsticky _fpsetsticky
#endif
ENTRY(fpsetsticky)
#endif
#ifdef __VFP_FP__
#error _fpsetsticky VFP support missing
#else
rfs r1
bic r1, r1, #0x1f
and r0, r0, #0x1f
orr r0, r1, r0
wfs r0
mov r0, r1 /* Return old mask */
and r1, r0, #VFP_FPSCR_CSUM
vmrs r0, fpscr
bic r2, r0, #VFP_FPSCR_CSUM
orr r1, r1, r2
vmsr fpscr, r1
and r0, r0, #VFP_FPSCR_CSUM
RET
#endif
END(fpsetsticky)

View File

@@ -0,0 +1,72 @@
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: arm_initfini.c,v 1.7 2013/09/08 13:15:53 matt Exp $");
#include "namespace.h"
/*
* To properly implement setjmp/longjmp for the ARM AAPCS ABI, it has to be
* aware of whether there is a FPU is present or not. Regardless of whether
* the hard-float ABI is being used, setjmp needs to save D8-D15. But it can
* only do this if those instructions won't cause an exception.
*/
#include <sys/param.h>
#include <sys/sysctl.h>
#include <stdbool.h>
#include <stddef.h>
__dso_hidden int _libc_arm_fpu_present;
#ifndef __ARM_ARCH_EXT_IDIV__
__dso_hidden int _libc_arm_hwdiv_present;
#endif
static bool _libc_aapcs_initialized;
void _libc_aapcs_init(void) __attribute__((__constructor__, __used__));
void __section(".text.startup")
_libc_aapcs_init(void)
{
if (!_libc_aapcs_initialized) {
size_t len = sizeof(_libc_arm_fpu_present);
_libc_aapcs_initialized = true;
#if !defined(__minix)
(void)sysctlbyname("machdep.fpu_present",
&_libc_arm_fpu_present, &len, NULL, 0);
#ifndef __ARM_ARCH_EXT_IDIV__
(void)sysctlbyname("machdep.hwdiv_present",
&_libc_arm_hwdiv_present, &len, NULL, 0);
#endif
#endif /* !defined(__minix) */
}
}

View File

@@ -0,0 +1,23 @@
/* $NetBSD: __aeabi_dcmpeq.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
/*
* Written by Ben Harris, 2000. This file is in the Public Domain.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_dcmpeq.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
int __aeabi_dcmpeq(float64, float64);
int
__aeabi_dcmpeq(float64 a, float64 b)
{
return float64_eq(a, b);
}

View File

@@ -0,0 +1,23 @@
/* $NetBSD: __aeabi_dcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
/*
* Written by Ben Harris, 2000. This file is in the Public Domain.
*/
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_dcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
#endif /* LIBC_SCCS and not lint */
int __aeabi_dcmpge(float64, float64);
int
__aeabi_dcmpge(float64 a, float64 b)
{
return !float64_lt(a, b) && float64_eq(a, a) && float64_eq(b, b);
}

View File

@@ -0,0 +1,23 @@
/* $NetBSD: __aeabi_dcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
/*
* Written by Ben Harris, 2000. This file is in the Public Domain.
*/
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_dcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
#endif /* LIBC_SCCS and not lint */
int __aeabi_dcmpgt(float64, float64);
int
__aeabi_dcmpgt(float64 a, float64 b)
{
return !float64_le(a, b) && float64_eq(a, a) && float64_eq(b, b);
}

View File

@@ -0,0 +1,23 @@
/* $NetBSD: __aeabi_dcmple.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
/*
* Written by Ben Harris, 2000. This file is in the Public Domain.
*/
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_dcmple.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
#endif /* LIBC_SCCS and not lint */
int __aeabi_dcmple(float64, float64);
int
__aeabi_dcmple(float64 a, float64 b)
{
return float64_le(a, b);
}

View File

@@ -0,0 +1,23 @@
/* $NetBSD: __aeabi_dcmplt.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
/*
* Written by Ben Harris, 2000. This file is in the Public Domain.
*/
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_dcmplt.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
#endif /* LIBC_SCCS and not lint */
int __aeabi_dcmplt(float64, float64);
int
__aeabi_dcmplt(float64 a, float64 b)
{
return float64_lt(a, b);
}

View File

@@ -0,0 +1,28 @@
/* $NetBSD: __aeabi_dcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
/*
* Written by Richard Earnshaw, 2003. This file is in the Public Domain.
*/
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_dcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
#endif /* LIBC_SCCS and not lint */
int __aeabi_dcmpun(float64, float64);
int
__aeabi_dcmpun(float64 a, float64 b)
{
/*
* The comparison is unordered if either input is a NaN.
* Test for this by comparing each operand with itself.
* We must perform both comparisons to correctly check for
* signalling NaNs.
*/
return !float64_eq(a, a) || !float64_eq(b, b);
}

View File

@@ -0,0 +1,23 @@
/* $NetBSD: __aeabi_fcmpeq.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
/*
* Written by Ben Harris, 2000. This file is in the Public Domain.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_fcmpeq.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
int __aeabi_fcmpeq(float32, float32);
int
__aeabi_fcmpeq(float32 a, float32 b)
{
return float32_eq(a, b);
}

View File

@@ -0,0 +1,23 @@
/* $NetBSD: __aeabi_fcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
/*
* Written by Ben Harris, 2000. This file is in the Public Domain.
*/
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_fcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
#endif /* LIBC_SCCS and not lint */
int __aeabi_fcmpge(float32, float32);
int
__aeabi_fcmpge(float32 a, float32 b)
{
return !float32_lt(a, b) && float32_eq(a, a) && float32_eq(b, b);
}

View File

@@ -0,0 +1,23 @@
/* $NetBSD: __aeabi_fcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
/*
* Written by Ben Harris, 2000. This file is in the Public Domain.
*/
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_fcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
#endif /* LIBC_SCCS and not lint */
int __aeabi_fcmpgt(float32, float32);
int
__aeabi_fcmpgt(float32 a, float32 b)
{
return !float32_le(a, b) && float32_eq(a, a) && float32_eq(b, b);
}

View File

@@ -0,0 +1,23 @@
/* $NetBSD: __aeabi_fcmple.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
/*
* Written by Ben Harris, 2000. This file is in the Public Domain.
*/
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_fcmple.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
#endif /* LIBC_SCCS and not lint */
int __aeabi_fcmple(float32, float32);
int
__aeabi_fcmple(float32 a, float32 b)
{
return float32_le(a, b);
}

View File

@@ -0,0 +1,23 @@
/* $NetBSD: __aeabi_fcmplt.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
/*
* Written by Ben Harris, 2000. This file is in the Public Domain.
*/
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_fcmplt.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
#endif /* LIBC_SCCS and not lint */
int __aeabi_fcmplt(float32, float32);
int
__aeabi_fcmplt(float32 a, float32 b)
{
return float32_lt(a, b);
}

View File

@@ -0,0 +1,28 @@
/* $NetBSD: __aeabi_fcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
/*
* Written by Richard Earnshaw, 2003. This file is in the Public Domain.
*/
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: __aeabi_fcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
#endif /* LIBC_SCCS and not lint */
int __aeabi_fcmpun(float32, float32);
int
__aeabi_fcmpun(float32 a, float32 b)
{
/*
* The comparison is unordered if either input is a NaN.
* Test for this by comparing each operand with itself.
* We must perform both comparisons to correctly check for
* signalling NaNs.
*/
return !float32_eq(a, a) || !float32_eq(b, b);
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: arm-gcc.h,v 1.3 2005/12/24 21:11:16 perry Exp $ */
/* $NetBSD: arm-gcc.h,v 1.4 2013/01/26 07:08:14 matt Exp $ */
/*
-------------------------------------------------------------------------------
@@ -71,7 +71,7 @@ name for the 64-bit integer type. Some compilers may allow `LIT64' to be
defined as the identity macro: `#define LIT64( a ) a'.
-------------------------------------------------------------------------------
*/
#define LIT64( a ) a##LL
#define LIT64( a ) a##ULL
#endif
/*

View File

@@ -1,4 +1,4 @@
/* $NetBSD: softfloat.h,v 1.9 2011/07/07 07:14:57 matt Exp $ */
/* $NetBSD: softfloat.h,v 1.10 2013/04/24 18:04:46 matt Exp $ */
/* This is a derivative work. */
@@ -44,6 +44,7 @@ the `FLOAT128' macro and the quadruple-precision format `float128'.
/* #define FLOATX80 */
/* #define FLOAT128 */
#include <stdint.h>
#include <machine/ieeefp.h>
/*

View File

@@ -1,5 +1,29 @@
# $NetBSD: Makefile.inc,v 1.8 2009/07/30 20:57:15 dsl Exp $
# $NetBSD: Makefile.inc,v 1.9 2013/08/21 03:05:35 matt Exp $
SRCS+= memcpy.S bcopy.S memmove.S memset.S bzero.S ffs.S strcmp.S
SRCS+= strncmp.S memcmp.S
SRCS.string+= memcmp.S memcpy.S memmove.S memset.S
SRCS.string+= ffs.S
SRCS.string+= bcopy.S bzero.S
SRCS.string+= strcat.S
SRCS.string+= strcpy.S strlcpy.S strncpy.S
.if empty(LIBC_MACHINE_ARCH:M*v7*)
SRCS.string+= strcmp.S strncmp.S
SRCS.string+= strlen.S strnlen.S
SRCS.string+= strchr.S strrchr.S
.endif
.for f in ${SRCS.string}
CPUFLAGS.${f}+= -marm
.for s in o po pico ln d
${f:.S=.${s}}: ${ARCHDIR}/string/Makefile.inc
.endfor
.endfor
.if !empty(LIBC_MACHINE_ARCH:M*v7*)
SRCS.string+= strcmp.S strncmp.S
SRCS.string+= strlen.S strnlen.S
SRCS.string+= strchr.S strrchr.S
.endif
SRCS.string+= strlcat.S
SRCS+= ${SRCS.string}

View File

@@ -0,0 +1,53 @@
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
RCSID("$NetBSD: strncat_naive.S,v 1.1 2013/01/23 05:44:52 matt Exp $")
/* LINTSTUB: char *strncat(char *, const char *, size_t) */
ENTRY(strncat)
teq r2, #0 /* count is 0? */
RETc(eq) /* yes, just return dst */
mov ip, r0 /* need to preserve r0 */
1: ldrb r3, [ip], #1 /* load next byte */
teq r3, #0 /* was it a NUL? */
bne 1b /* no, get next byte */
sub ip, ip, #1 /* back up one to the NUL */
2: subs r2, r2, #1 /* subtract 1 from the count */
blt 3f /* <0? write terminating NUL */
ldrb r3, [r1], #1 /* load next byte from append */
strb r3, [ip], #1 /* store it */
teq r3, #0 /* was it a NUL? */
bne 2b /* no, get next byte */
RET /* return */
3: mov r3, #0 /* load a NUL */
strb r3, [ip] /* store it */
RET /* return */
END(strncat)

View File

@@ -3,7 +3,7 @@
/* Both __sigreturn and _sigreturn are needed. */
#include <machine/asm.h>
IMPORT(_sigreturn)
IMPORT(sigreturn)
ENTRY(__sigreturn)
pop {r0} /* load sigframe.sf_scp into r0 as parameter */
b _C_LABEL(_sigreturn) /* _sigreturn(struct sigcontext *sf_scpcopy) */
b _C_LABEL(sigreturn) /* _sigreturn(struct sigcontext *sf_scpcopy) */

View File

@@ -11,6 +11,7 @@ IMPORT(resumecontext)
* Initialise the structure pointed to by ucp to the current user context
* of the calling thread. */
ENTRY(getcontext)
ENTRY(_getcontext)
/* In case a process does not use the FPU and is neither interested in
* saving its signal mask, then we can skip the context switch to
* PM and kernel altogether and only save general-purpose registers. */

View File

@@ -1,13 +1,21 @@
/* $NetBSD: __aeabi_read_tp.S,v 1.5 2013/08/19 22:10:51 matt Exp $ */
#undef __thumb__
#include "SYS.h"
ENTRY(__aeabi_read_tp)
mrc p15, 0, r0, c13, c0, 3
/*
* Implementations of this function should corrupt only the result register
* (r0) and the non-parameter integer core registers allowed to be corrupted
* by the [AAPCS] (ip, lr, and CPSR).
*/
ARM_ENTRY(__aeabi_read_tp)
mrc p15, 0, r0, c13, c0, 3
#ifndef _ARM_ARCH_6
cmp r0, #0 /* was it zero? */
cmp r0, #0 /* was it zero? */
RETc(ne) /* return it's not zero */
push {r1} /* syscall zeroes r1 */
mov ip, r1 /* syscall zeroes r1 */
SYSTRAP(_lwp_getprivate) /* can't fail */
pop {r1} /* restore r1 */
mov r1, ip /* restore r1 */
#endif
RET
_END(__aeabi_read_tp)
END(__aeabi_read_tp)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: __clone.S,v 1.6 2006/04/24 19:00:30 snj Exp $ */
/* $NetBSD: __clone.S,v 1.9 2013/11/30 20:20:42 joerg Exp $ */
/*
* Copyright (c) 2001 Christopher Gilbert
@@ -26,9 +26,8 @@
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#include <sys/errno.h>
#include "SYS.h"
#include <sys/errno.h>
#ifdef WEAK_ALIAS
WEAK_ALIAS(clone, __clone)
@@ -40,54 +39,90 @@ WEAK_ALIAS(clone, __clone)
ENTRY(__clone)
/* test stack and function are not null */
teq r0, #0x00
teqne r1, #0x00
#if defined(__thumb__) && defined(_ARM_ARCH_T2)
cbz r0, .Leinval
cbz r1, .Leinval
#elif !defined(__thumb__)
cmp r0, #0x00
cmpne r1, #0x00
beq .Leinval
#else
cmp r0, #0x00
beq .Leinval
cmp r1, #0x00
beq .Leinval
#endif
/* place the func and its arg onto the child's stack */
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
stmfd r1!, {r0, r3}
#else
subs r1, r1, #8
stmia r1!, {r0, r3}
#endif
/* syscall expects (flags, stack) */
mov r0, r2
SYSTRAP(__clone)
bcs PIC_SYM(CERROR, PLT)
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
_INVOKE_CERROR()
#else
bcs .Lcerror
#endif
/*
* r1 and r0 are the same as from fork:
* r1 == 0 in parent process, r1 == 1 in child process.
* r0 == pid of child in parent, r0 == pid of parent in child.
*/
teq r1, #0x00
/* if this is the parent then just return the pid */
#if defined(__thumb__)
#if defined(_ARM_ARCH_T2)
cbz r1, 1f
#else
cmp r1, #0x00
bne 1f
#endif
RET
1:
#else
cmp r1, #0x00
RETc(eq)
#endif
/*
* This is the child
* load the function and arg off the stack
*/
ldmfd sp!, {r1, r2}
/* setup return address */
add lr, pc, #.Lreturnhere - . - 8
pop {r1, r2}
/* place arg in r0 */
mov r0, r2
/* call the function */
#ifdef _ARM_ARCH_4T
bx r1
#ifdef _ARM_ARCH_5T
blx r1
#else
mov pc, r1
/* setup return address */
mov lr, pc
RETr(r1)
#endif
.Lreturnhere:
/* call _exit with the returned value */
b PIC_SYM(_C_LABEL(_exit), PLT)
bl PLT_SYM(_C_LABEL(_exit))
/* NOTREACHED */
/* error handler if func or stack is NULL */
.align 0
.Leinval:
mov R0, #EINVAL
b PIC_SYM(CERROR, PLT)
movs r0, #EINVAL
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
b CERROR
#else
.Lcerror:
push {lr}
bl CERROR
pop {pc}
#endif
END(__clone)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: __sigtramp2.S,v 1.2 2008/04/28 20:22:55 martin Exp $ */
/* $NetBSD: __sigtramp2.S,v 1.3 2013/08/16 23:20:59 matt Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -47,3 +47,4 @@ ENTRY_NP(__sigtramp_siginfo_2)
/* If that failed, exit with the error code. */
SYSTRAP(exit)
END(__sigtramp_siginfo_2)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: __vfork14.S,v 1.7 2004/08/21 11:30:17 rearnsha Exp $ */
/* $NetBSD: __vfork14.S,v 1.10 2013/09/03 00:30:19 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,14 +40,11 @@
* r1 == 0 in parent process, r1 == 1 in child process.
* r0 == pid of child in parent, r0 == pid of parent in child.
*/
.text
.align 0
ENTRY(__vfork14)
mov r2, r14
mov r2, lr
SYSTRAP(__vfork14)
bcs PIC_SYM(CERROR, PLT)
mov r14, r2
sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
and r0, r0, r1 /* r0 == 0 if child, else unchanged */
RET
_INVOKE_CERROR()
subs r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
ands r0, r0, r1 /* r0 == 0 if child, else unchanged */
RETr(r2)
END(__vfork14)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: brk.S,v 1.9 2011/05/13 23:14:36 nonaka Exp $ */
/* $NetBSD: brk.S,v 1.13 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -34,7 +34,7 @@
#include "SYS.h"
.globl _C_LABEL(_end)
.globl CURBRK
.globl _C_LABEL(__curbrk)
#ifdef WEAK_ALIAS
WEAK_ALIAS(brk, _brk)
@@ -43,6 +43,7 @@ WEAK_ALIAS(brk, _brk)
.data
.align 0
.globl _C_LABEL(__minbrk)
.hidden _C_LABEL(__minbrk)
.type _C_LABEL(__minbrk),#object
_C_LABEL(__minbrk):
.word _C_LABEL(_end)
@@ -51,15 +52,10 @@ _C_LABEL(__minbrk):
* Change the data segment size
*/
ENTRY(_brk)
#ifdef PIC
/* Setup the GOT */
ldr r3, .Lgot
add r3, pc, r3
.L1:
ldr r1, .Lminbrk
ldr r1, [r3, r1]
#else
ldr r1, .Lminbrk
#ifdef __PIC__
adr r3, .Lminbrk
adds r1, r1, r3
#endif
/* Get the minimum allowable brk address */
ldr r1, [r1]
@@ -69,30 +65,31 @@ ENTRY(_brk)
* if the address is below minbrk.
*/
cmp r0, r1
#ifdef __thumb__
bcs 1f
mov r0, r1
1:
#else
movcc r0, r1
#endif
mov r2, r0
SYSTRAP(break)
bcs PIC_SYM(CERROR, PLT)
_INVOKE_CERROR()
#ifdef PIC
ldr r1, .Lcurbrk
ldr r1, [r3, r1]
#else
ldr r1, .Lcurbrk
#ifdef __PIC__
adds r1, r1, r3
#endif
/* Store the new address in curbrk */
str r2, [r1]
/* Return 0 for success */
mov r0, #0x00000000
movs r0, #0
RET
.align 2
#ifdef PIC
.Lgot:
.word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (.L1+4))
#endif
.align 0
.Lminbrk:
.word PIC_SYM(_C_LABEL(__minbrk), GOT)
.word REL_SYM(_C_LABEL(__minbrk), .Lminbrk)
.Lcurbrk:
.word PIC_SYM(CURBRK, GOT)
.word REL_SYM(_C_LABEL(__curbrk), .Lminbrk)
END(_brk)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: cerror.S,v 1.8 2012/02/27 12:26:21 joerg Exp $ */
/* $NetBSD: cerror.S,v 1.13 2013/11/30 20:20:42 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -33,43 +33,70 @@
#include "SYS.h"
#ifdef PIC
.protected CERROR
#endif
ASENTRY(CERROR)
ENTRY_NP(CERROR)
#ifdef _REENTRANT
stmfd sp!, {r4, lr}
#if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
.fnstart
.cfi_startproc
#endif
push {r4, lr}
#if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
.save {r4, lr}
.cfi_def_cfa_offset 8
.cfi_offset 14, -4
.cfi_offset 4, -8
#endif
mov r4, r0
bl PIC_SYM(_C_LABEL(__errno), PLT)
bl PLT_SYM(_C_LABEL(__errno))
str r4, [r0]
mvn r0, #0x00000000
mvn r1, #0x00000000
ldmfd sp!, {r4, pc}
#ifdef __thumb__
movs r0, #0
mvns r0, r0
#else
#ifdef PIC
mvn r0, #0
#endif
mov r1, r0
pop {r4, pc}
#if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
.cfi_endproc
.fnend
#endif
#else /* !_REENTRANT */
#if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
.fnstart
.cfi_startproc
#endif
#ifdef __PIC__
/* Setup the GOT */
ldr r3, .Lgot
add r3, pc, r3
.L1:
add r3, r3, pc /* pc = &.LPIC0 */
ldr r1, .Lerrno
ldr r1, [r3, r1]
.LPIC0: ldr r1, [r3, r1]
#else
ldr r1, .Lerrno
#endif /* PIC */
#endif /* __PIC__ */
str r0, [r1]
mvn r0, #0x00000000
mvn r1, #0x00000000
#ifdef __thumb__
movs r0, #0
mvns r0, r0
#else
mvn r0, #0
#endif /* __thumb__ */
mov r1, r0
RET
#if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
.cfi_endproc
.fnend
#endif
#ifdef PIC
#ifdef __PIC__
.align 0
.Lgot:
.word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (.L1+4))
#endif /* PIC */
.word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - .LPIC0
#endif /* __PIC__ */
.globl _C_LABEL(errno)
.Lerrno:
.word PIC_SYM(_C_LABEL(errno), GOT)
#endif /* _REENTRANT */
END(CERROR)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: fork.S,v 1.6 2004/08/21 11:30:17 rearnsha Exp $ */
/* $NetBSD: fork.S,v 1.7 2013/08/16 22:28:05 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -42,6 +42,7 @@
*/
_SYSCALL(__fork,fork)
sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
and r0, r0, r1 /* r0 == 0 if child, else unchanged */
subs r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
ands r0, r0, r1 /* r0 == 0 if child, else unchanged */
RET
END(__fork)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: getcontext.S,v 1.6 2008/04/28 20:22:55 martin Exp $ */
/* $NetBSD: getcontext.S,v 1.10 2013/09/03 00:30:19 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,9 +30,10 @@
*/
#include "SYS.h"
#include "assym.h"
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: getcontext.S,v 1.6 2008/04/28 20:22:55 martin Exp $")
RCSID("$NetBSD: getcontext.S,v 1.10 2013/09/03 00:30:19 matt Exp $")
#endif /* SYSLIBC_SCCS && !lint */
#ifdef WEAK_ALIAS
@@ -42,13 +43,19 @@ WEAK_ALIAS(getcontext, _getcontext)
ENTRY(_getcontext)
mov r2, r0 /* Must save argument pointer. */
SYSTRAP (getcontext)
bcs PIC_SYM(CERROR, PLT)
str lr, [r2, #(36 + 15*4)] /* Adjust PC. */
_INVOKE_CERROR()
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
str lr, [r2, #_UC_REGS_PC] /* Adjust PC. */
#else
mov r3, lr
str r3, [r2, #_UC_REGS_PC] /* Adjust PC. */
#endif
#ifdef SOFTFLOAT
/* Ahem. */
/* Judging from the softfloat code we should at least save
the exception codes and rounding mode here. */
#endif
mov r0, #0
str r0, [r2, #(36 + 0*4)] /* Return 0. */
movs r0, #0
str r0, [r2, #_UC_REGS_R0] /* Return 0. */
RET
END(_getcontext)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: pipe.S,v 1.6 2004/08/21 11:30:17 rearnsha Exp $ */
/* $NetBSD: pipe.S,v 1.8 2013/08/16 22:21:59 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,8 +40,8 @@ WEAK_ALIAS(pipe, _pipe)
ENTRY(_pipe)
mov r2, r0
SYSTRAP(pipe)
bcs PIC_SYM(CERROR, PLT)
str r0, [r2, #0x0000]
str r1, [r2, #0x0004]
mov r0, #0x00000000
_INVOKE_CERROR()
stmia r2!, {r0-r1}
movs r0, #0
RET
END(_pipe)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: ptrace.S,v 1.8 2004/08/21 11:30:17 rearnsha Exp $ */
/* $NetBSD: ptrace.S,v 1.12 2013/11/30 20:20:42 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -35,41 +35,52 @@
ENTRY(ptrace)
#ifdef _REENTRANT
stmfd sp!, {r0-r3, lr}
sub sp, sp, #4 /* align stack */
bl PIC_SYM(_C_LABEL(__errno), PLT)
add sp, sp, #4 /* unalign stack */
mov r1, #0x00000000
str r1, [r0]
ldmfd sp!, {r0-r3, lr}
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
push {r0-r3, lr}
#else
stmfd sp!, {r0, r1}
#ifdef PIC
push {r0-r4}
mov r4, lr
#endif
sub sp, sp, #4 /* align stack */
bl PLT_SYM(_C_LABEL(__errno))
add sp, sp, #4 /* unalign stack */
movs r1, #0
str r1, [r0]
#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
pop {r0-r3, lr}
#else
mov lr, r4
pop {r0-r4}
#endif
#else
push {r0, r1}
#ifdef __PIC__
/* Setup the GOT */
ldr r0, .Lgot
add r0, pc, r0
.L1:
adr r1, .Lgot
add r0, r0, r1
ldr r1, .Lerrno
ldr r1, [r0, r1]
#else
ldr r1, .Lerrno
#endif /* PIC */
mov r0, #0x00000000
#endif /* __PIC__ */
movs r0, #0
str r0, [r1]
ldmfd sp!, {r0, r1}
pop {r0, r1}
#endif /* _REENTRANT */
SYSTRAP(ptrace)
bcs PIC_SYM(CERROR, PLT)
_INVOKE_CERROR()
RET
#ifndef _REENTRANT
#ifdef PIC
#ifdef __PIC__
.align 0
.Lgot:
.word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (.L1+4))
#endif /* PIC */
.word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - .Lgot
#endif /* __PIC__ */
.Lerrno:
.word PIC_SYM(_C_LABEL(errno), GOT)
#endif /* !_REENTRANT */
END(ptrace)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: sbrk.S,v 1.9 2011/05/13 23:14:36 nonaka Exp $ */
/* $NetBSD: sbrk.S,v 1.12 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -41,46 +41,40 @@ WEAK_ALIAS(sbrk, _sbrk)
.data
.align 0
.globl CURBRK
.type CURBRK,#object
CURBRK:
.globl _C_LABEL(__curbrk)
.hidden _C_LABEL(__curbrk)
.type _C_LABEL(__curbrk),#object
_C_LABEL(__curbrk):
.word _C_LABEL(_end)
/*
* Change the data segment size
*/
ENTRY(_sbrk)
#ifdef PIC
/* Setup the GOT */
ldr r3, .Lgot
add r3, pc, r3
.L1:
ldr r2, .Lcurbrk
ldr r2, [r3, r2]
#else
/* get address or offset to __curbrk */
ldr r2, .Lcurbrk
#ifdef __PIC__
add r2, r2, pc /* pc = &.LPIC0 */
#endif
/* Get the current brk address */
ldr r1, [r2]
/* Calculate new value */
mov r3, r0
add r0, r0, r1
.LPIC0: mov r3, r0
adds r0, r0, r1
SYSTRAP(break)
bcs PIC_SYM(CERROR, PLT)
_INVOKE_CERROR()
/* Store new curbrk value */
ldr r0, [r2]
add r1, r0, r3
adds r1, r0, r3
str r1, [r2]
/* Return old curbrk value */
RET
.align 0
#ifdef PIC
.Lgot:
.word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (.L1+4))
#endif
.Lcurbrk:
.word PIC_SYM(CURBRK, GOT)
.word REL_SYM(_C_LABEL(__curbrk), .LPIC0)
END(_sbrk)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.7 2009/11/03 05:07:25 snj Exp $ */
/* $NetBSD: SYS.h,v 1.8 2013/08/24 07:12:12 skrll Exp $ */
/* $OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:09 millert Exp $ */
@@ -44,7 +44,7 @@
ldi __CONCAT(SYS_,x), %t1 !\
.import __cerror, code !\
comb,<> %r0, %t1, __cerror !\
ldw HPPA_FRAME_ERP(%sr0,%sp), %rp
ldw HPPA_FRAME_ERP(%sr0,%sp), %rp
#define PSEUDO(x,y) !\
SYSENTRY(x) !\
@@ -65,7 +65,7 @@ SYSENTRY(x) !\
SYSEXIT(x)
#define RSYSCALL(x) PSEUDO(x,x)
#define RSYSCALL_NOERROR(x) PSEUDO_NOERROR(x,x)
#define RSYSCALL_NOERROR(x) PSEUDO_NOERROR(x,x)
#ifdef WEAK_ALIAS
#define WSYSCALL(weak,strong) !\

View File

@@ -1,4 +1,4 @@
/* $NetBSD: _resumecontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $ */
/* $NetBSD: _resumecontext.S,v 1.4 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,13 +35,13 @@
#include <machine/mcontext.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: _resumecontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $")
RCSID("$NetBSD: _resumecontext.S,v 1.4 2013/09/12 15:36:15 joerg Exp $")
#endif /* SYSLIBC_SCCS && !lint */
.import _resumecontext, code
LEAF_ENTRY_NOPROFILE(__resumecontext)
#ifdef PIC
#ifdef __PIC__
ldw HPPA_FRAME_EDP(%sp), %r19
addil LT%_C_LABEL(_resumecontext), %r19
ldw RT%_C_LABEL(_resumecontext)(%r1), %r1

View File

@@ -1,4 +1,4 @@
/* $NetBSD: resumecontext.c,v 1.4 2011/09/19 21:24:57 joerg Exp $ */
/* $NetBSD: resumecontext.c,v 1.5 2013/08/24 07:12:13 skrll Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: resumecontext.c,v 1.4 2011/09/19 21:24:57 joerg Exp $");
__RCSID("$NetBSD: resumecontext.c,v 1.5 2013/08/24 07:12:13 skrll Exp $");
#endif
#include "namespace.h"
@@ -46,7 +46,7 @@ _resumecontext(void)
ucontext_t uct;
(void)getcontext(&uct);
if (uct.uc_link == NULL)
if (uct.uc_link == NULL)
exit(0);
(void)setcontext(uct.uc_link);
_exit(-1);

View File

@@ -1,4 +1,4 @@
/* $NetBSD: brk.S,v 1.5 2012/03/14 14:18:10 skrll Exp $ */
/* $NetBSD: brk.S,v 1.6 2013/09/12 15:36:15 joerg Exp $ */
/* $OpenBSD: brk.S,v 1.7 2001/06/04 23:14:04 mickey Exp $ */
@@ -31,7 +31,7 @@
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: brk.S,v 1.5 2012/03/14 14:18:10 skrll Exp $")
RCSID("$NetBSD: brk.S,v 1.6 2013/09/12 15:36:15 joerg Exp $")
#endif /* LIBC_SCCS and not lint */
.import curbrk, data
@@ -47,14 +47,14 @@ __minbrk:
.long _end
ENTRY(_brk,0)
#ifdef PIC
#ifdef __PIC__
addil LT%__minbrk, %r19
ldw RT%__minbrk(%r1), %r1
ldw 0(%r1), %t2
#else /* !PIC */
#else /* !__PIC__ */
ldil L%__minbrk, %t1
ldw R%__minbrk(%t1), %t2
#endif /* !PIC */
#endif /* !__PIC__ */
sub,<< %t2, %arg0, %r0
copy %t2, %arg0
stw %arg0, HPPA_FRAME_ARG(0)(%sp)
@@ -62,16 +62,16 @@ ENTRY(_brk,0)
SYSCALL(break)
ldw HPPA_FRAME_ARG(0)(%sp), %arg0
#ifdef PIC
#ifdef __PIC__
addil LT%curbrk, %r19
ldw RT%curbrk(%r1), %r1
bv %r0(%rp)
stw %arg0, 0(%r1)
#else /* !PIC */
#else /* !__PIC__ */
ldil L%curbrk, %t1
bv %r0(%rp)
stw %arg0, R%curbrk(%t1)
#endif /* !PIC */
#endif /* !__PIC__ */
EXIT(brk)
.end

View File

@@ -1,4 +1,4 @@
/* $NetBSD: cerror.S,v 1.4 2008/04/28 20:22:56 martin Exp $ */
/* $NetBSD: cerror.S,v 1.5 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@ LEAF_ENTRY(__cerror)
ldw HPPA_FRAME_CRP(%sp), %rp
stw %t1, 0(%ret0)
#else
#ifdef PIC
#ifdef __PIC__
addil LT%errno, %r19
ldw RT%errno(%r1), %r1
stw %t1, 0(%r1)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: sbrk.S,v 1.5 2012/03/14 14:18:10 skrll Exp $ */
/* $NetBSD: sbrk.S,v 1.6 2013/09/12 15:36:15 joerg Exp $ */
/* $OpenBSD: sbrk.S,v 1.7 2001/06/04 23:14:04 mickey Exp $ */
@@ -31,7 +31,7 @@
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: sbrk.S,v 1.5 2012/03/14 14:18:10 skrll Exp $")
RCSID("$NetBSD: sbrk.S,v 1.6 2013/09/12 15:36:15 joerg Exp $")
#endif /* LIBC_SCCS and not lint */
.global _end
@@ -46,26 +46,26 @@ curbrk:
.long _end
ENTRY(_sbrk,0)
#ifdef PIC
#ifdef __PIC__
addil LT%curbrk, %r19
ldw RT%curbrk(%r1), %r1
ldw 0(%r1), %t2
#else /* !PIC */
#else /* !__PIC__ */
ldil L%curbrk, %t1
ldw R%curbrk(%t1), %t2
#endif /* !PIC */
#endif /* !__PIC__ */
add %arg0, %t2, %arg0
stw %arg0, HPPA_FRAME_ARG(0)(%sp)
SYSCALL(break)
#ifdef PIC
#ifdef __PIC__
addil LT%curbrk, %r19
ldw RT%curbrk(%r1), %r1
#else /* !PIC */
#else /* !__PIC__ */
ldil L%curbrk, %t1
ldo R%curbrk(%t1), %r1
#endif /* !PIC */
#endif /* !__PIC__ */
ldw 0(%r1), %ret0
ldw HPPA_FRAME_ARG(0)(%sp), %arg0
bv %r0(%rp)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.23 2008/04/28 20:22:56 martin Exp $ */
/* $NetBSD: SYS.h,v 1.24 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
ENTRY(x); \
SYSTRAP(y)
#ifdef PIC
#ifdef __PIC__
#define _SYSCALL_ERR \
PIC_PROLOGUE; \
mov PIC_GOT(CERROR), %ecx; \

View File

@@ -1,4 +1,4 @@
/* $NetBSD: fixunsdfsi.S,v 1.12 2011/05/22 20:11:47 joerg Exp $ */
/* $NetBSD: fixunsdfsi.S,v 1.13 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,13 +36,13 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: fixunsdfsi.S,v 1.12 2011/05/22 20:11:47 joerg Exp $")
RCSID("$NetBSD: fixunsdfsi.S,v 1.13 2013/09/12 15:36:15 joerg Exp $")
#endif
ENTRY(__fixunsdfsi)
fldl 4(%esp) /* argument double to accum stack */
frndint /* create integer */
#ifdef PIC
#ifdef __PIC__
PIC_PROLOGUE
leal PIC_GOTOFF(fbiggestsigned),%eax
PIC_EPILOGUE
@@ -59,7 +59,7 @@ ENTRY(__fixunsdfsi)
ret
2:
#ifdef PIC
#ifdef __PIC__
PIC_PROLOGUE
leal PIC_GOTOFF(fbiggestsigned),%eax
PIC_EPILOGUE

View File

@@ -1,4 +1,4 @@
/* $NetBSD: resumecontext.S,v 1.6 2008/04/28 20:22:56 martin Exp $ */
/* $NetBSD: resumecontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: resumecontext.S,v 1.6 2008/04/28 20:22:56 martin Exp $")
RCSID("$NetBSD: resumecontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $")
#endif /* LIBC_SCCS && !lint */
/*
@@ -48,7 +48,7 @@ NENTRY(_resumecontext) /* profiling prologue would clobber TOS */
movl %ecx,%esp
PIC_PROLOGUE
pushl %ecx
#ifdef PIC
#ifdef __PIC__
call PIC_PLT(_C_LABEL(_getcontext))
#else
call _C_LABEL(_getcontext)
@@ -62,7 +62,7 @@ NENTRY(_resumecontext) /* profiling prologue would clobber TOS */
jnz 9f /* watch out for local label use in PIC_* */
/* normal exit */
#ifdef PIC
#ifdef __PIC__
call PIC_PLT(_C_LABEL(exit))
#else
call _C_LABEL(exit)
@@ -70,7 +70,7 @@ NENTRY(_resumecontext) /* profiling prologue would clobber TOS */
/* NOTREACHED */
9:
#ifdef PIC
#ifdef __PIC__
call PIC_PLT(_C_LABEL(setcontext))
#else
call _C_LABEL(setcontext)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: setjmp.S,v 1.14 2005/09/13 01:44:08 christos Exp $ */
/* $NetBSD: setjmp.S,v 1.15 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: setjmp.S,v 1.14 2005/09/13 01:44:08 christos Exp $")
RCSID("$NetBSD: setjmp.S,v 1.15 2013/09/12 15:36:15 joerg Exp $")
#endif
/*
@@ -66,7 +66,7 @@ ENTRY(__setjmp14)
pushl %edx
pushl $0
pushl $0
#ifdef PIC
#ifdef __PIC__
call PIC_PLT(_C_LABEL(__sigprocmask14))
#else
call _C_LABEL(__sigprocmask14)
@@ -86,7 +86,7 @@ ENTRY(__longjmp14)
pushl $0
pushl %edx
pushl $3 /* SIG_SETMASK */
#ifdef PIC
#ifdef __PIC__
call PIC_PLT(_C_LABEL(__sigprocmask14))
#else
call _C_LABEL(__sigprocmask14)
@@ -107,8 +107,3 @@ ENTRY(__longjmp14)
incl %eax
1: movl %ecx,0(%esp)
ret
#ifdef __minix
.weak longjmp; sigsetjmp = __longjmp14
.weak setjmp; sigsetjmp = __setjmp14
#endif

View File

@@ -1,4 +1,4 @@
/* $NetBSD: sigsetjmp.S,v 1.16 2005/09/13 01:44:08 christos Exp $ */
/* $NetBSD: sigsetjmp.S,v 1.17 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: sigsetjmp.S,v 1.16 2005/09/13 01:44:08 christos Exp $")
RCSID("$NetBSD: sigsetjmp.S,v 1.17 2013/09/12 15:36:15 joerg Exp $")
#endif
ENTRY(__sigsetjmp14)
@@ -62,7 +62,7 @@ ENTRY(__sigsetjmp14)
pushl %edx
pushl $0
pushl $0
#ifdef PIC
#ifdef __PIC__
call PIC_PLT(_C_LABEL(__sigprocmask14))
#else
call _C_LABEL(__sigprocmask14)
@@ -86,7 +86,7 @@ ENTRY(__siglongjmp14)
pushl $0
pushl %edx
pushl $3 /* SIG_SETMASK */
#ifdef PIC
#ifdef __PIC__
call PIC_PLT(_C_LABEL(__sigprocmask14))
#else
call _C_LABEL(__sigprocmask14)
@@ -107,8 +107,3 @@ ENTRY(__siglongjmp14)
incl %eax
3: movl %ecx,0(%esp)
ret
#ifdef __minix
.weak sigsetjmp; sigsetjmp = __sigsetjmp14
.weak siglongjmp; siglongjmp = __siglongjmp14
#endif

View File

@@ -1,4 +1,4 @@
/* $NetBSD: swapcontext.S,v 1.6 2008/04/28 20:22:56 martin Exp $ */
/* $NetBSD: swapcontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,14 +31,14 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: swapcontext.S,v 1.6 2008/04/28 20:22:56 martin Exp $")
RCSID("$NetBSD: swapcontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $")
#endif /* LIBC_SCCS && !lint */
ENTRY(swapcontext)
movl 4(%esp),%ecx
PIC_PROLOGUE
pushl %ecx /* push oucp */
#ifdef PIC
#ifdef __PIC__
call PIC_PLT(_C_LABEL(_getcontext))
#else
call _C_LABEL(_getcontext)
@@ -50,7 +50,7 @@ ENTRY(swapcontext)
movl 4(%esp),%ecx
movl 0(%esp),%edx
movl %edx,(36 + 14 * 4)(%ecx) /* Adjust saved %eip ... */
#ifdef PIC
#ifdef __PIC__
movl %ebx,(36 + 8 * 4)(%ecx) /* ... clobbered PIC reg ... */
#endif
leal 4(%esp),%edx
@@ -59,7 +59,7 @@ ENTRY(swapcontext)
movl 8(%esp),%ecx
PIC_PROLOGUE
pushl %ecx /* push ucp */
#ifdef PIC
#ifdef __PIC__
call PIC_PLT(_C_LABEL(setcontext))
#else
call _C_LABEL(setcontext)

View File

@@ -3,13 +3,13 @@
/* Both __sigreturn and _sigreturn are needed. */
#include <machine/asm.h>
IMPORT(_sigreturn)
IMPORT(sigreturn)
ENTRY(__sigreturn)
addl $16, %esp
#ifndef PIC
jmp _C_LABEL(_sigreturn)
#ifndef __PIC__
jmp _C_LABEL(sigreturn)
#else
PIC_PROLOGUE /* push %ebx, but we do not care */
pop %eax /* special knowledge of how PIC works: discard pushed EBX */
jmp PIC_PLT(_C_LABEL(_sigreturn))
jmp PIC_PLT(_C_LABEL(sigreturn))
#endif /* PIC */

View File

@@ -11,6 +11,7 @@ IMPORT(resumecontext)
* Initialise the structure pointed to by ucp to the current user context
* of the calling thread. */
ENTRY(getcontext)
ENTRY(_getcontext)
/* In case a process does not use the FPU and is neither interested in
* saving its signal mask, then we can skip the context switch to
* PM and kernel altogether and only save general-purpose registers. */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: __clone.S,v 1.4 2011/11/18 20:21:41 joerg Exp $ */
/* $NetBSD: __clone.S,v 1.5 2013/09/12 15:36:15 joerg Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -77,7 +77,7 @@ ENTRY(__clone)
jne 2f /* we're the parent */
call *%ebp /* this is the clone, call the function */
#ifdef PIC
#ifdef __PIC__
PIC_PROLOGUE
pushl %eax /* clone does _exit(func(arg)); */
call PIC_PLT(_C_LABEL(_exit))

View File

@@ -1,4 +1,4 @@
/* $NetBSD: brk.S,v 1.22 2011/11/18 20:21:41 joerg Exp $ */
/* $NetBSD: brk.S,v 1.23 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: brk.S,v 1.22 2011/11/18 20:21:41 joerg Exp $")
RCSID("$NetBSD: brk.S,v 1.23 2013/09/12 15:36:15 joerg Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@@ -55,7 +55,7 @@ _C_LABEL(__minbrk):
.text
ENTRY(_brk)
#ifdef PIC
#ifdef __PIC__
movl 4(%esp),%ecx
PIC_PROLOGUE
movl PIC_GOT(_C_LABEL(__minbrk)),%edx

View File

@@ -1,4 +1,4 @@
/* $NetBSD: cerror.S,v 1.16 2012/02/27 12:26:21 joerg Exp $ */
/* $NetBSD: cerror.S,v 1.17 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: cerror.S,v 1.16 2012/02/27 12:26:21 joerg Exp $")
RCSID("$NetBSD: cerror.S,v 1.17 2013/09/12 15:36:15 joerg Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@@ -46,13 +46,13 @@
_ENTRY(CERROR)
pushl %eax
#ifdef PIC
#ifdef __PIC__
PIC_PROLOGUE
call PIC_PLT(_C_LABEL(__errno))
PIC_EPILOGUE
#else
call _C_LABEL(__errno)
#endif /* PIC */
#endif /* __PIC__ */
popl (%eax)
movl $-1,%eax
movl $-1,%edx

View File

@@ -1,4 +1,4 @@
/* $NetBSD: ptrace.S,v 1.17 2011/11/18 20:21:41 joerg Exp $ */
/* $NetBSD: ptrace.S,v 1.18 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: ptrace.S,v 1.17 2011/11/18 20:21:41 joerg Exp $")
RCSID("$NetBSD: ptrace.S,v 1.18 2013/09/12 15:36:15 joerg Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@@ -44,13 +44,13 @@
.globl _C_LABEL(__errno)
ENTRY(ptrace)
#ifdef PIC
#ifdef __PIC__
PIC_PROLOGUE
call PIC_PLT(_C_LABEL(__errno))
PIC_EPILOGUE
#else
call _C_LABEL(__errno)
#endif /* PIC */
#endif /* __PIC__ */
xorl %edx,%edx
movl %edx,(%eax)
SYSTRAP(ptrace)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: sbrk.S,v 1.20 2011/11/18 20:21:41 joerg Exp $ */
/* $NetBSD: sbrk.S,v 1.21 2013/09/12 15:36:15 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: sbrk.S,v 1.20 2011/11/18 20:21:41 joerg Exp $")
RCSID("$NetBSD: sbrk.S,v 1.21 2013/09/12 15:36:15 joerg Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@@ -53,7 +53,7 @@ CURBRK: .long _end
.text
ENTRY(_sbrk)
#ifdef PIC
#ifdef __PIC__
movl 4(%esp),%ecx
PIC_PROLOGUE
movl PIC_GOT(CURBRK),%edx

View File

@@ -1,7 +1,9 @@
# $NetBSD: Makefile.inc,v 1.4 2006/09/23 17:39:34 cherry Exp $
# $NetBSD: Makefile.inc,v 1.5 2012/12/27 10:41:18 martin Exp $
SRCS+= bswap16.c bswap32.c bswap64.c
SRCS+= flt_rounds.c fpgetround.c fpsetround.c fpgetmask.c fpsetmask.c
SRCS+= isinff_ieee754.c isinfd_ieee754.c
SRCS+= isnanf_ieee754.c isnand_ieee754.c
SRCS+= fpclassifyf_ieee754.c fpclassifyd_ieee754.c

View File

@@ -1,10 +1,15 @@
# $NetBSD: Makefile.inc,v 1.14 2011/11/22 15:25:28 joerg Exp $
# $NetBSD: Makefile.inc,v 1.16 2013/07/18 21:31:22 matt Exp $
SRCS+= __sigaction14_sigtramp.c __sigtramp2.S __m68k_read_tp.S __mmap.S
ASM+= _lwp_getprivate.S mremap.S
CPPFLAGS+= -I. # for assym.h
.if ${MKSOFTFLOAT} != "no"
CPPFLAGS+= -DSOFTLOFLOAT_NEED_FIXUNS -DSOFTFLOAT -DSOFTFLOATM68K_FOR_GCC
CPPFLAGS+= -DSOFTFLOAT_NEED_FIXUNS -DSOFTFLOAT -DSOFTFLOATM68K_FOR_GCC
. include <softfloat/Makefile.inc>
.elif ${MACHINE_ARCH} != "m68000"
.PATH : ${ARCHDIR}/hardfloat
. include "${ARCHDIR}/hardfloat/Makefile.inc"
.endif

View File

@@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.16 2003/08/07 16:42:09 agc Exp $ */
/* $NetBSD: SYS.h,v 1.18 2013/07/24 15:38:07 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -45,23 +45,15 @@
#define SYSTRAP(x) movl #SYS_/**/x,%d0; trap #0
#endif
#ifdef __ELF__
#define CERROR _C_LABEL(__cerror)
#define CURBRK _C_LABEL(__curbrk)
#else
#define CERROR _ASM_LABEL(cerror)
#define CURBRK _ASM_LABEL(curbrk)
#endif
#define _SYSCALL_NOERROR(x,y) \
ENTRY(x); \
SYSTRAP(y)
#define _SYSCALL(x,y) \
.even; \
err: jra PIC_PLT(CERROR); \
_SYSCALL_NOERROR(x,y); \
jcs err
jcs CERROR
#define SYSCALL_NOERROR(x) \
_SYSCALL_NOERROR(x,x)
@@ -71,11 +63,13 @@
#define PSEUDO_NOERROR(x,y) \
_SYSCALL_NOERROR(x,y); \
rts
rts; \
END(x)
#define PSEUDO(x,y) \
_SYSCALL(x,y); \
rts
rts; \
END(x)
#define RSYSCALL_NOERROR(x) \
PSEUDO_NOERROR(x,x)
@@ -95,3 +89,4 @@
#define ASMSTR .asciz
.globl CERROR
.hidden CERROR

View File

@@ -1,8 +1,8 @@
# $NetBSD: Makefile.inc,v 1.3 2006/03/21 22:50:13 he Exp $
# $NetBSD: Makefile.inc,v 1.4 2013/07/18 21:19:50 matt Exp $
SRCS+= strtof.c
.if ${MACHINE_ARCH} != "m68000"
.if ${MACHINE_ARCH} == "m68k"
SRCS+= strtold_pxL.c
SRCS+= strtopxL.c
.endif

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.31 2011/11/22 15:25:28 joerg Exp $
# $NetBSD: Makefile.inc,v 1.32 2013/07/18 21:34:33 matt Exp $
SRCS+= alloca.S fabs.S
@@ -14,7 +14,7 @@ SRCS+= nanf.c
# 68000-based machines use a double-extended `long double' type
# for which the generic ieee754 versions can be used
.if ${MACHINE_ARCH} == "m68000"
.if ${MACHINE_ARCH} != "m68k"
SRCS+= infinityl_dbl_ieee754.c
.else
SRCS+= infinityl.c
@@ -37,15 +37,10 @@ SRCS+= flt_rounds_softfloat.S
.if ${MKSOFTFLOAT} != "yes"
SRCS+= fpfake.c
.endif
.else
SRCS+= modf.S
SRCS+= flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S fpsetmask.S \
fpsetround.S fpsetsticky.S
SRCS+= adddf3.S addsf3.S cmpdf2.S cmpsf2.S divdf3.S \
divsf3.S divsi3.S extendsfdf2.S fixdfsi.S fixunsdfsi.S \
floatsidf.S modsi3.S muldf3.S mulsf3.S mulsi3.S \
subdf3.S subsf3.S truncdfsf2.S udivsi3.S \
umodsi3.S umulsi3.S
.endif
.if ${MACHINE_ARCH} == "m68k"
SRCS+= divsi3.S modsi3.S mulsi3.S udivsi3.S umodsi3.S umulsi3.S
.endif
SRCS+= setjmp.S longjmp.c
@@ -54,17 +49,7 @@ SRCS+= sigsetjmp.S
SRCS+= makecontext.c resumecontext.S swapcontext.S
.ifdef M68040
SRCS+= ldexp_ieee754.c # generic ieee754 version
.elifdef MKSOFTFLOAT
SRCS+= ldexp_ieee754.c # generic ieee754 version
.elifdef M68060
SRCS+= ldexp_ieee754.c # generic ieee754 version
.elif ${MACHINE_ARCH} == "m68000"
SRCS+= ldexp_ieee754.c # generic ieee754 version
.else
SRCS+= ldexp_881.c
.endif
LSRCS.m68k.gen= Lint_bswap16.c Lint_bswap32.c Lint_bswap64.c \
Lint_resumecontext.c Lint_swapcontext.c

View File

@@ -1,4 +1,4 @@
/* $NetBSD: _setjmp.S,v 1.7 2003/08/07 16:42:10 agc Exp $ */
/* $NetBSD: _setjmp.S,v 1.9 2013/07/16 22:12:20 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)_setjmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: _setjmp.S,v 1.7 2003/08/07 16:42:10 agc Exp $")
RCSID("$NetBSD: _setjmp.S,v 1.9 2013/07/16 22:12:20 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@@ -55,34 +55,36 @@
*/
ENTRY(_setjmp)
movl %sp@(4),%a0 /* save area pointer */
clrl %a0@+ /* no old onstack */
clrl %a0@+ /* no old sigmask */
movl %sp,%a0@+ /* save old SP */
movl %a6,%a0@+ /* save old FP */
clrl %a0@+ /* no old AP */
movl %sp@,%a0@+ /* save old PC */
clrl %a0@+ /* clear PS */
moveml #0x3CFC,%a0@ /* save other non-scratch regs */
movl 4(%sp),%a0 /* save area pointer */
clrl (%a0)+ /* no old onstack */
clrl (%a0)+ /* no old sigmask */
movl %sp,(%a0)+ /* save old SP */
movl %a6,(%a0)+ /* save old FP */
clrl (%a0)+ /* no old AP */
movl (%sp),(%a0)+ /* save old PC */
clrl (%a0)+ /* clear PS */
moveml #0x3CFC,(%a0) /* save other non-scratch regs */
clrl %d0 /* return zero */
rts
END(_setjmp)
ENTRY(_longjmp)
movl %sp@(4),%a0 /* save area pointer */
movl 4(%sp),%a0 /* save area pointer */
addql #8,%a0 /* skip onstack/sigmask */
tstl %a0@ /* ensure non-zero SP */
tstl (%a0) /* ensure non-zero SP */
jeq botch /* oops! */
movl %sp@(8),%d0 /* grab return value */
movl 8(%sp),%d0 /* grab return value */
jne ok /* non-zero ok */
moveq #1,%d0 /* else make non-zero */
ok:
movl %a0@+,%sp /* restore SP */
movl %a0@+,%a6 /* restore FP */
movl (%a0)+,%sp /* restore SP */
movl (%a0)+,%a6 /* restore FP */
addql #4,%a0 /* skip AP */
movl %a0@+,%sp@ /* restore PC */
moveml %a0@(4),#0x3CFC /* restore non-scratch regs */
movl (%a0)+,(%sp) /* restore PC */
moveml 4(%a0),#0x3CFC /* restore non-scratch regs */
rts
botch:
jbsr PIC_PLT(_C_LABEL(longjmperror))
stop #0
END(_longjmp)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: alloca.S,v 1.6 2003/08/07 16:42:10 agc Exp $ */
/* $NetBSD: alloca.S,v 1.9 2013/07/17 04:57:55 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,21 +39,23 @@
#if 0
RCSID("from: @(#)alloca.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: alloca.S,v 1.6 2003/08/07 16:42:10 agc Exp $")
RCSID("$NetBSD: alloca.S,v 1.9 2013/07/17 04:57:55 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* like alloc, but automatic free in return */
ENTRY(alloca)
movl %sp@,%a1 /* save return addr */
movl (%sp),%a1 /* save return addr */
movl %sp,%d0 /* get current SP value */
subl %sp@(4),%d0 /* allocate requested space */
andb #~3,%d0 /* longword align for efficiency */
subl 4(%sp),%d0 /* allocate requested space */
movql #-4,%d1 /* sign extend a mask */
andl %d1,%d0 /* longword align for efficiency */
addql #8,%d0 /* reuse space of call frame */
movl %d0,%sp /* set new SP value */
lea %sp@(-4),%sp /* account for argument pop in caller */
subql #4,%sp /* account for argument pop in caller */
#ifdef __SVR4_ABI__
moveal %d0,%a0
#endif
jmp %a1@ /* funny return */
jmp (%a1) /* funny return */
END(alloca)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: ashlsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/* $NetBSD: ashlsi3.S,v 1.7 2013/07/16 22:12:20 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,13 +39,14 @@
#if 0
RCSID("from: @(#)ashlsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: ashlsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
RCSID("$NetBSD: ashlsi3.S,v 1.7 2013/07/16 22:12:20 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* int << int */
ENTRY(__ashlsi3)
movel %sp@(8),%d1
movel %sp@(4),%d0
movel 8(%sp),%d1
movel 4(%sp),%d0
asll %d1,%d0
rts
END(__ashlsi3)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: ashrsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/* $NetBSD: ashrsi3.S,v 1.7 2013/07/16 22:12:20 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,13 +39,14 @@
#if 0
RCSID("from: @(#)ashrsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: ashrsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
RCSID("$NetBSD: ashrsi3.S,v 1.7 2013/07/16 22:12:20 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* int >> int */
ENTRY(__ashrsi3)
movel %sp@(8),%d1
movel %sp@(4),%d0
movel 8(%sp),%d1
movel 4(%sp),%d0
asrl %d1,%d0
rts
END(__ashrsi3)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: fabs.S,v 1.8 2008/04/28 20:22:56 martin Exp $ */
/* $NetBSD: fabs.S,v 1.11 2013/07/17 06:43:32 matt Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -31,15 +31,16 @@
#include <machine/asm.h>
RCSID("$NetBSD: fabs.S,v 1.8 2008/04/28 20:22:56 martin Exp $")
RCSID("$NetBSD: fabs.S,v 1.11 2013/07/17 06:43:32 matt Exp $")
ENTRY(fabs)
#if defined(__SVR4_ABI__) && defined(__HAVE_68881__)
bclr #31,%sp@(4)
fmoved %sp@(4),%fp0
#if defined(__SVR4_ABI__) && defined(__HAVE_FPU__)
bclr #31,4(%sp)
fmoved 4(%sp),%fp0
#else
movl %sp@(4),%d0
movl %sp@(8),%d1
movl 4(%sp),%d0
movl 8(%sp),%d1
bclr #31,%d0
#endif
rts
END(fabs)

View File

@@ -1,25 +0,0 @@
/* $NetBSD: flt_rounds.S,v 1.9 2000/12/04 12:02:08 is Exp $ */
/*
* Written by J.T. Conklin, Apr 6, 1995
* Public domain.
*/
#include <machine/asm.h>
.text
.even
#if 0
/* XXX This is, effectively, an exclusive-or with 1 operation. */
_map:
.byte 1 /* round to nearest */
.byte 0 /* round to zero */
.byte 3 /* round to negative infinity */
.byte 2 /* round to positive infinity */
#endif
ENTRY(__flt_rounds)
fmovel %fpcr,%d0
bfextu %d0{#26:#2},%d0
eorib #1,%d0
rts

View File

@@ -1,4 +1,4 @@
/* $NetBSD: flt_rounds_softfloat.S,v 1.2 2004/09/26 21:13:27 jmmv Exp $ */
/* $NetBSD: flt_rounds_softfloat.S,v 1.5 2013/07/18 21:36:08 matt Exp $ */
/*
* Written by J.T. Conklin, Apr 6, 1995
@@ -12,21 +12,19 @@
#include <machine/asm.h>
.text
.even
#if 0
/* NB: this is tied to the gcc-2.95 lb1sf68.asm: */
_map:
.byte 1 /* round to nearest */
.byte 0 /* round to zero */
.byte 2 /* round to positive infinity */
.byte 3 /* round to negative infinity */
#endif
ENTRY(__flt_rounds)
/* lea _C_LABEL(_fpCCR),%a0 | check the rounding mode */
/* movew %a0@(6),%d0 | rounding mode in d0 */
/* movew 6(%a0),%d0 | rounding mode in d0 */
/* lea _map,%a0 */
moveb #0,%d0
rts
END(__flt_rounds)

View File

@@ -1,18 +0,0 @@
/* $NetBSD: fpgetmask.S,v 1.7 2002/01/13 21:45:44 thorpej Exp $ */
/*
* Written by Charles M. Hannum, Apr 9, 1995
* Public domain.
*/
#include <machine/asm.h>
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpgetmask, _fpgetmask)
ENTRY(_fpgetmask)
#else
ENTRY(fpgetmask)
#endif
fmovel %fpcr,%d0
bfextu %d0{#18:#5},%d0
rts

View File

@@ -1,18 +0,0 @@
/* $NetBSD: fpgetround.S,v 1.8 2002/01/13 21:45:44 thorpej Exp $ */
/*
* Written by J.T. Conklin, Apr 6, 1995
* Public domain.
*/
#include <machine/asm.h>
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpgetround, _fpgetround)
ENTRY(_fpgetround)
#else
ENTRY(fpgetround)
#endif
fmovel %fpcr,%d0
bfextu %d0{#26:#2},%d0
rts

View File

@@ -1,18 +0,0 @@
/* $NetBSD: fpgetsticky.S,v 1.7 2002/01/13 21:45:44 thorpej Exp $ */
/*
* Written by Charles M. Hannum, Apr 9, 1995
* Public domain.
*/
#include <machine/asm.h>
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpgetsticky, _fpgetsticky)
ENTRY(_fpgetsticky)
#else
ENTRY(fpgetsticky)
#endif
fmovel %fpsr,%d0
bfextu %d0{#24:#5},%d0
rts

View File

@@ -1,23 +0,0 @@
/* $NetBSD: fpsetmask.S,v 1.7 2002/01/13 21:45:44 thorpej Exp $ */
/*
* Written by Charles M. Hannum, Apr 9, 1995
* Public Domain.
*/
#include <machine/asm.h>
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpsetmask, _fpsetmask)
ENTRY(_fpsetmask)
#else
ENTRY(fpsetmask)
#endif
movel %d2,%sp@-
fmovel %fpcr,%d1
movel %sp@(8),%d2
bfextu %d1{#18:#5},%d0
bfins %d2,%d1{#18:#5}
movel %sp@+,%d2
fmovel %d1,%fpcr
rts

View File

@@ -1,23 +0,0 @@
/* $NetBSD: fpsetround.S,v 1.8 2002/01/13 21:45:44 thorpej Exp $ */
/*
* Written by J.T. Conklin, Apr 6, 1995
* Public Domain.
*/
#include <machine/asm.h>
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpsetround, _fpsetround)
ENTRY(_fpsetround)
#else
ENTRY(fpsetround)
#endif
movel %d2,%sp@-
fmovel %fpcr,%d1
movel %sp@(8),%d2
bfextu %d1{#26,#2},%d0
bfins %d2,%d1{#26:#2}
movel %sp@+,%d2
fmovel %d1,%fpcr
rts

View File

@@ -1,23 +0,0 @@
/* $NetBSD: fpsetsticky.S,v 1.7 2002/01/13 21:45:45 thorpej Exp $ */
/*
* Written by Charles M. Hannum, Apr 9, 1995
* Public domain.
*/
#include <machine/asm.h>
#ifdef WEAK_ALIAS
WEAK_ALIAS(fpsetsticky, _fpsetsticky)
ENTRY(_fpsetsticky)
#else
ENTRY(fpsetsticky)
#endif
movel %d2,%sp@-
fmovel %fpsr,%d1
movel %sp@(8),%d2
bfextu %d1{#24:#5},%d0
bfins %d2,%d1{#24:#5}
movel %sp@+,%d2
fmovel %d1,%fpsr
rts

View File

@@ -1,4 +1,4 @@
/* $NetBSD: lshlsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/* $NetBSD: lshlsi3.S,v 1.7 2013/07/16 22:12:20 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,13 +39,14 @@
#if 0
RCSID("from: @(#)lshlsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: lshlsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
RCSID("$NetBSD: lshlsi3.S,v 1.7 2013/07/16 22:12:20 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* unsigned << unsigned */
ENTRY(__lshlsi3)
movel %sp@(8),%d1
movel %sp@(4),%d0
movel 8(%sp),%d1
movel 4(%sp),%d0
lsll %d1,%d0
rts
END(__lshlsi3)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: lshrsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $ */
/* $NetBSD: lshrsi3.S,v 1.7 2013/07/16 22:12:20 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,13 +39,14 @@
#if 0
RCSID("from: @(#)lshrsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: lshrsi3.S,v 1.5 2003/08/07 16:42:10 agc Exp $")
RCSID("$NetBSD: lshrsi3.S,v 1.7 2013/07/16 22:12:20 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* unsigned >> unsigned */
ENTRY(__lshrsi3)
movel %sp@(8),%d1
movel %sp@(4),%d0
movel 8(%sp),%d1
movel 4(%sp),%d0
lsrl %d1,%d0
rts
END(__lshrsi3)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: negdf2.S,v 1.7 2003/08/07 16:42:11 agc Exp $ */
/* $NetBSD: negdf2.S,v 1.10 2013/07/17 06:43:32 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,17 +39,18 @@
#if 0
RCSID("from: @(#)negdf2.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: negdf2.S,v 1.7 2003/08/07 16:42:11 agc Exp $")
RCSID("$NetBSD: negdf2.S,v 1.10 2013/07/17 06:43:32 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* -double */
ENTRY(__negdf2)
#if defined(__SVR4_ABI__) && defined(__HAVE_68881__)
fnegd %sp@(4),%fp0
#if defined(__SVR4_ABI__) && defined(__HAVE_FPU__)
fnegd 4(%sp),%fp0
#else
movel %sp@(4),%d0
movel %sp@(8),%d1
movel 4(%sp),%d0
movel 8(%sp),%d1
bchg #31,%d0
#endif
rts
END(__negdf2)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: negsf2.S,v 1.7 2003/08/07 16:42:11 agc Exp $ */
/* $NetBSD: negsf2.S,v 1.10 2013/07/17 06:43:32 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,16 +39,17 @@
#if 0
RCSID"from: @(#)negsf2.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: negsf2.S,v 1.7 2003/08/07 16:42:11 agc Exp $")
RCSID("$NetBSD: negsf2.S,v 1.10 2013/07/17 06:43:32 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* -single */
ENTRY(__negsf2)
#if defined(__SVR4_ABI__) && defined(__HAVE_68881__)
fnegs %sp@(4),%fp0
#if defined(__SVR4_ABI__) && defined(__HAVE_FPU__)
fnegs 4(%sp),%fp0
#else
movel %sp@(4),%d0
movel 4(%sp),%d0
bchg #31,%d0
#endif
rts
END(__negsf2)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: resumecontext.S,v 1.5 2008/04/28 20:22:56 martin Exp $ */
/* $NetBSD: resumecontext.S,v 1.8 2013/07/17 03:04:54 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,9 +30,10 @@
*/
#include <machine/asm.h>
#include "assym.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: resumecontext.S,v 1.5 2008/04/28 20:22:56 martin Exp $")
RCSID("$NetBSD: resumecontext.S,v 1.8 2013/07/17 03:04:54 matt Exp $")
#endif /* LIBC_SCCS && !lint */
/*
@@ -42,18 +43,19 @@
*/
ENTRY(_resumecontext)
subl #(4 + 1024),%sp /* retaddr preservation + ucontext_t */
lea %sp@,%a0
movl %a0,%sp@-
subl #(4 + UC_SIZE),%sp /* retaddr preservation + ucontext_t */
lea (%sp),%a0
movl %a0,-(%sp)
jbsr PIC_PLT(_C_LABEL(_getcontext))
movl %sp@(4 + 4),%sp@ /* uc_link */
tstl %sp@ /* check for NULL */
movl (4 + UC_LINK)(%sp),(%sp) /* uc_link */
tstl (%sp) /* check for NULL */
jne 1f
jbsr PIC_PLT(_C_LABEL(exit)) /* cleanly exit(0) */
jmp 2f
1: jbsr PIC_PLT(_C_LABEL(setcontext))
/* NOTREACHED */
/* But just in case... */
2: movl #-1,%sp@
2: movl #-1,(%sp)
jbsr PIC_PLT(_C_LABEL(_exit))
/* NOTREACHED */
END(_resumecontext)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: setjmp.S,v 1.12 2006/03/09 16:20:27 christos Exp $ */
/* $NetBSD: setjmp.S,v 1.15 2013/07/17 03:05:41 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -34,12 +34,13 @@
*/
#include <machine/asm.h>
#include "assym.h"
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
RCSID("from: @(#)setjmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: setjmp.S,v 1.12 2006/03/09 16:20:27 christos Exp $")
RCSID("$NetBSD: setjmp.S,v 1.15 2013/07/17 03:05:41 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@@ -56,38 +57,38 @@
ENTRY(__setjmp14)
/* Get signal stack info. Note overlay of ss_sp and ss_size! */
lea %sp@(-12),%sp /* sizeof(stack_t) */
clrl %sp@ /* ss = NULL */
movl %sp,%sp@(4) /* oss = stack_t on stack */
lea -12(%sp),%sp /* sizeof(stack_t) */
clrl (%sp) /* ss = NULL */
movl %sp,4(%sp) /* oss = stack_t on stack */
jbsr PIC_PLT(_C_LABEL(__sigaltstack14))
movl %sp@(8),%d0 /* ss_flags */
movl 8(%sp),%d0 /* ss_flags */
andl #1,%d0 /* extract SS_ONSTACK */
lea %sp@(12),%sp /* pop stack_t */
lea 12(%sp),%sp /* pop stack_t */
/* Get pointer to jmp_buf; a sigcontext is at the beginning. */
movl %sp@(4),%a0
movl %d0,%a0@ /* store onstack */
clrl %a0@(4) /* unused word (old style signal mask) */
movl 4(%sp),%a0
movl %d0,SC_ONSTACK(%a0) /* store onstack */
clrl SC___MASK13(%a0) /* unused word (old style signal mask) */
/* Get the signal mask. */
pea %a0@(28) /* oset = &sc.sc_mask */
movl #0,%sp@- /* set = NULL */
movl #0,%sp@- /* action = 0 <ignored> */
pea SC_MASK(%a0) /* oset = &sc.sc_mask */
movl #0,-(%sp) /* set = NULL */
movl #0,-(%sp) /* action = 0 <ignored> */
jbsr PIC_PLT(_C_LABEL(__sigprocmask14))
addl #12,%sp
movl %sp@(4),%a0 /* get jmp_buf pointer again */
lea %sp@(4),%a1 /* adjust SP since we won't rts */
movl %a1,%a0@(8) /* save SP */
movl %a6,%a0@(12) /* save FP */
clrl %a0@(16) /* no AP */
movl %sp@,%a0@(20) /* save return PC */
clrl %a0@(24) /* clear PS */
movl 4(%sp),%a0 /* get jmp_buf pointer again */
lea 4(%sp),%a1 /* adjust SP since we won't rts */
movl %a1,SC_SP(%a0) /* save SP */
movl %a6,SC_FP(%a0) /* save FP */
clrl SC_AP(%a0) /* no AP */
movl (%sp),SC_PC(%a0)/* save return PC */
clrl SC_PS(%a0) /* clear PS */
/* Save remaining non-scratch regs after signal mask. */
moveml #0x3CFC,%a0@(44)
moveml #0x3CFC,SC_SIZE(%a0)
clrl %d0 /* return 0 */
rts
END(__setjmp14)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: sigsetjmp.S,v 1.8 2006/03/09 16:20:27 christos Exp $ */
/* $NetBSD: sigsetjmp.S,v 1.10 2013/07/16 22:12:20 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)_setjmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: sigsetjmp.S,v 1.8 2006/03/09 16:20:27 christos Exp $")
RCSID("$NetBSD: sigsetjmp.S,v 1.10 2013/07/16 22:12:20 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@@ -58,20 +58,22 @@
#include <m68k/setjmp.h>
ENTRY(__sigsetjmp14)
movl %sp@(8),%d1 /* grab the mask */
movl %sp@(4),%a0 /* grab the area pointer */
movl %d1,%a0@(_JBLEN * 4) /* save at end of area */
movl 8(%sp),%d1 /* grab the mask */
movl 4(%sp),%a0 /* grab the area pointer */
movl %d1,(_JBLEN * 4)(%a0) /* save at end of area */
tstl %d1
bne dosig
jra PIC_PLT(_C_LABEL(_setjmp))
dosig:
jra PIC_PLT(_C_LABEL(__setjmp14))
END(__sigsetjmp14)
ENTRY(__siglongjmp14)
movl %sp@(4),%a0 /* save area pointer */
tstl %a0@(_JBLEN * 4) /* check mask... */
movl 4(%sp),%a0 /* save area pointer */
tstl (_JBLEN * 4)(%a0) /* check mask... */
bne didsig
jra PIC_PLT(_C_LABEL(_longjmp))
didsig:
jra PIC_PLT(_C_LABEL(__longjmp14))
END(__siglongjmp14)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: swapcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $ */
/* $NetBSD: swapcontext.S,v 1.6 2013/07/17 03:05:17 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,20 +30,22 @@
*/
#include "SYS.h"
#include "assym.h"
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: swapcontext.S,v 1.3 2008/04/28 20:22:56 martin Exp $")
RCSID("$NetBSD: swapcontext.S,v 1.6 2013/07/17 03:05:17 matt Exp $")
#endif /* LIBC_SCCS && !lint */
ENTRY(swapcontext)
movl %sp@(4),%sp@- | push oucp on stack
movl 4(%sp),-(%sp) | push oucp on stack
jbsr PIC_PLT(_C_LABEL(_getcontext)) | getcontext(oucp)
tstl %d0 | OK?
jne L1
movl %sp@,%a0
addql #8,%a0@(96) | adjust saved stack pointer (again)
movl %sp@(4),%a0@(100) | adjust saved program counter (again)
movl %sp@(12),%sp@ | push ucp on stack
movl (%sp),%a0
addql #8,UC_MCONTEXT_SP(%a0) | adjust saved stack pointer (again)
movl %sp@(4),UC_MCONTEXT_PC(%a0) | adjust saved program counter (again)
movl 12(%sp),(%sp) | push ucp on stack
jbsr PIC_PLT(_C_LABEL(setcontext)) | setcontext(ucp)
L1: addql #4,%sp | pop ucp
rts
END(swapcontext)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: umulsi3.S,v 1.5 2003/08/07 16:42:12 agc Exp $ */
/* $NetBSD: umulsi3.S,v 1.7 2013/07/16 22:12:20 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,12 +39,13 @@
#if 0
RCSID("from: @(#)umulsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: umulsi3.S,v 1.5 2003/08/07 16:42:12 agc Exp $")
RCSID("$NetBSD: umulsi3.S,v 1.7 2013/07/16 22:12:20 matt Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* unsigned * unsigned */
ENTRY(__umulsi3)
movel %sp@(4),%d0
mulul %sp@(8),%d0
movel 4(%sp),%d0
mulul 8(%sp),%d0
rts
END(__umulsi3)

View File

@@ -0,0 +1,52 @@
# $NetBSD: genassym.cf,v 1.1 2013/07/17 01:41:17 matt Exp $
#
# Copyright (c) 2013 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Matt Thomas <matt@3am-sfotware.com>.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
include <sys/types.h>
include <machine/reg.h>
include <ucontext.h>
include <signal.h>
define UC_LINK offsetof(ucontext_t, uc_link)
define UC_SIGMASK offsetof(ucontext_t, uc_sigmask)
define UC_MCONTEXT_D0 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_D0])
define UC_MCONTEXT_SP offsetof(ucontext_t, uc_mcontext.__gregs[_REG_A7])
define UC_MCONTEXT_PC offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])
define UC_SIZE sizeof(ucontext_t)
define SC_ONSTACK offsetof(struct sigcontext, sc_onstack)
define SC___MASK13 offsetof(struct sigcontext, __sc_mask13)
define SC_SP offsetof(struct sigcontext, sc_sp)
define SC_FP offsetof(struct sigcontext, sc_fp)
define SC_AP offsetof(struct sigcontext, sc_ap)
define SC_PC offsetof(struct sigcontext, sc_pc)
define SC_PS offsetof(struct sigcontext, sc_ps)
define SC_MASK offsetof(struct sigcontext, sc_mask)
define SC_SIZE sizeof(struct sigcontext)

Some files were not shown because too many files have changed in this diff Show More