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/gen Use STRONG_ALIAS
details: https://anonhg.NetBSD.org/src/rev/576fde4ee9c8
branches: trunk
changeset: 789444:576fde4ee9c8
user: matt <matt%NetBSD.org@localhost>
date: Mon Aug 19 03:44:18 2013 +0000
description:
Use STRONG_ALIAS
Add thumb variation
diffstat:
common/lib/libc/arch/arm/gen/byte_swap_2.S | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diffs (48 lines):
diff -r ebd7530edde2 -r 576fde4ee9c8 common/lib/libc/arch/arm/gen/byte_swap_2.S
--- a/common/lib/libc/arch/arm/gen/byte_swap_2.S Mon Aug 19 03:43:07 2013 +0000
+++ b/common/lib/libc/arch/arm/gen/byte_swap_2.S Mon Aug 19 03:44:18 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: byte_swap_2.S,v 1.5 2012/11/27 23:57:07 matt Exp $ */
+/* $NetBSD: byte_swap_2.S,v 1.6 2013/08/19 03:44:18 matt Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -32,20 +32,30 @@
#include <machine/asm.h>
#if defined(_KERNEL) || defined(_STANDALONE)
-_ENTRY(_C_LABEL(bswap16))
+#define FUNC _C_LABEL(bswap16)
#else
-_ENTRY(_C_LABEL(__bswap16))
+#define FUNC _C_LABEL(__bswap16)
#endif
-#if BYTE_ORDER == LITTLE_ENDIAN
-_ENTRY(_C_LABEL(ntohs))
-_ENTRY(_C_LABEL(htons))
-#endif
-_PROF_PROLOGUE
+
+ENTRY(FUNC)
#ifdef _ARM_ARCH_6
rev16 r0, r0
-#else
+#elif !defined(__thumb__)
and r1, r0, #0xff
mov r0, r0, lsr #8
orr r0, r0, r1, lsl #8
+#else
+ movs r2, #0xff
+ movs r1, r0
+ ands r1, r1, r2
+ lsls r1, r1, #8
+ lsrs r0, r0, #8
+ ands r0, r0, r2
+ orrs r0, r0, r1
#endif
RET
+END(FUNC)
+#if BYTE_ORDER == LITTLE_ENDIAN
+STRONG_ALIAS(_C_LABEL(ntohs), FUNC)
+STRONG_ALIAS(_C_LABEL(htons), FUNC)
+#endif
Home |
Main Index |
Thread Index |
Old Index