summaryrefslogtreecommitdiffstats
path: root/lib/libc/arm/sys
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2004-05-14 12:04:31 +0000
committercognet <cognet@FreeBSD.org>2004-05-14 12:04:31 +0000
commitbb6bbd6342ef3a05d837b89817ec6f058d1497b3 (patch)
tree6da949d33b96ce7f3985a2cbc32baeccf187c4d6 /lib/libc/arm/sys
parent90f48ef1d2da8652d325e845334302aef9b6f5b9 (diff)
downloadFreeBSD-src-bb6bbd6342ef3a05d837b89817ec6f058d1497b3.zip
FreeBSD-src-bb6bbd6342ef3a05d837b89817ec6f058d1497b3.tar.gz
Import the FreeBSD/arm libc bits.
Obtained from: NetBSD
Diffstat (limited to 'lib/libc/arm/sys')
-rw-r--r--lib/libc/arm/sys/Makefile.inc9
-rw-r--r--lib/libc/arm/sys/Ovfork.S57
-rw-r--r--lib/libc/arm/sys/brk.S100
-rw-r--r--lib/libc/arm/sys/cerror.S76
-rw-r--r--lib/libc/arm/sys/fork.S49
-rw-r--r--lib/libc/arm/sys/getcontext.S63
-rw-r--r--lib/libc/arm/sys/pipe.S49
-rw-r--r--lib/libc/arm/sys/ptrace.S77
-rw-r--r--lib/libc/arm/sys/sbrk.S88
-rw-r--r--lib/libc/arm/sys/shmat.S7
-rw-r--r--lib/libc/arm/sys/sigreturn.S42
-rw-r--r--lib/libc/arm/sys/syscall.S38
12 files changed, 655 insertions, 0 deletions
diff --git a/lib/libc/arm/sys/Makefile.inc b/lib/libc/arm/sys/Makefile.inc
new file mode 100644
index 0000000..e7b9669
--- /dev/null
+++ b/lib/libc/arm/sys/Makefile.inc
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+MDASM= Ovfork.S brk.S cerror.S getcontext.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S
+
+# Don't generate default code for these syscalls:
+NOASM= break.o exit.o ftruncate.o getdomainname.o getlogin.o \
+ lseek.o mmap.o openbsd_poll.o pread.o \
+ pwrite.o setdomainname.o sstk.o truncate.o uname.o vfork.o yield.o
+PSEUDO= _exit.o _getlogin.o
diff --git a/lib/libc/arm/sys/Ovfork.S b/lib/libc/arm/sys/Ovfork.S
new file mode 100644
index 0000000..0082bbc
--- /dev/null
+++ b/lib/libc/arm/sys/Ovfork.S
@@ -0,0 +1,57 @@
+/* $NetBSD: Ovfork.S,v 1.6 2003/08/07 16:42:03 agc 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. 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
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+WARN_REFERENCES(vfork, \
+ "warning: reference to compatibility vfork(); include <unistd.h> for correct reference")
+
+/*
+ * pid = vfork();
+ *
+ * On return from the SWI:
+ * 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(vfork)
+ mov r2, r14
+ SYSTRAP(vfork)
+ bcs PIC_SYM(CERROR, PLT)
+ sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
+ and r0, r0, r1 /* r0 == 0 if child, else unchanged */
+ mov r15, r2
diff --git a/lib/libc/arm/sys/brk.S b/lib/libc/arm/sys/brk.S
new file mode 100644
index 0000000..8112e91
--- /dev/null
+++ b/lib/libc/arm/sys/brk.S
@@ -0,0 +1,100 @@
+/* $NetBSD: brk.S,v 1.6 2003/08/07 16:42:04 agc 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. 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
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+ .globl _C_LABEL(end)
+ .globl CURBRK
+
+#ifdef WEAK_ALIAS
+WEAK_ALIAS(brk, _brk)
+#endif
+
+ .data
+ .align 0
+ .globl _C_LABEL(minbrk)
+ .type _C_LABEL(minbrk),#object
+_C_LABEL(minbrk):
+ .word _C_LABEL(end)
+
+/*
+ * 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
+#endif
+ /* Get the minimum allowable brk address */
+ ldr r1, [r1]
+
+ /*
+ * Valid the address specified and set to the minimum
+ * if the address is below minbrk.
+ */
+ cmp r0, r1
+ movlt r0, r1
+ mov r2, r0
+ SYSTRAP(break)
+ bcs PIC_SYM(CERROR, PLT)
+
+#ifdef PIC
+ ldr r1, .Lcurbrk
+ ldr r1, [r3, r1]
+#else
+ ldr r1, .Lcurbrk
+#endif
+ /* Store the new address in curbrk */
+ str r2, [r1]
+
+ /* Return 0 for success */
+ mov r0, #0x00000000
+ mov r15, r14
+
+ .align 2
+#ifdef PIC
+.Lgot:
+ .word _GLOBAL_OFFSET_TABLE_ - (.L1+4)
+#endif
+.Lminbrk:
+ .word PIC_SYM(_C_LABEL(minbrk), GOT)
+.Lcurbrk:
+ .word PIC_SYM(CURBRK, GOT)
diff --git a/lib/libc/arm/sys/cerror.S b/lib/libc/arm/sys/cerror.S
new file mode 100644
index 0000000..b0f04a6
--- /dev/null
+++ b/lib/libc/arm/sys/cerror.S
@@ -0,0 +1,76 @@
+/* $NetBSD: cerror.S,v 1.5 2003/08/07 16:42:04 agc 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. 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
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+.globl _C_LABEL(__error)
+.type _C_LABEL(__error),%function
+
+ASENTRY(CERROR)
+#if 1
+ stmfd sp!, {r4, lr}
+ mov r4, r0
+ bl PIC_SYM(_C_LABEL(__error), PLT)
+ str r4, [r0]
+ mvn r0, #0x00000000
+ mvn r1, #0x00000000
+ ldmfd sp!, {r4, pc}
+#else
+#ifdef PIC
+ /* Setup the GOT */
+ ldr r3, .Lgot
+ add r3, pc, r3
+.L1:
+ ldr r1, .Lerrno
+ ldr r1, [r3, r1]
+#else
+ ldr r1, .Lerrno
+#endif /* PIC */
+ str r0, [r1]
+ mvn r0, #0x00000000
+ mvn r1, #0x00000000
+ mov pc, lr
+
+#if 0
+ .align 0
+.Lgot:
+ .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (.L1+4))
+#endif /* PIC */
+
+ .globl _C_LABEL(errno)
+
+.Lerrno:
+ .word PIC_SYM(_C_LABEL(errno), GOT)
+#endif /* _REENTRANT */
diff --git a/lib/libc/arm/sys/fork.S b/lib/libc/arm/sys/fork.S
new file mode 100644
index 0000000..fb07c87
--- /dev/null
+++ b/lib/libc/arm/sys/fork.S
@@ -0,0 +1,49 @@
+/* $NetBSD: fork.S,v 1.5 2003/08/07 16:42:04 agc 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. 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
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+/*
+ * pid = fork();
+ *
+ * On return from the SWI:
+ * r1 == 0 in parent process, r1 == 1 in child process.
+ * r0 == pid of child in parent, r0 == pid of parent in child.
+ */
+
+_SYSCALL(fork)
+ sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
+ and r0, r0, r1 /* r0 == 0 if child, else unchanged */
+ mov r15, r14
diff --git a/lib/libc/arm/sys/getcontext.S b/lib/libc/arm/sys/getcontext.S
new file mode 100644
index 0000000..e905259
--- /dev/null
+++ b/lib/libc/arm/sys/getcontext.S
@@ -0,0 +1,63 @@
+/* $NetBSD: getcontext.S,v 1.3 2003/04/05 23:08:52 bjh21 Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * 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 <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ RCSID("$NetBSD: getcontext.S,v 1.3 2003/04/05 23:08:52 bjh21 Exp $")
+#endif /* SYSLIBC_SCCS && !lint */
+
+#ifdef WEAK_ALIAS
+WEAK_ALIAS(getcontext, _getcontext)
+#endif
+
+ENTRY(_getcontext)
+ mov r2, r0 /* Must save argument pointer. */
+ swi SYS_getcontext
+ bcs PIC_SYM(CERROR, PLT)
+ str lr, [r2, #(36 + 15*4)] /* Adjust PC. */
+#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. */
+ mov pc, lr
diff --git a/lib/libc/arm/sys/pipe.S b/lib/libc/arm/sys/pipe.S
new file mode 100644
index 0000000..59ddd88
--- /dev/null
+++ b/lib/libc/arm/sys/pipe.S
@@ -0,0 +1,49 @@
+/* $NetBSD: pipe.S,v 1.5 2003/08/07 16:42:04 agc 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. 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
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+#ifdef WEAK_ALIAS
+WEAK_ALIAS(pipe, _pipe)
+#endif
+
+ENTRY(_pipe)
+ mov r2, r0
+ SYSTRAP(pipe)
+ bcs PIC_SYM(CERROR, PLT)
+ str r0, [r2, #0x0000]
+ str r1, [r2, #0x0004]
+ mov r0, #0x00000000
+ mov r15, r14
diff --git a/lib/libc/arm/sys/ptrace.S b/lib/libc/arm/sys/ptrace.S
new file mode 100644
index 0000000..0aa1122
--- /dev/null
+++ b/lib/libc/arm/sys/ptrace.S
@@ -0,0 +1,77 @@
+/* $NetBSD: ptrace.S,v 1.7 2003/08/07 16:42:04 agc 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. 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
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+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}
+#else
+ stmfd sp!, {r0, r1}
+#ifdef PIC
+ /* Setup the GOT */
+ ldr r0, .Lgot
+ add r0, pc, r0
+.L1:
+ ldr r1, .Lerrno
+ ldr r1, [r0, r1]
+#else
+ ldr r1, .Lerrno
+#endif /* PIC */
+ mov r0, #0x00000000
+ str r0, [r1]
+ ldmfd sp!, {r0, r1}
+#endif /* _REENTRANT */
+
+ SYSTRAP(ptrace)
+ bcs PIC_SYM(CERROR, PLT)
+ mov pc, lr
+
+#ifndef _REENTRANT
+#ifdef PIC
+ .align 0
+.Lgot:
+ .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (.L1+4))
+#endif /* PIC */
+
+.Lerrno:
+ .word PIC_SYM(_C_LABEL(errno), GOT)
+#endif /* !_REENTRANT */
diff --git a/lib/libc/arm/sys/sbrk.S b/lib/libc/arm/sys/sbrk.S
new file mode 100644
index 0000000..cca380d
--- /dev/null
+++ b/lib/libc/arm/sys/sbrk.S
@@ -0,0 +1,88 @@
+/* $NetBSD: sbrk.S,v 1.7 2003/08/07 16:42:05 agc 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. 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
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+ .globl _C_LABEL(end)
+
+#ifdef WEAK_ALIAS
+WEAK_ALIAS(sbrk, _sbrk)
+#endif
+
+ .data
+ .align 0
+ .globl CURBRK
+ .type CURBRK,#object
+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
+ ldr r2, .Lcurbrk
+#endif
+ /* Get the current brk address */
+ ldr r1, [r2]
+
+ /* Calculate new value */
+ mov r3, r0
+ add r0, r0, r1
+ SYSTRAP(break)
+ bcs PIC_SYM(CERROR, PLT)
+
+ /* Store new curbrk value */
+ ldr r0, [r2]
+ add r1, r0, r3
+ str r1, [r2]
+
+ /* Return old curbrk value */
+ mov r15, r14
+
+ .align 0
+#ifdef PIC
+.Lgot:
+ .word _GLOBAL_OFFSET_TABLE_ - (.L1+4)
+#endif
+.Lcurbrk:
+ .word PIC_SYM(CURBRK, GOT)
diff --git a/lib/libc/arm/sys/shmat.S b/lib/libc/arm/sys/shmat.S
new file mode 100644
index 0000000..3fc3d02
--- /dev/null
+++ b/lib/libc/arm/sys/shmat.S
@@ -0,0 +1,7 @@
+/* $NetBSD: shmat.S,v 1.1 2000/12/29 20:14:04 bjh21 Exp $ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+RSYSCALL(shmat)
diff --git a/lib/libc/arm/sys/sigreturn.S b/lib/libc/arm/sys/sigreturn.S
new file mode 100644
index 0000000..1e0f245
--- /dev/null
+++ b/lib/libc/arm/sys/sigreturn.S
@@ -0,0 +1,42 @@
+/* $NetBSD: __sigreturn14.S,v 1.3 2003/08/07 16:42:03 agc 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. 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 <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+/*
+ * We must preserve the state of the registers as the user has set them up.
+ */
+
+RSYSCALL(sigreturn)
diff --git a/lib/libc/arm/sys/syscall.S b/lib/libc/arm/sys/syscall.S
new file mode 100644
index 0000000..73e6b83
--- /dev/null
+++ b/lib/libc/arm/sys/syscall.S
@@ -0,0 +1,38 @@
+/* $NetBSD: syscall.S,v 1.4 2003/08/07 16:42:05 agc 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. 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
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+RSYSCALL(syscall)
OpenPOWER on IntegriCloud