From da704da8fb8162394e94892f5241e53d03bf5fa4 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 1 May 1996 12:51:12 +0000 Subject: [PATCH] arm32 libc support --- lib/libc/arch/arm32/DEFS.h | 3 + lib/libc/arch/arm32/Makefile.inc | 4 + lib/libc/arch/arm32/SYS.h | 57 ++++ lib/libc/arch/arm32/gen/Makefile.inc | 4 + lib/libc/arch/arm32/gen/_setjmp.S | 86 ++++++ lib/libc/arch/arm32/gen/alloca.S | 49 ++++ lib/libc/arch/arm32/gen/div.S | 355 ++++++++++++++++++++++++ lib/libc/arch/arm32/gen/infinity.c | 9 + lib/libc/arch/arm32/gen/isinf.c | 64 +++++ lib/libc/arch/arm32/gen/s_fabs.c | 48 ++++ lib/libc/arch/arm32/gen/setjmp.S | 91 ++++++ lib/libc/arch/arm32/gen/sigsetjmp.S | 86 ++++++ lib/libc/arch/arm32/net/Makefile.inc | 3 + lib/libc/arch/arm32/string/Makefile.inc | 6 + lib/libc/arch/arm32/sys/Ovfork.S | 56 ++++ lib/libc/arch/arm32/sys/brk.S | 69 +++++ lib/libc/arch/arm32/sys/cerror.S | 55 ++++ lib/libc/arch/arm32/sys/exect.S | 50 ++++ lib/libc/arch/arm32/sys/fork.S | 47 ++++ lib/libc/arch/arm32/sys/pipe.S | 54 ++++ lib/libc/arch/arm32/sys/ptrace.S | 52 ++++ lib/libc/arch/arm32/sys/reboot.S | 45 +++ lib/libc/arch/arm32/sys/sbrk.S | 65 +++++ lib/libc/arch/arm32/sys/setlogin.S | 53 ++++ lib/libc/arch/arm32/sys/sigpending.S | 53 ++++ lib/libc/arch/arm32/sys/sigprocmask.S | 57 ++++ lib/libc/arch/arm32/sys/sigreturn.S | 60 ++++ lib/libc/arch/arm32/sys/sigsuspend.S | 52 ++++ lib/libc/arch/arm32/sys/syscall.S | 50 ++++ 29 files changed, 1683 insertions(+) create mode 100644 lib/libc/arch/arm32/DEFS.h create mode 100644 lib/libc/arch/arm32/Makefile.inc create mode 100644 lib/libc/arch/arm32/SYS.h create mode 100644 lib/libc/arch/arm32/gen/Makefile.inc create mode 100644 lib/libc/arch/arm32/gen/_setjmp.S create mode 100644 lib/libc/arch/arm32/gen/alloca.S create mode 100644 lib/libc/arch/arm32/gen/div.S create mode 100644 lib/libc/arch/arm32/gen/infinity.c create mode 100644 lib/libc/arch/arm32/gen/isinf.c create mode 100644 lib/libc/arch/arm32/gen/s_fabs.c create mode 100644 lib/libc/arch/arm32/gen/setjmp.S create mode 100644 lib/libc/arch/arm32/gen/sigsetjmp.S create mode 100644 lib/libc/arch/arm32/net/Makefile.inc create mode 100644 lib/libc/arch/arm32/string/Makefile.inc create mode 100644 lib/libc/arch/arm32/sys/Ovfork.S create mode 100644 lib/libc/arch/arm32/sys/brk.S create mode 100644 lib/libc/arch/arm32/sys/cerror.S create mode 100644 lib/libc/arch/arm32/sys/exect.S create mode 100644 lib/libc/arch/arm32/sys/fork.S create mode 100644 lib/libc/arch/arm32/sys/pipe.S create mode 100644 lib/libc/arch/arm32/sys/ptrace.S create mode 100644 lib/libc/arch/arm32/sys/reboot.S create mode 100644 lib/libc/arch/arm32/sys/sbrk.S create mode 100644 lib/libc/arch/arm32/sys/setlogin.S create mode 100644 lib/libc/arch/arm32/sys/sigpending.S create mode 100644 lib/libc/arch/arm32/sys/sigprocmask.S create mode 100644 lib/libc/arch/arm32/sys/sigreturn.S create mode 100644 lib/libc/arch/arm32/sys/sigsuspend.S create mode 100644 lib/libc/arch/arm32/sys/syscall.S diff --git a/lib/libc/arch/arm32/DEFS.h b/lib/libc/arch/arm32/DEFS.h new file mode 100644 index 00000000000..f5df7e70a75 --- /dev/null +++ b/lib/libc/arch/arm32/DEFS.h @@ -0,0 +1,3 @@ +/* $NetBSD: DEFS.h,v 1.1 1996/02/16 20:47:54 mark Exp $ */ + +#include diff --git a/lib/libc/arch/arm32/Makefile.inc b/lib/libc/arch/arm32/Makefile.inc new file mode 100644 index 00000000000..9023268c6c6 --- /dev/null +++ b/lib/libc/arch/arm32/Makefile.inc @@ -0,0 +1,4 @@ +# $NetBSD: Makefile.inc,v 1.2 1996/04/26 20:15:14 mark Exp $ + +KMINCLUDES= arch/arm32/SYS.h arch/arm32DEFS.h +KMSRCS= bcmp.c bzero.c ffs.c strcat.c strcmp.c strcpy.c strlen.c diff --git a/lib/libc/arch/arm32/SYS.h b/lib/libc/arch/arm32/SYS.h new file mode 100644 index 00000000000..79abecc9307 --- /dev/null +++ b/lib/libc/arch/arm32/SYS.h @@ -0,0 +1,57 @@ +/* $NetBSD: SYS.h,v 1.1 1996/02/16 20:48:02 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)SYS.h 5.5 (Berkeley) 5/7/91 + * $Id: SYS.h,v 1.1 1996/05/01 12:51:14 deraadt Exp $ + */ + +#include +#include + +#define SYSCALL(x) .text; .align 0; ENTRY(x) ; swi SYS_ ## x; bcs cerror; +#define RSYSCALL(x) SYSCALL(x) ; mov r15, r14 +#define PSEUDO(x, y) .text; .align 0; ENTRY(x); swi SYS_ ## y; mov r15, r14 + +#if 0 +#define SYSCALL(x) .text; .align 2; 2: jmp PIC_PLT(cerror); ENTRY(x); movl $(SYS_/**/x),%eax; int $0x80; jc 2b +#define RSYSCALL(x) SYSCALL(x); ret +#define PSEUDO(x,y) ENTRY(x); movl $(SYS_/**/y),%eax; int $0x80; ret +#define CALL(x,y) call PIC_PLT(_/**/y); addl $4*x,%esp + +#endif + + .globl cerror diff --git a/lib/libc/arch/arm32/gen/Makefile.inc b/lib/libc/arch/arm32/gen/Makefile.inc new file mode 100644 index 00000000000..985f6c20694 --- /dev/null +++ b/lib/libc/arch/arm32/gen/Makefile.inc @@ -0,0 +1,4 @@ +# $NetBSD: Makefile.inc,v 1.1 1996/02/16 20:48:10 mark Exp $ + +SRCS+= _setjmp.S alloca.S infinity.c isinf.c \ + setjmp.S s_fabs.c sigsetjmp.S diff --git a/lib/libc/arch/arm32/gen/_setjmp.S b/lib/libc/arch/arm32/gen/_setjmp.S new file mode 100644 index 00000000000..1ec40fb18c4 --- /dev/null +++ b/lib/libc/arch/arm32/gen/_setjmp.S @@ -0,0 +1,86 @@ +/* $NetBSD: _setjmp.S,v 1.1 1996/02/16 20:48:12 mark Exp $ */ + +/* + * Copyright (c) 1995 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. + * + * $Id: _setjmp.S,v 1.1 1996/05/01 12:51:16 deraadt Exp $ + */ + +# include "DEFS.h" + + .text + .align 0 + +ENTRY(_setjmp) +/* LDR a4,[pc,#|__fpflag_ptr|-.-8] + LDR a4,[a4,#0] + CMP a4,#0 + ADDEQ a1,a1,#48 + BEQ |__setjmp_l1| + STFE f4,[a1],#12 + STFE f5,[a1],#12 + STFE f6,[a1],#12 + STFE f7,[a1],#12 +|__setjmp_l1|*/ + add r0, r0, #48 + stmia r0, {r1-r12, r13, r14} + mov r0, #0x00000000 + mov r15, r14 + +ENTRY(_longjmp) + ldr r2, L_longjmpret + str r1, [r2] +/* LDR a4,[pc,#|__fpflag_ptr|-.-8] + LDR a4,[a4,#0] + CMP a4,#0 + ADDEQ a1,a1,#48 + BEQ |__longjmp_l1| + LDFE f4,[a1],#12 + LDFE f5,[a1],#12 + LDFE f6,[a1],#12 + LDFE f7,[a1],#12 +|__longjmp_l1|*/ + add r0, r0, #48 + ldmia r0, {r1-r12, r13, r14} + ldr r0, L_longjmpret + ldr r0, [r0] + teq r0, #0x00000000 + moveq r0, #0x00000001 + mov r15, r14 + +L_longjmpret: + .word _longjmpret + + .data + .align 0 + +_longjmpret: + .word 0x00000000 diff --git a/lib/libc/arch/arm32/gen/alloca.S b/lib/libc/arch/arm32/gen/alloca.S new file mode 100644 index 00000000000..daeb97b2fcb --- /dev/null +++ b/lib/libc/arch/arm32/gen/alloca.S @@ -0,0 +1,49 @@ +/* $NetBSD: alloca.S,v 1.1 1996/02/16 20:48:15 mark Exp $ */ + +/* + * Copyright (c) 1995 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. + * + * $Id: alloca.S,v 1.1 1996/05/01 12:51:17 deraadt Exp $ + */ + +/* like alloc, but automatic automatic free in return */ + +# include "DEFS.h" + + .text + .align 0 + +ENTRY(alloca) + add r0, r0, #0x00000003 /* round up to next word */ + bic r0, r0, #0x00000003 + sub r13, r13, r0 /* Adjust the stack pointer */ + mov r0, r13 /* r0 = base of new space */ + mov r15, r14 /* return */ diff --git a/lib/libc/arch/arm32/gen/div.S b/lib/libc/arch/arm32/gen/div.S new file mode 100644 index 00000000000..720646ee210 --- /dev/null +++ b/lib/libc/arch/arm32/gen/div.S @@ -0,0 +1,355 @@ +/* $NetBSD: div.S,v 1.1 1996/02/16 20:48:16 mark Exp $ */ + +/* + * 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 RiscBSD kernel team + * 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. + * + * $Id: div.S,v 1.1 1996/05/01 12:51:17 deraadt Exp $ + */ + +a1 .req r0 +a2 .req r1 +a3 .req r2 +a4 .req r3 +v1 .req r4 +v2 .req r5 +v3 .req r6 +v4 .req r7 +v5 .req r8 +v6 .req r9 +v7 .req r10 +fp .req r11 +ip .req r12 +sp .req r13 +lr .req r14 +pc .req r15 + +.text + + .global __rt_sdiv +__rt_sdiv: + B x_divide + + .global __rt_udiv +__rt_udiv: + B x_udivide + + .global ___umodsi3 +___umodsi3: + MOV a3, a1 + MOV a1, a2 + MOV a2, a3 + B x_uremainder + + .global ___udivsi3 +___udivsi3: + MOV a3, a1 + MOV a1, a2 + MOV a2, a3 + B x_udivide + + .global ___modsi3 +___modsi3: + MOV a3, a1 + MOV a1, a2 + MOV a2, a3 + B x_remainder + + .global ___divsi3 +___divsi3: + MOV a3, a1 + MOV a1, a2 + MOV a2, a3 + B x_divide + + .global x_divtest +x_divtest: + MOV pc,lr + + .global x_remainder +x_remainder: + STMFD sp!,{lr} + BL x_divide + MOV a1,a2 + LDMFD sp!,{pc} + + .global x_uremainder +x_uremainder: + STMFD sp!,{lr} + BL x_udivide + MOV a1,a2 + LDMFD sp!,{pc} + +x_overflow: + MVN a1,#0 + MOV pc,lr + + .global x_udivide /* a1 = a2 / a1; a2 = a2 % a1 */ +x_udivide: + CMP a1,#1 + BCC x_overflow + BEQ x_divide_l0 + MOV ip,#0 + MOVS a2,a2 + BPL x_divide_l1 + ORR ip,ip,#0x20000000 /* ip bit 0x20000000 = -ve a2 */ + MOVS a2,a2,lsr #1 + ORRCS ip,ip,#0x10000000 /* ip bit 0x10000000 = bit 0 of a2 */ + B x_divide_l1 + +x_divide_l0: /* a1 == 1 */ + MOV a1,a2 + MOV a2,#0 + MOV pc,lr + + .global x_divide /* a1 = a2 / a1; a2 = a2 % a1 */ +x_divide: + CMP a1,#1 + BCC x_overflow + BEQ x_divide_l0 + ANDS ip,a1,#0x80000000 + RSBMI a1,a1,#0 + ANDS a3,a2,#0x80000000 + EOR ip,ip,a3 + RSBMI a2,a2,#0 + ORR ip,a3,ip,lsr #1 /* ip bit 0x40000000 = -ve division */ + /* ip bit 0x80000000 = -ve remainder */ + +x_divide_l1: + MOV a3,#1 + MOV a4,#0 + + CMP a2,a1 + BCC x_divide_b0 + CMP a2,a1,lsl #1 + BCC x_divide_b1 + CMP a2,a1,lsl #2 + BCC x_divide_b2 + CMP a2,a1,lsl #3 + BCC x_divide_b3 + CMP a2,a1,lsl #4 + BCC x_divide_b4 + CMP a2,a1,lsl #5 + BCC x_divide_b5 + CMP a2,a1,lsl #6 + BCC x_divide_b6 + CMP a2,a1,lsl #7 + BCC x_divide_b7 + CMP a2,a1,lsl #8 + BCC x_divide_b8 + CMP a2,a1,lsl #9 + BCC x_divide_b9 + CMP a2,a1,lsl #10 + BCC x_divide_b10 + CMP a2,a1,lsl #11 + BCC x_divide_b11 + CMP a2,a1,lsl #12 + BCC x_divide_b12 + CMP a2,a1,lsl #13 + BCC x_divide_b13 + CMP a2,a1,lsl #14 + BCC x_divide_b14 + CMP a2,a1,lsl #15 + BCC x_divide_b15 + CMP a2,a1,lsl #16 + BCC x_divide_b16 + CMP a2,a1,lsl #17 + BCC x_divide_b17 + CMP a2,a1,lsl #18 + BCC x_divide_b18 + CMP a2,a1,lsl #19 + BCC x_divide_b19 + CMP a2,a1,lsl #20 + BCC x_divide_b20 + CMP a2,a1,lsl #21 + BCC x_divide_b21 + CMP a2,a1,lsl #22 + BCC x_divide_b22 + CMP a2,a1,lsl #23 + BCC x_divide_b23 + CMP a2,a1,lsl #24 + BCC x_divide_b24 + CMP a2,a1,lsl #25 + BCC x_divide_b25 + CMP a2,a1,lsl #26 + BCC x_divide_b26 + CMP a2,a1,lsl #27 + BCC x_divide_b27 + CMP a2,a1,lsl #28 + BCC x_divide_b28 + CMP a2,a1,lsl #29 + BCC x_divide_b29 + CMP a2,a1,lsl #30 + BCC x_divide_b30 + CMP a2,a1,lsl #31 + SUBHS a2,a2,a1,lsl #31 + ADDHS a4,a4,a3,lsl #31 + CMP a2,a1,lsl #30 + SUBHS a2,a2,a1,lsl #30 + ADDHS a4,a4,a3,lsl #30 +x_divide_b30: + CMP a2,a1,lsl #29 + SUBHS a2,a2,a1,lsl #29 + ADDHS a4,a4,a3,lsl #29 +x_divide_b29: + CMP a2,a1,lsl #28 + SUBHS a2,a2,a1,lsl #28 + ADDHS a4,a4,a3,lsl #28 +x_divide_b28: + CMP a2,a1,lsl #27 + SUBHSS a2,a2,a1,lsl #27 + ADDHS a4,a4,a3,lsl #27 +x_divide_b27: + CMP a2,a1,lsl #26 + SUBHS a2,a2,a1,lsl #26 + ADDHS a4,a4,a3,lsl #26 +x_divide_b26: + CMP a2,a1,lsl #25 + SUBHS a2,a2,a1,lsl #25 + ADDHS a4,a4,a3,lsl #25 +x_divide_b25: + CMP a2,a1,lsl #24 + SUBHS a2,a2,a1,lsl #24 + ADDHS a4,a4,a3,lsl #24 +x_divide_b24: + CMP a2,a1,lsl #23 + SUBHS a2,a2,a1,lsl #23 + ADDHS a4,a4,a3,lsl #23 +x_divide_b23: + CMP a2,a1,lsl #22 + SUBHS a2,a2,a1,lsl #22 + ADDHS a4,a4,a3,lsl #22 +x_divide_b22: + CMP a2,a1,lsl #21 + SUBHS a2,a2,a1,lsl #21 + ADDHS a4,a4,a3,lsl #21 +x_divide_b21: + CMP a2,a1,lsl #20 + SUBHS a2,a2,a1,lsl #20 + ADDHS a4,a4,a3,lsl #20 +x_divide_b20: + CMP a2,a1,lsl #19 + SUBHS a2,a2,a1,lsl #19 + ADDHS a4,a4,a3,lsl #19 +x_divide_b19: + CMP a2,a1,lsl #18 + SUBHS a2,a2,a1,lsl #18 + ADDHS a4,a4,a3,lsl #18 +x_divide_b18: + CMP a2,a1,lsl #17 + SUBHS a2,a2,a1,lsl #17 + ADDHS a4,a4,a3,lsl #17 +x_divide_b17: + CMP a2,a1,lsl #16 + SUBHS a2,a2,a1,lsl #16 + ADDHS a4,a4,a3,lsl #16 +x_divide_b16: + CMP a2,a1,lsl #15 + SUBHS a2,a2,a1,lsl #15 + ADDHS a4,a4,a3,lsl #15 +x_divide_b15: + CMP a2,a1,lsl #14 + SUBHS a2,a2,a1,lsl #14 + ADDHS a4,a4,a3,lsl #14 +x_divide_b14: + CMP a2,a1,lsl #13 + SUBHS a2,a2,a1,lsl #13 + ADDHS a4,a4,a3,lsl #13 +x_divide_b13: + CMP a2,a1,lsl #12 + SUBHS a2,a2,a1,lsl #12 + ADDHS a4,a4,a3,lsl #12 +x_divide_b12: + CMP a2,a1,lsl #11 + SUBHS a2,a2,a1,lsl #11 + ADDHS a4,a4,a3,lsl #11 +x_divide_b11: + CMP a2,a1,lsl #10 + SUBHS a2,a2,a1,lsl #10 + ADDHS a4,a4,a3,lsl #10 +x_divide_b10: + CMP a2,a1,lsl #9 + SUBHS a2,a2,a1,lsl #9 + ADDHS a4,a4,a3,lsl #9 +x_divide_b9: + CMP a2,a1,lsl #8 + SUBHS a2,a2,a1,lsl #8 + ADDHS a4,a4,a3,lsl #8 +x_divide_b8: + CMP a2,a1,lsl #7 + SUBHS a2,a2,a1,lsl #7 + ADDHS a4,a4,a3,lsl #7 +x_divide_b7: + CMP a2,a1,lsl #6 + SUBHS a2,a2,a1,lsl #6 + ADDHS a4,a4,a3,lsl #6 +x_divide_b6: + CMP a2,a1,lsl #5 + SUBHS a2,a2,a1,lsl #5 + ADDHS a4,a4,a3,lsl #5 +x_divide_b5: + CMP a2,a1,lsl #4 + SUBHS a2,a2,a1,lsl #4 + ADDHS a4,a4,a3,lsl #4 +x_divide_b4: + CMP a2,a1,lsl #3 + SUBHS a2,a2,a1,lsl #3 + ADDHS a4,a4,a3,lsl #3 +x_divide_b3: + CMP a2,a1,lsl #2 + SUBHS a2,a2,a1,lsl #2 + ADDHS a4,a4,a3,lsl #2 +x_divide_b2: + CMP a2,a1,lsl #1 + SUBHS a2,a2,a1,lsl #1 + ADDHS a4,a4,a3,lsl #1 +x_divide_b1: + CMP a2,a1 + SUBHS a2,a2,a1 + ADDHS a4,a4,a3 +x_divide_b0: + + TST ip,#0x20000000 + BNE x_udivide_l1 + MOV a1,a4 + CMP ip,#0 + RSBMI a2,a2,#0 + MOVS ip,ip,lsl #1 + RSBMI a1,a1,#0 + MOV pc,lr + +x_udivide_l1: + TST ip,#0x10000000 + MOV a2,a2,lsl #1 + ORRNE a2,a2,#1 + MOV a4,a4,lsl #1 + CMP a2,a1 + SUBHS a2,a2,a1 + ADDHS a4,a4,a3 + MOV a1,a4 + MOV pc,lr + diff --git a/lib/libc/arch/arm32/gen/infinity.c b/lib/libc/arch/arm32/gen/infinity.c new file mode 100644 index 00000000000..4603d50b7fb --- /dev/null +++ b/lib/libc/arch/arm32/gen/infinity.c @@ -0,0 +1,9 @@ +/* $NetBSD: infinity.c,v 1.1 1996/02/16 20:48:18 mark Exp $ */ + +/* + * $Id: infinity.c,v 1.1 1996/05/01 12:51:18 deraadt Exp $ + */ + +#include + +char __infinity[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }; diff --git a/lib/libc/arch/arm32/gen/isinf.c b/lib/libc/arch/arm32/gen/isinf.c new file mode 100644 index 00000000000..e55495f670c --- /dev/null +++ b/lib/libc/arch/arm32/gen/isinf.c @@ -0,0 +1,64 @@ +/* $NetBSD: isinf.c,v 1.1 1996/02/16 20:48:20 mark Exp $ */ + +/*- + * Copyright (c) 1991 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. + * + * $Id: isinf.c,v 1.1 1996/05/01 12:51:19 deraadt Exp $ + */ + +#include + +isnan(d) + double d; +{ + register struct IEEEdp { + u_int manh : 20; + u_int exp : 11; + u_int sign : 1; + u_int manl; + } *p = (struct IEEEdp *)&d; + + return(p->exp == 2047 && (p->manh || p->manl)); +} + +isinf(d) + double d; +{ + register struct IEEEdp { + u_int manh : 20; + u_int exp : 11; + u_int sign : 1; + u_int manl; + } *p = (struct IEEEdp *)&d; + + return(p->exp == 2047 && !p->manh && !p->manl); +} diff --git a/lib/libc/arch/arm32/gen/s_fabs.c b/lib/libc/arch/arm32/gen/s_fabs.c new file mode 100644 index 00000000000..0daa38ed614 --- /dev/null +++ b/lib/libc/arch/arm32/gen/s_fabs.c @@ -0,0 +1,48 @@ +/* $NetBSD: s_fabs.c,v 1.1 1996/02/16 20:48:21 mark Exp $ */ + +/* + * 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. + * + * $Id: s_fabs.c,v 1.1 1996/05/01 12:51:19 deraadt Exp $ + */ + +/* + * fabs(x) returns the absolute value of x. + */ + +#ifdef __STDC__ + double fabs(double x) +#else + double fabs(x) + double x; +#endif +{ + if (x < 0) + x = -x; + return(x); +} diff --git a/lib/libc/arch/arm32/gen/setjmp.S b/lib/libc/arch/arm32/gen/setjmp.S new file mode 100644 index 00000000000..2fa42dc4d72 --- /dev/null +++ b/lib/libc/arch/arm32/gen/setjmp.S @@ -0,0 +1,91 @@ +/* $NetBSD: setjmp.S,v 1.1 1996/02/16 20:48:23 mark Exp $ */ + +/* + * Copyright (c) 1995 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. + * + * $Id: setjmp.S,v 1.1 1996/05/01 12:51:20 deraadt Exp $ + */ + +# include "DEFS.h" + + .text + .align 0 + +ENTRY(setjmp) + stmfd r13!, {r0, r14} + mov r0, #0x00000000 + + bl _sigblock + mov r1, r0 + + ldmfd r13!, {r0, r14} + + str r1, [r0], #0x0004 + +/* LDR a4,[pc,#|__fpflag_ptr|-.-8] + LDR a4,[a4,#0] + CMP a4,#0 + ADDEQ a1,a1,#48 + BEQ |__setjmp_l1| + STFE f4,[a1],#12 + STFE f5,[a1],#12 + STFE f6,[a1],#12 + STFE f7,[a1],#12 +|__setjmp_l1|*/ + add r0, r0, #48 + stmia r0, {r4-r9, r11, r13, r14} + mov r0, #0x00000000 + mov r15, r14 + +ENTRY(longjmp) + ldr r2, [r0], #0x0004 + stmfd r13!, {r0, r1, r14} + + mov r0, r2 + bl _sigsetmask + + ldmfd r13!, {r0, r1, r14} +/* LDR a4,[pc,#|__fpflag_ptr|-.-8] + LDR a4,[a4,#0] + CMP a4,#0 + ADDEQ a1,a1,#48 + BEQ |__longjmp_l1| + LDFE f4,[a1],#12 + LDFE f5,[a1],#12 + LDFE f6,[a1],#12 + LDFE f7,[a1],#12 +|__longjmp_l1|*/ + add r2, r0, #48 + ldmia r2, {r4-r9, r11, r13, r14} + mov r0, r1 + teq r0, #0x00000000 + moveq r0, #0x00000001 + mov r15, r14 diff --git a/lib/libc/arch/arm32/gen/sigsetjmp.S b/lib/libc/arch/arm32/gen/sigsetjmp.S new file mode 100644 index 00000000000..838f69a6495 --- /dev/null +++ b/lib/libc/arch/arm32/gen/sigsetjmp.S @@ -0,0 +1,86 @@ +/* $NetBSD: sigsetjmp.S,v 1.1 1996/02/16 20:48:25 mark Exp $ */ + +/* + * Copyright (c) 1995 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. + * + * $Id: sigsetjmp.S,v 1.1 1996/05/01 12:51:21 deraadt Exp $ + */ + +# include "DEFS.h" + + .text + .align 0 + +ENTRY(sigsetjmp) +/* LDR a4,[pc,#|__fpflag_ptr|-.-8] + LDR a4,[a4,#0] + CMP a4,#0 + ADDEQ a1,a1,#48 + BEQ |__sigsetjmp_l1| + STFE f4,[a1],#12 + STFE f5,[a1],#12 + STFE f6,[a1],#12 + STFE f7,[a1],#12 +|__sigsetjmp_l1|*/ + add r0, r0, #48 + stmia r0, {r1-r12, r13, r14} + mov r0, #0x00000000 + mov r15, r14 + +ENTRY(siglongjmp) + ldr r2, L_siglongjmpret + str r1, [r2] +/* LDR a4,[pc,#|__fpflag_ptr|-.-8] + LDR a4,[a4,#0] + CMP a4,#0 + ADDEQ a1,a1,#48 + BEQ |__siglongjmp_l1| + LDFE f4,[a1],#12 + LDFE f5,[a1],#12 + LDFE f6,[a1],#12 + LDFE f7,[a1],#12 +|__siglongjmp_l1|*/ + add r0, r0, #48 + ldmia r0, {r1-r12, r13, r14} + ldr r0, L_siglongjmpret + ldr r0, [r0] + teq r0, #0x00000000 + moveq r0, #0x00000001 + mov r15, r14 + +L_siglongjmpret: + .word _siglongjmpret + + .data + .align 0 + +_siglongjmpret: + .word 0x00000000 diff --git a/lib/libc/arch/arm32/net/Makefile.inc b/lib/libc/arch/arm32/net/Makefile.inc new file mode 100644 index 00000000000..f3172ec2e26 --- /dev/null +++ b/lib/libc/arch/arm32/net/Makefile.inc @@ -0,0 +1,3 @@ +# $NetBSD: Makefile.inc,v 1.1 1996/02/16 20:48:31 mark Exp $ + +SRCS+= htonl.c htons.c ntohl.c ntohs.c diff --git a/lib/libc/arch/arm32/string/Makefile.inc b/lib/libc/arch/arm32/string/Makefile.inc new file mode 100644 index 00000000000..d7233072c6c --- /dev/null +++ b/lib/libc/arch/arm32/string/Makefile.inc @@ -0,0 +1,6 @@ +# $NetBSD: Makefile.inc,v 1.1 1996/02/16 20:48:37 mark Exp $ + +SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memchr.c memcmp.c memset.c \ + rindex.c strcat.c strcmp.c strcpy.c strcspn.c strlen.c \ + strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \ + strspn.c strstr.c swab.c diff --git a/lib/libc/arch/arm32/sys/Ovfork.S b/lib/libc/arch/arm32/sys/Ovfork.S new file mode 100644 index 00000000000..603e3081017 --- /dev/null +++ b/lib/libc/arch/arm32/sys/Ovfork.S @@ -0,0 +1,56 @@ +/* $NetBSD: Ovfork.S,v 1.1 1996/02/16 20:48:40 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)Ovfork.s 5.1 (Berkeley) 4/23/90 + * $Id: Ovfork.S,v 1.1 1996/05/01 12:51:25 deraadt Exp $ + */ + +#include "SYS.h" + +/* + * pid = vfork(); + */ + .text + .align 0 + +ENTRY(vfork) + mov r2, r14 + swi SYS_vfork + bcs cerror + sub r1, r1, #0x00000001 + and r0, r0, r1 + mov r15, r2 diff --git a/lib/libc/arch/arm32/sys/brk.S b/lib/libc/arch/arm32/sys/brk.S new file mode 100644 index 00000000000..7f06268fa33 --- /dev/null +++ b/lib/libc/arch/arm32/sys/brk.S @@ -0,0 +1,69 @@ +/* $NetBSD: brk.S,v 1.1 1996/02/16 20:48:42 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)brk.s 5.2 (Berkeley) 12/17/90 + * $Id: brk.S,v 1.1 1996/05/01 12:51:26 deraadt Exp $ + */ + +#include "SYS.h" + + .globl _end + .globl minbrk + .globl curbrk + + .data +minbrk: .long _end + .text + .align 0 + +ENTRY(brk) + ldr r1, Lminbrk + cmp r0, r1 + movlt r0, r1 + mov r2, r0 + swi SYS_break + bcs cerror + mov r0, #0x00000000 + ldr r1, Lcurbrk + str r2, [r1] + mov r15, r14 + +Lminbrk: + .word minbrk + +Lcurbrk: + .word curbrk diff --git a/lib/libc/arch/arm32/sys/cerror.S b/lib/libc/arch/arm32/sys/cerror.S new file mode 100644 index 00000000000..3ea8da0e37d --- /dev/null +++ b/lib/libc/arch/arm32/sys/cerror.S @@ -0,0 +1,55 @@ +/* $NetBSD: cerror.S,v 1.1 1996/02/16 20:48:43 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)cerror.s 5.1 (Berkeley) 4/23/90 + * $Id: cerror.S,v 1.1 1996/05/01 12:51:27 deraadt Exp $ + */ + +#include "SYS.h" + + .text + .align 0 + + .globl _errno +cerror: + ldr r1, Lerrno + str r0, [r1] + mvn r0, #0x00000000 + mov r15, r14 + +Lerrno: + .word _errno diff --git a/lib/libc/arch/arm32/sys/exect.S b/lib/libc/arch/arm32/sys/exect.S new file mode 100644 index 00000000000..524a322ee39 --- /dev/null +++ b/lib/libc/arch/arm32/sys/exect.S @@ -0,0 +1,50 @@ +/* $NetBSD: exect.S,v 1.1 1996/02/16 20:48:46 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)exect.s 5.1 (Berkeley) 4/23/90 + * $Id: exect.S,v 1.1 1996/05/01 12:51:28 deraadt Exp $ + */ + +#include "SYS.h" + + .text + .align 0 + +ENTRY(exect) + swi SYS_execve + bcs cerror + mov r15, r14 diff --git a/lib/libc/arch/arm32/sys/fork.S b/lib/libc/arch/arm32/sys/fork.S new file mode 100644 index 00000000000..d96ab0b01e1 --- /dev/null +++ b/lib/libc/arch/arm32/sys/fork.S @@ -0,0 +1,47 @@ +/* $NetBSD: fork.S,v 1.1 1996/02/16 20:48:48 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)fork.s 5.1 (Berkeley) 4/23/90 + * $Id: fork.S,v 1.1 1996/05/01 12:51:28 deraadt Exp $ + */ + +#include "SYS.h" + +SYSCALL(fork) + sub r1, r1, #0x00000001 + and r0, r0, r1 + mov r15, r14 diff --git a/lib/libc/arch/arm32/sys/pipe.S b/lib/libc/arch/arm32/sys/pipe.S new file mode 100644 index 00000000000..37ac9c633a5 --- /dev/null +++ b/lib/libc/arch/arm32/sys/pipe.S @@ -0,0 +1,54 @@ +/* $NetBSD: pipe.S,v 1.1 1996/02/16 20:48:51 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)pipe.s 5.1 (Berkeley) 4/23/90 + * $Id: pipe.S,v 1.1 1996/05/01 12:51:29 deraadt Exp $ + */ + +#include "SYS.h" + + .text + .align 0 + +ENTRY(pipe) + mov r2, r0 + swi SYS_pipe + bcs cerror + str r0, [r2, #0x0000] + str r1, [r2, #0x0004] + mov r0, #0x00000000 + mov r15, r14 diff --git a/lib/libc/arch/arm32/sys/ptrace.S b/lib/libc/arch/arm32/sys/ptrace.S new file mode 100644 index 00000000000..ce18ec87ab9 --- /dev/null +++ b/lib/libc/arch/arm32/sys/ptrace.S @@ -0,0 +1,52 @@ +/* $NetBSD: ptrace.S,v 1.1 1996/02/16 20:48:52 mark Exp $ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)ptrace.s 5.1 (Berkeley) 4/23/90 + * $Id: ptrace.S,v 1.1 1996/05/01 12:51:30 deraadt Exp $ + */ + +#include "SYS.h" + + .text + .align 0 + +ENTRY(ptrace) + swi SYS_ptrace + bcs cerror + mov r0, #0 + mov r15, r14 + diff --git a/lib/libc/arch/arm32/sys/reboot.S b/lib/libc/arch/arm32/sys/reboot.S new file mode 100644 index 00000000000..ee92ac919f8 --- /dev/null +++ b/lib/libc/arch/arm32/sys/reboot.S @@ -0,0 +1,45 @@ +/* $NetBSD: reboot.S,v 1.1 1996/02/16 20:48:54 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)reboot.s 5.1 (Berkeley) 4/23/90 + * $Id: reboot.S,v 1.1 1996/05/01 12:51:31 deraadt Exp $ + */ + +#include "SYS.h" + +SYSCALL(reboot) + mov r15, r14 diff --git a/lib/libc/arch/arm32/sys/sbrk.S b/lib/libc/arch/arm32/sys/sbrk.S new file mode 100644 index 00000000000..e55a251620b --- /dev/null +++ b/lib/libc/arch/arm32/sys/sbrk.S @@ -0,0 +1,65 @@ +/* $NetBSD: sbrk.S,v 1.1 1996/02/16 20:48:57 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)sbrk.s 5.1 (Berkeley) 4/23/90 + * $Id: sbrk.S,v 1.1 1996/05/01 12:51:31 deraadt Exp $ + */ + +#include "SYS.h" + + .globl _end + .globl curbrk + + .data +curbrk: .long _end + .text + .align 0 + +ENTRY(sbrk) + ldr r2, Lcurbrk + ldr r1, [r2] + mov r3, r0 + add r0, r0, r1 + swi SYS_break + bcs cerror + ldr r0, [r2] + add r1, r0, r3 + str r1, [r2] + mov r15, r14 + +Lcurbrk: + .word curbrk diff --git a/lib/libc/arch/arm32/sys/setlogin.S b/lib/libc/arch/arm32/sys/setlogin.S new file mode 100644 index 00000000000..739bbbe0e3a --- /dev/null +++ b/lib/libc/arch/arm32/sys/setlogin.S @@ -0,0 +1,53 @@ +/* $NetBSD: setlogin.S,v 1.1 1996/02/16 20:49:00 mark Exp $ */ + +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)setlogin.s 5.2 (Berkeley) 4/12/91 + * $Id: setlogin.S,v 1.1 1996/05/01 12:51:32 deraadt Exp $ + */ + +#include "SYS.h" + + .globl ___logname_valid /* in getlogin() */ + +SYSCALL(setlogin) + mov r0, #0x00000000 + ldr r1, Llogname + str r0, [r1] + mov r15, r14 + +Llogname: + .word ___logname_valid diff --git a/lib/libc/arch/arm32/sys/sigpending.S b/lib/libc/arch/arm32/sys/sigpending.S new file mode 100644 index 00000000000..70f7740920f --- /dev/null +++ b/lib/libc/arch/arm32/sys/sigpending.S @@ -0,0 +1,53 @@ +/* $NetBSD: sigpending.S,v 1.1 1996/02/16 20:49:02 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)sigpending.s 5.1 (Berkeley) 7/1/90 + * $Id: sigpending.S,v 1.1 1996/05/01 12:51:33 deraadt Exp $ + */ + +#include "SYS.h" + + .text + .align 0 + +ENTRY(sigpending) + mov r2, r0 + swi SYS_sigpending + bcs cerror + str r0, [r2] + mov r0, #0x00000000 + mov r15, r14 diff --git a/lib/libc/arch/arm32/sys/sigprocmask.S b/lib/libc/arch/arm32/sys/sigprocmask.S new file mode 100644 index 00000000000..7fc4535e35d --- /dev/null +++ b/lib/libc/arch/arm32/sys/sigprocmask.S @@ -0,0 +1,57 @@ +/* $NetBSD: sigprocmask.S,v 1.1 1996/02/16 20:49:04 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)sigprocmask.s 5.2 (Berkeley) 12/17/90 + * $Id: sigprocmask.S,v 1.1 1996/05/01 12:51:33 deraadt Exp $ + */ + +#include "SYS.h" + + .text + .align 0 + +ENTRY(sigprocmask) + teq r1, #0x00000000 + moveq r0, #0x00000001 + moveq r1, #0x00000000 + ldrne r1, [r1] + swi SYS_sigprocmask + bcs cerror + teq r2, #0x00000000 + strne r0, [r2] + mov r0, #0x00000000 + mov r15, r14 diff --git a/lib/libc/arch/arm32/sys/sigreturn.S b/lib/libc/arch/arm32/sys/sigreturn.S new file mode 100644 index 00000000000..f19ec3ad3e2 --- /dev/null +++ b/lib/libc/arch/arm32/sys/sigreturn.S @@ -0,0 +1,60 @@ +/* $NetBSD: sigreturn.S,v 1.1 1996/02/16 20:49:10 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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" + * $Id: sigreturn.S,v 1.1 1996/05/01 12:51:34 deraadt Exp $ + */ + +#include "SYS.h" + +/* + * We must preserve the state of the registers as the user has set them up. + */ + +/* I must code this bit ... - mark */ + +#if 0 +#ifdef PROF +#undef ENTRY +#define ENTRY(x) \ + .globl _/**/x; .align 2; _/**/x: pusha ; \ + .data; 1:; .long 0; .text; movl $1b,%eax; call mcount; popa ; nop +#endif /* PROF */ +#endif + +SYSCALL(sigreturn) + mov r15, r14 diff --git a/lib/libc/arch/arm32/sys/sigsuspend.S b/lib/libc/arch/arm32/sys/sigsuspend.S new file mode 100644 index 00000000000..917a0d851d7 --- /dev/null +++ b/lib/libc/arch/arm32/sys/sigsuspend.S @@ -0,0 +1,52 @@ +/* $NetBSD: sigsuspend.S,v 1.1 1996/02/16 20:49:13 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)sigsuspend.s 5.2 (Berkeley) 12/17/90 + * $Id: sigsuspend.S,v 1.1 1996/05/01 12:51:35 deraadt Exp $ + */ + +#include "SYS.h" + + .text + .align 0 + +ENTRY(sigsuspend) + ldr r0, [r0] + swi SYS_sigsuspend + bcs cerror + mov r0, #0x00000000 + mov r15, r14 diff --git a/lib/libc/arch/arm32/sys/syscall.S b/lib/libc/arch/arm32/sys/syscall.S new file mode 100644 index 00000000000..4a2fcbb5339 --- /dev/null +++ b/lib/libc/arch/arm32/sys/syscall.S @@ -0,0 +1,50 @@ +/* $NetBSD: syscall.S,v 1.1 1996/02/16 20:49:16 mark Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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: @(#)syscall.s 5.1 (Berkeley) 4/23/90 + * $Id: syscall.S,v 1.1 1996/05/01 12:51:35 deraadt Exp $ + */ + +#include "SYS.h" + + .text + .align 0 + +ENTRY(syscall) + swi 0x00000000 + bcs cerror + mov r15, r14 -- 2.20.1