summaryrefslogtreecommitdiffstats
path: root/sys/libkern/arm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/libkern/arm')
-rw-r--r--sys/libkern/arm/aeabi_unwind.c58
-rw-r--r--sys/libkern/arm/divsi3.S13
-rw-r--r--sys/libkern/arm/ffs.S2
-rw-r--r--sys/libkern/arm/ldivmod.S2
-rw-r--r--sys/libkern/arm/memcpy.S3
-rw-r--r--sys/libkern/arm/memset.S49
6 files changed, 126 insertions, 1 deletions
diff --git a/sys/libkern/arm/aeabi_unwind.c b/sys/libkern/arm/aeabi_unwind.c
new file mode 100644
index 0000000..098e6e6
--- /dev/null
+++ b/sys/libkern/arm/aeabi_unwind.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2013 Andrew Turner
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/systm.h>
+
+#ifdef __ARM_EABI__
+/* We need to provide these functions never call them */
+void __aeabi_unwind_cpp_pr0(void);
+void __aeabi_unwind_cpp_pr1(void);
+void __aeabi_unwind_cpp_pr2(void);
+
+void
+__aeabi_unwind_cpp_pr0(void)
+{
+ panic("__aeabi_unwind_cpp_pr0");
+}
+
+void
+__aeabi_unwind_cpp_pr1(void)
+{
+ panic("__aeabi_unwind_cpp_pr1");
+}
+
+void
+__aeabi_unwind_cpp_pr2(void)
+{
+ panic("__aeabi_unwind_cpp_pr2");
+}
+#endif
+
diff --git a/sys/libkern/arm/divsi3.S b/sys/libkern/arm/divsi3.S
index 700ae37..302f179 100644
--- a/sys/libkern/arm/divsi3.S
+++ b/sys/libkern/arm/divsi3.S
@@ -29,6 +29,7 @@ ENTRY_NP(__umodsi3)
add sp, sp, #4 /* unalign stack */
mov r0, r1
ldmfd sp!, {pc}
+END(__umodsi3)
ENTRY_NP(__modsi3)
stmfd sp!, {lr}
@@ -48,6 +49,7 @@ ENTRY_NP(__modsi3)
mvn r0, #0
#endif
RET
+END(__modsi3)
#ifdef __ARM_EABI__
ENTRY_NP(__aeabi_uidiv)
@@ -74,6 +76,11 @@ ENTRY_NP(__udivsi3)
mov r0, r1
mov r1, #0
RET
+#ifdef __ARM_EABI__
+END(__aeabi_uidiv)
+END(__aeabi_uidivmod)
+#endif
+END(__udivsi3)
#ifdef __ARM_EABI__
ENTRY_NP(__aeabi_idiv)
@@ -393,3 +400,9 @@ ENTRY_NP(__divsi3)
addhs r3, r3, r2
mov r0, r3
RET
+#ifdef __ARM_EABI__
+END(__aeabi_idiv)
+END(__aeabi_idivmod)
+#endif
+END(__divsi3)
+
diff --git a/sys/libkern/arm/ffs.S b/sys/libkern/arm/ffs.S
index ba0af49..a43f2b6 100644
--- a/sys/libkern/arm/ffs.S
+++ b/sys/libkern/arm/ffs.S
@@ -82,3 +82,5 @@ ENTRY(ffs)
rsbne r0, r0, #32
RET
#endif
+END(ffs)
+
diff --git a/sys/libkern/arm/ldivmod.S b/sys/libkern/arm/ldivmod.S
index a88db54..26a3944 100644
--- a/sys/libkern/arm/ldivmod.S
+++ b/sys/libkern/arm/ldivmod.S
@@ -53,6 +53,7 @@ ENTRY_NP(__aeabi_ldivmod)
add sp, sp, #8 /* Move sp to the remainder value */
ldmfd sp!, {r2, r3} /* Load the remainder */
RET
+END(__aeabi_ldivmod)
ENTRY_NP(__aeabi_uldivmod)
sub sp, sp, #8 /* Space for the remainder */
@@ -62,6 +63,7 @@ ENTRY_NP(__aeabi_uldivmod)
add sp, sp, #8 /* Move sp to the remainder value */
ldmfd sp!, {r2, r3} /* Load the remainder */
RET
+END(__aeabi_uldivmod)
#endif
diff --git a/sys/libkern/arm/memcpy.S b/sys/libkern/arm/memcpy.S
index b2997db..9fca8f6 100644
--- a/sys/libkern/arm/memcpy.S
+++ b/sys/libkern/arm/memcpy.S
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Andrew Turner
+ * Copyright (C) 2013 Andrew Turner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
ENTRY_NP(__aeabi_memcpy)
b memcpy
+END(__aeabi_memcpy)
#endif
diff --git a/sys/libkern/arm/memset.S b/sys/libkern/arm/memset.S
new file mode 100644
index 0000000..57d2507
--- /dev/null
+++ b/sys/libkern/arm/memset.S
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2013 Andrew Turner
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#ifdef __ARM_EABI__
+
+/*
+ * This implements
+ * void __aeabi_memset(void *dest, size_t len, int c)
+ * by calling:
+ * void *memset(dest, c, len)
+ *
+ * The arguments are in r0-r2, r3 can be used as a scratch register.
+ */
+ENTRY_NP(__aeabi_memset)
+ mov r3, r2
+ mov r2, r1
+ mov r1, r3
+ b memset
+END(__aeabi_memset)
+
+#endif
+
OpenPOWER on IntegriCloud