NetBSD/arm32 signal changes.
This commit is contained in:
parent
ce57c93ef5
commit
ca1e742680
|
@ -1,7 +1,10 @@
|
|||
# $NetBSD: Makefile.inc,v 1.4 1997/10/06 00:12:24 mark Exp $
|
||||
# $NetBSD: Makefile.inc,v 1.5 1998/09/29 20:23:25 thorpej Exp $
|
||||
|
||||
SRCS+= _setjmp.S alloca.S divsi3.S \
|
||||
SRCS+= alloca.S divsi3.S \
|
||||
fabs.c flt_rounds.c fpgetround.c fpsetround.c \
|
||||
fpgetmask.S fpsetmask.S fpgetsticky.S fpsetsticky.S \
|
||||
infinity.c isinf.c frexp.c ldexp.c modf.c \
|
||||
setjmp.S sigsetjmp.S
|
||||
infinity.c isinf.c frexp.c ldexp.c modf.c
|
||||
|
||||
SRCS+= setjmp.S __setjmp14.S
|
||||
SRCS+= _setjmp.S
|
||||
SRCS+= sigsetjmp.S __sigsetjmp14.S
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
/* $NetBSD: __setjmp14.S,v 1.1 1998/09/29 20:23:26 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Mark Brinicombe
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Mark Brinicombe
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
#include <machine/setjmp.h>
|
||||
|
||||
/*
|
||||
* C library -- setjmp, longjmp
|
||||
*
|
||||
* longjmp(a,v)
|
||||
* will generate a "return(v)" from the last call to
|
||||
* setjmp(a)
|
||||
* by restoring registers from the stack.
|
||||
* The previous signal state is restored.
|
||||
*/
|
||||
|
||||
ENTRY(__setjmp14)
|
||||
/* Get the signal mask. */
|
||||
stmfd r13!, {r0-r2, r14}
|
||||
add r2, r0, #(_JB_SIGMASK * 4)
|
||||
mov r1, #0x00000000
|
||||
mov r0, #0x00000000
|
||||
bl ___sigprocmask14
|
||||
ldmfd r13!, {r0-r2, r14}
|
||||
|
||||
ldr r1, Lsetjmp_magic
|
||||
str r1, [r0], #4
|
||||
|
||||
#ifdef SOFTFLOAT
|
||||
add r0, r0, #52
|
||||
#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
|
||||
mov r15, r14
|
||||
|
||||
Lsetjmp_magic:
|
||||
.word _JB_MAGIC_SETJMP
|
||||
|
||||
|
||||
ENTRY(__longjmp14)
|
||||
ldr r2, Lsetjmp_magic
|
||||
ldr r3, [r0]
|
||||
teq r2, r3
|
||||
bne botch
|
||||
|
||||
/* Restore the signal mask. */
|
||||
stmfd r13!, {r0-r2, r14}
|
||||
mov r2, #0x00000000
|
||||
add r1, r0, #(_JB_SIGMASK * 4)
|
||||
mov r0, #3 /* SIG_SETMASK */
|
||||
bl ___sigprocmask14
|
||||
ldmfd r13!, {r0-r2, r14}
|
||||
|
||||
add r0, r0, #4
|
||||
#ifdef SOFTFLOAT
|
||||
add r0, r0, #52
|
||||
#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}
|
||||
|
||||
/* Validate r13 and r14 */
|
||||
teq r13, #0
|
||||
beq botch
|
||||
teq r14, #0
|
||||
beq botch
|
||||
|
||||
/* Set return value */
|
||||
|
||||
mov r0, r1
|
||||
teq r0, #0x00000000
|
||||
moveq r0, #0x00000001
|
||||
mov r15, r14
|
||||
|
||||
/* validation failed, die die die. */
|
||||
botch:
|
||||
bl _longjmperror
|
||||
bl _abort
|
||||
b . - 8 /* Cannot get here */
|
|
@ -0,0 +1,61 @@
|
|||
/* $NetBSD: __sigsetjmp14.S,v 1.1 1998/09/29 20:23:26 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Mark Brinicombe
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Mark Brinicombe
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
#include <machine/setjmp.h>
|
||||
|
||||
/*
|
||||
* C library -- sigsetjmp, siglongjmp
|
||||
*
|
||||
* longjmp(a,v)
|
||||
* will generate a "return(v)" from the last call to
|
||||
* setjmp(a, m)
|
||||
* by restoring registers from the stack.
|
||||
* The previous signal state is restored.
|
||||
*/
|
||||
|
||||
ENTRY(__sigsetjmp14)
|
||||
teq r1, #0
|
||||
beq __setjmp
|
||||
b ___setjmp14
|
||||
|
||||
L_setjmp_magic:
|
||||
.word _JB_MAGIC__SETJMP
|
||||
|
||||
ENTRY(__siglongjmp14)
|
||||
ldr r2, L_setjmp_magic
|
||||
ldr r3, [r0]
|
||||
teq r2, r3
|
||||
beq __longjmp
|
||||
b ___longjmp14
|
|
@ -0,0 +1,45 @@
|
|||
/* $NetBSD: __sigreturn14.S,v 1.1 1998/09/29 20:23:26 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)sigreturn.s 5.2 (Berkeley) 12/17/90"
|
||||
*/
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
/*
|
||||
* We must preserve the state of the registers as the user has set them up.
|
||||
*/
|
||||
|
||||
SYSCALL(__sigreturn14)
|
||||
mov r15, r14
|
|
@ -0,0 +1,42 @@
|
|||
/* $NetBSD: sigaction.S,v 1.1 1998/09/29 20:23:26 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
|
||||
* NASA Ames Research Center.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation 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 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.h"
|
||||
|
||||
PSEUDO(sigaction,compat_13_sigaction13)
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sigpending.S,v 1.3 1997/10/06 00:07:18 mark Exp $ */
|
||||
/* $NetBSD: sigpending.S,v 1.4 1998/09/29 20:23:26 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
ENTRY(sigpending)
|
||||
mov r2, r0
|
||||
swi SYS_sigpending
|
||||
swi SYS_compat_13_sigpending13
|
||||
bcs cerror
|
||||
str r0, [r2]
|
||||
mov r0, #0x00000000
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sigprocmask.S,v 1.3 1997/10/06 00:07:19 mark Exp $ */
|
||||
/* $NetBSD: sigprocmask.S,v 1.4 1998/09/29 20:23:26 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -42,7 +42,7 @@ ENTRY(sigprocmask)
|
|||
moveq r0, #0x00000001
|
||||
moveq r1, #0x00000000
|
||||
ldrne r1, [r1]
|
||||
swi SYS_sigprocmask
|
||||
swi SYS_compat_13_sigprocmask13
|
||||
bcs cerror
|
||||
teq r2, #0x00000000
|
||||
strne r0, [r2]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sigreturn.S,v 1.4 1997/10/06 00:07:20 mark Exp $ */
|
||||
/* $NetBSD: sigreturn.S,v 1.5 1998/09/29 20:23:27 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -41,5 +41,4 @@
|
|||
* We must preserve the state of the registers as the user has set them up.
|
||||
*/
|
||||
|
||||
SYSCALL(sigreturn)
|
||||
mov r15, r14
|
||||
PSEUDO(sigreturn,compat_13_sigreturn13)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sigsuspend.S,v 1.3 1997/10/06 00:07:21 mark Exp $ */
|
||||
/* $NetBSD: sigsuspend.S,v 1.4 1998/09/29 20:23:27 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
ENTRY(sigsuspend)
|
||||
ldr r0, [r0]
|
||||
swi SYS_sigsuspend
|
||||
swi SYS_compat_13_sigsuspend13
|
||||
bcs cerror
|
||||
mov r0, #0x00000000
|
||||
mov r15, r14
|
||||
|
|
Loading…
Reference in New Issue