summaryrefslogtreecommitdiff
path: root/arch/xtensa/lib/strncpy_user.S
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-07 17:10:19 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-07 17:10:19 -0700
commitc8d8170feb824875baf68f8aaecb181a6500ce81 (patch)
treefc215c0776597015cd7e02ef12e24fe60e74961e /arch/xtensa/lib/strncpy_user.S
parent34750bb15687fa03ba95a0ccb1307b0727bc308b (diff)
parentdf5e38703d647b160d7ba300b3d2fcb64a48549a (diff)
Merge git://git.linux-xtensa.org/kernel/xtensa-feed
* git://git.linux-xtensa.org/kernel/xtensa-feed: Xtensa: use asm-generic/fcntl.h [XTENSA] Remove non-rt signal handling [XTENSA] Move common sections into bss sections [XTENSA] clean-up header files [XTENSA] Use generic 64-bit division [XTENSA] Remove multi-exported symbols from xtensa_ksyms.c [XTENSA] fix sources using deprecated assembler directive [XTENSA] Spelling fixes in arch/xtensa [XTENSA] fix bit operations in bitops.h
Diffstat (limited to 'arch/xtensa/lib/strncpy_user.S')
-rw-r--r--arch/xtensa/lib/strncpy_user.S33
1 files changed, 17 insertions, 16 deletions
diff --git a/arch/xtensa/lib/strncpy_user.S b/arch/xtensa/lib/strncpy_user.S
index a834057bda6b..b2655d94558d 100644
--- a/arch/xtensa/lib/strncpy_user.S
+++ b/arch/xtensa/lib/strncpy_user.S
@@ -25,18 +25,18 @@
/*
* char *__strncpy_user(char *dst, const char *src, size_t len)
*/
-.text
-.begin literal
-.align 4
-.Lmask0:
- .byte 0xff, 0x00, 0x00, 0x00
-.Lmask1:
- .byte 0x00, 0xff, 0x00, 0x00
-.Lmask2:
- .byte 0x00, 0x00, 0xff, 0x00
-.Lmask3:
- .byte 0x00, 0x00, 0x00, 0xff
-.end literal
+
+#ifdef __XTENSA_EB__
+# define MASK0 0xff000000
+# define MASK1 0x00ff0000
+# define MASK2 0x0000ff00
+# define MASK3 0x000000ff
+#else
+# define MASK0 0x000000ff
+# define MASK1 0x0000ff00
+# define MASK2 0x00ff0000
+# define MASK3 0xff000000
+#endif
# Register use
# a0/ return address
@@ -53,6 +53,7 @@
# a11/ dst
# a12/ tmp
+.text
.align 4
.global __strncpy_user
.type __strncpy_user,@function
@@ -61,10 +62,10 @@ __strncpy_user:
# a2/ dst, a3/ src, a4/ len
mov a11, a2 # leave dst in return value register
beqz a4, .Lret # if len is zero
- l32r a5, .Lmask0 # mask for byte 0
- l32r a6, .Lmask1 # mask for byte 1
- l32r a7, .Lmask2 # mask for byte 2
- l32r a8, .Lmask3 # mask for byte 3
+ movi a5, MASK0 # mask for byte 0
+ movi a6, MASK1 # mask for byte 1
+ movi a7, MASK2 # mask for byte 2
+ movi a8, MASK3 # mask for byte 3
bbsi.l a3, 0, .Lsrc1mod2 # if only 8-bit aligned
bbsi.l a3, 1, .Lsrc2mod4 # if only 16-bit aligned
.Lsrcaligned: # return here when src is word-aligned