Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/common/lib/libc/arch/arm Don't include .cfi info if _KERNEL ...
details: https://anonhg.NetBSD.org/src/rev/62d891dde2c4
branches: trunk
changeset: 789569:62d891dde2c4
user: matt <matt%NetBSD.org@localhost>
date: Thu Aug 22 19:25:00 2013 +0000
description:
Don't include .cfi info if _KERNEL || _STANDALONE
diffstat:
common/lib/libc/arch/arm/gen/divsi3.S | 6 +-
common/lib/libc/arch/arm/gen/udivsi3.S | 6 +-
common/lib/libc/arch/arm/string/strcat_arm.S | 6 +-
common/lib/libc/arch/arm/string/strlcat_arm.S | 8 +-
common/lib/libc/arch/arm/string/strlcat_naive.S | 52 +++++++++++++++---------
common/lib/libc/arch/arm/string/strlen_arm.S | 8 +-
6 files changed, 49 insertions(+), 37 deletions(-)
diffs (219 lines):
diff -r 961d209c4b5b -r 62d891dde2c4 common/lib/libc/arch/arm/gen/divsi3.S
--- a/common/lib/libc/arch/arm/gen/divsi3.S Thu Aug 22 17:08:43 2013 +0000
+++ b/common/lib/libc/arch/arm/gen/divsi3.S Thu Aug 22 19:25:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: divsi3.S,v 1.7 2013/08/19 03:54:15 matt Exp $ */
+/* $NetBSD: divsi3.S,v 1.8 2013/08/22 19:25:00 matt Exp $ */
/*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
@@ -29,12 +29,12 @@
#elif !defined(__thumb__) || defined(_ARM_ARCH_T2)
b __divide
#else
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.fnstart
.cfi_startproc
#endif
push {r4, lr}
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.cfi_def_cfa_offset 8
.cfi_offset 14, -4
.cfi_offset 4, -8
diff -r 961d209c4b5b -r 62d891dde2c4 common/lib/libc/arch/arm/gen/udivsi3.S
--- a/common/lib/libc/arch/arm/gen/udivsi3.S Thu Aug 22 17:08:43 2013 +0000
+++ b/common/lib/libc/arch/arm/gen/udivsi3.S Thu Aug 22 19:25:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udivsi3.S,v 1.3 2013/08/19 03:51:04 matt Exp $ */
+/* $NetBSD: udivsi3.S,v 1.4 2013/08/22 19:25:00 matt Exp $ */
/*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
@@ -29,12 +29,12 @@
#elif !defined(__thumb__) || defined(_ARM_ARCH_T2)
b __udivide
#else
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.fnstart
.cfi_startproc
#endif
push {r4, lr}
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.save {r4, lr}
.cfi_def_cfa_offset 8
.cfi_offset 14, -4
diff -r 961d209c4b5b -r 62d891dde2c4 common/lib/libc/arch/arm/string/strcat_arm.S
--- a/common/lib/libc/arch/arm/string/strcat_arm.S Thu Aug 22 17:08:43 2013 +0000
+++ b/common/lib/libc/arch/arm/string/strcat_arm.S Thu Aug 22 19:25:00 2013 +0000
@@ -33,12 +33,12 @@
* Implementation of strcat using strlen/strcpy.
*/
ENTRY(strcat)
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.fnstart
.cfi_startproc
#endif
push {r3-r5, lr} /* save registers */
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.save {r3-r5, lr}
.cfi_def_cfa_offset 16
.cfi_offset 14, -4
@@ -58,7 +58,7 @@
mov r0, r4 /* restore dst as return value */
pop {r3-r5, pc} /* restore registers */
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.cfi_endproc
.fnend
#endif
diff -r 961d209c4b5b -r 62d891dde2c4 common/lib/libc/arch/arm/string/strlcat_arm.S
--- a/common/lib/libc/arch/arm/string/strlcat_arm.S Thu Aug 22 17:08:43 2013 +0000
+++ b/common/lib/libc/arch/arm/string/strlcat_arm.S Thu Aug 22 19:25:00 2013 +0000
@@ -29,16 +29,16 @@
#include <machine/asm.h>
-RCSID("$NetBSD: strlcat_arm.S,v 1.3 2013/08/19 06:11:20 matt Exp $")
+RCSID("$NetBSD: strlcat_arm.S,v 1.4 2013/08/22 19:25:00 matt Exp $")
/* LINTSTUB: size_t strlcat(char *, const char *, size_t) */
ENTRY(strlcat)
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.fnstart
.cfi_startproc
#endif
push {r4-r6, lr}
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.save {r4-r6, lr}
.cfi_def_cfa_offset 16
.cfi_offset 14, -4
@@ -60,7 +60,7 @@
bl PLT_SYM(strlcpy) /* attempt to copy src */
adds r0, r0, r5 /* add remaining to strlcpy return */
pop {r4-r6, pc} /* restore registers and return */
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.cfi_endproc
.fnend
#endif
diff -r 961d209c4b5b -r 62d891dde2c4 common/lib/libc/arch/arm/string/strlcat_naive.S
--- a/common/lib/libc/arch/arm/string/strlcat_naive.S Thu Aug 22 17:08:43 2013 +0000
+++ b/common/lib/libc/arch/arm/string/strlcat_naive.S Thu Aug 22 19:25:00 2013 +0000
@@ -29,39 +29,51 @@
#include <machine/asm.h>
-RCSID("$NetBSD: strlcat_naive.S,v 1.2 2013/08/11 05:02:35 matt Exp $")
+RCSID("$NetBSD: strlcat_naive.S,v 1.3 2013/08/22 19:25:00 matt Exp $")
/* LINTSTUB: size_t strlcat(char *, const char *, size_t) */
ENTRY(strlcat)
- mov ip, r0 /* need to preserve r0 */
- add r3, r2, r0 /* point to just end of dst */
+ adds r3, r2, r0 /* point to just end of dst */
+ mov ip, r0 /* need to keep r0 for a while */
1: cmp ip, r3 /* still within dst? */
- beq 4f /* no, get length of src */
+ beq 3f /* no, get length of src */
ldrb r2, [ip], #1 /* load next byte */
- teq r2, #0 /* was it a NUL? */
+ cmp r2, #0 /* was it a NUL? */
bne 1b /* no, get next byte */
- sub r0, ip, r0 /* get actual length was dst */
- sub r0, r0, #1 /* account for the trailing NUL */
- sub r3, r3, #1 /* back up to last byte in dst */
+ sub r0, ip, r0 /* get actual length of dst */
+ subs r0, r0, #1 /* account for the trailing NUL */
+ subs r3, r3, #1 /* back up to last byte in dst */
sub ip, ip, #1 /* back up over the NUL */
2: ldrb r2, [r1], #1 /* load next byte from append */
- teq r2, #0 /* was it a NUL? */
- beq 3f /* yes, end of append */
- add r0, r0, #1 /* count another byte */
+#if defined(__thumb__) && defined(_ARM_ARCH_T2)
+ cbz r2, 5f /* was it a NUL? yes, end of append */
+#else
+ cmp r2, #0 /* was it a NUL? */
+ beq 5f /* yes, end of append */
+#endif
+ adds r0, r0, #1 /* count another byte */
cmp ip, r3 /* do we have enough room for it? */
+#ifdef __thumb__
+ bge 2b
+ strb r2, [ip], #1 /* yes, store it */
+#else
strblt r2, [ip], #1 /* yes, store it */
+#endif
b 2b /* get next byte from append */
-3: mov r2, #0 /* NUL */
- strb r2, [ip] /* append final NUL */
- RET /* return */
+3: subs r0, r3, r0 /* move size to return value */
+4: ldrb r2, [r1], #1 /* load next byte from append */
+#if defined(__thumb__) && defined(_ARM_ARCH_T2)
+ cbz r2, 6f /* was it a NUL? yes, we're done */
+#else
+ RETc(eq) /* yes, we're done */
+#endif
+ adds r0, r0, #1 /* add one to return value */
+ b 4b /* get next byte from append */
-4: sub r0, r3, r0 /* move size to return value */
-5: ldrb r2, [r1], #1 /* load next byte from append */
- teq r2, #0 /* was it a NUL? */
- RETc(eq) /* yes, we're done */
- add r0, r0, #1 /* add one to return value */
- b 5b /* get next byte from append */
+5: movs r2, #0 /* NUL */
+ strb r2, [ip] /* append final NUL */
+6: RET /* return */
END(strlcat)
diff -r 961d209c4b5b -r 62d891dde2c4 common/lib/libc/arch/arm/string/strlen_arm.S
--- a/common/lib/libc/arch/arm/string/strlen_arm.S Thu Aug 22 17:08:43 2013 +0000
+++ b/common/lib/libc/arch/arm/string/strlen_arm.S Thu Aug 22 19:25:00 2013 +0000
@@ -29,7 +29,7 @@
#include <machine/asm.h>
-RCSID("$NetBSD: strlen_arm.S,v 1.6 2013/08/20 16:34:47 matt Exp $")
+RCSID("$NetBSD: strlen_arm.S,v 1.7 2013/08/22 19:25:00 matt Exp $")
#if defined(__thumb__) && !defined(_ARM_ARCH_T2)
#error Only Thumb2 or ARM supported
@@ -55,13 +55,13 @@
.text
ENTRY(FUNCNAME)
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.fnstart
.cfi_startproc
#endif
#ifdef STRNLEN
push {r4,r5} /* save some registers */
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.save {r4,r5}
.cfi_def_cfa_offset 8
.cfi_offset 5, -4
@@ -173,7 +173,7 @@
pop {r4, r5} /* restore registers */
RET /* return */
#endif
-#ifdef __ARM_EABI__
+#if defined(__ARM_EABI__) && (!defined(_KERNEL) && !defined(_STANDALONE))
.cfi_endproc
.fnend
#endif
Home |
Main Index |
Thread Index |
Old Index