aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/lib/memcpy.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-10-08 23:58:24 -0400
committerMichal Simek <monstr@monstr.eu>2010-10-21 01:52:01 -0400
commit93e2e85139509338c68279c7260ebb68177b23a9 (patch)
tree64171deb6d2f046da3cf7c5111f73e419be1d460 /arch/microblaze/lib/memcpy.c
parentccea0e6e49e4db8ee7968c183ecddb3e399c5f54 (diff)
microblaze: Separate library optimized functions
memcpy/memmove/memset Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/lib/memcpy.c')
-rw-r--r--arch/microblaze/lib/memcpy.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/microblaze/lib/memcpy.c b/arch/microblaze/lib/memcpy.c
index 014bac92bdff..ab2d115f9ee5 100644
--- a/arch/microblaze/lib/memcpy.c
+++ b/arch/microblaze/lib/memcpy.c
@@ -33,17 +33,24 @@
33#include <asm/system.h> 33#include <asm/system.h>
34 34
35#ifdef __HAVE_ARCH_MEMCPY 35#ifdef __HAVE_ARCH_MEMCPY
36#ifndef CONFIG_OPT_LIB_FUNCTION
36void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c) 37void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
37{ 38{
38 const char *src = v_src; 39 const char *src = v_src;
39 char *dst = v_dst; 40 char *dst = v_dst;
40#ifndef CONFIG_OPT_LIB_FUNCTION 41
41 /* Simple, byte oriented memcpy. */ 42 /* Simple, byte oriented memcpy. */
42 while (c--) 43 while (c--)
43 *dst++ = *src++; 44 *dst++ = *src++;
44 45
45 return v_dst; 46 return v_dst;
46#else 47}
48#else /* CONFIG_OPT_LIB_FUNCTION */
49void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
50{
51 const char *src = v_src;
52 char *dst = v_dst;
53
47 /* The following code tries to optimize the copy by using unsigned 54 /* The following code tries to optimize the copy by using unsigned
48 * alignment. This will work fine if both source and destination are 55 * alignment. This will work fine if both source and destination are
49 * aligned on the same boundary. However, if they are aligned on 56 * aligned on the same boundary. However, if they are aligned on
@@ -150,7 +157,7 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
150 } 157 }
151 158
152 return v_dst; 159 return v_dst;
153#endif
154} 160}
161#endif /* CONFIG_OPT_LIB_FUNCTION */
155EXPORT_SYMBOL(memcpy); 162EXPORT_SYMBOL(memcpy);
156#endif /* __HAVE_ARCH_MEMCPY */ 163#endif /* __HAVE_ARCH_MEMCPY */