diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 19:53:11 -0400 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 19:53:11 -0400 | 
| commit | e0e170bd7ded2ec16e2813d63c0faff43193fde8 (patch) | |
| tree | 2f06008b61ef2eedf8f77d1326e286a64e426ef6 /arch/microblaze/lib/memset.c | |
| parent | b20f9e5bddddb5ef0d743d6e0d409ffc8cf9fc56 (diff) | |
| parent | b843e4ec01991a386a9e0e9030703524446e03da (diff) | |
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* 'next' of git://git.monstr.eu/linux-2.6-microblaze: (42 commits)
  microblaze: Fix build with make 3.82
  fbdev/xilinxfb: Microblaze driver support
  microblaze: Support C optimized lib functions for little-endian
  microblaze: Separate library optimized functions
  microblaze: Support timer on AXI lite
  microblaze: Add support for little-endian Microblaze
  microblaze: KGDB little endian support
  microblaze: Add PVR for endians plus detection
  net: emaclite: Add support for little-endian platforms
  microblaze: trivial: Add comment for AXI pvr
  microblaze: pci-common cleanup
  microblaze: Support early console on uart16550
  microblaze: Do not compile early console support for uartlite if is disabled
  microblaze: Setup early console dynamically
  microblaze: Rename all uartlite early printk functions
  microblaze: remove early printk uarlite console dependency from header
  microblaze: Remove additional compatible properties
  microblaze: Remove hardcoded asm instraction for PVR loading
  microblaze: Use static const char * const where possible
  microblaze: Define VMALLOC_START/END
  ...
Diffstat (limited to 'arch/microblaze/lib/memset.c')
| -rw-r--r-- | arch/microblaze/lib/memset.c | 22 | 
1 files changed, 18 insertions, 4 deletions
| diff --git a/arch/microblaze/lib/memset.c b/arch/microblaze/lib/memset.c index ecfb663e1fc1..834565d1607e 100644 --- a/arch/microblaze/lib/memset.c +++ b/arch/microblaze/lib/memset.c | |||
| @@ -31,17 +31,30 @@ | |||
| 31 | #include <linux/string.h> | 31 | #include <linux/string.h> | 
| 32 | 32 | ||
| 33 | #ifdef __HAVE_ARCH_MEMSET | 33 | #ifdef __HAVE_ARCH_MEMSET | 
| 34 | #ifndef CONFIG_OPT_LIB_FUNCTION | ||
| 35 | void *memset(void *v_src, int c, __kernel_size_t n) | ||
| 36 | { | ||
| 37 | char *src = v_src; | ||
| 38 | |||
| 39 | /* Truncate c to 8 bits */ | ||
| 40 | c = (c & 0xFF); | ||
| 41 | |||
| 42 | /* Simple, byte oriented memset or the rest of count. */ | ||
| 43 | while (n--) | ||
| 44 | *src++ = c; | ||
| 45 | |||
| 46 | return v_src; | ||
| 47 | } | ||
| 48 | #else /* CONFIG_OPT_LIB_FUNCTION */ | ||
| 34 | void *memset(void *v_src, int c, __kernel_size_t n) | 49 | void *memset(void *v_src, int c, __kernel_size_t n) | 
| 35 | { | 50 | { | 
| 36 | char *src = v_src; | 51 | char *src = v_src; | 
| 37 | #ifdef CONFIG_OPT_LIB_FUNCTION | ||
| 38 | uint32_t *i_src; | 52 | uint32_t *i_src; | 
| 39 | uint32_t w32 = 0; | 53 | uint32_t w32 = 0; | 
| 40 | #endif | 54 | |
| 41 | /* Truncate c to 8 bits */ | 55 | /* Truncate c to 8 bits */ | 
| 42 | c = (c & 0xFF); | 56 | c = (c & 0xFF); | 
| 43 | 57 | ||
| 44 | #ifdef CONFIG_OPT_LIB_FUNCTION | ||
| 45 | if (unlikely(c)) { | 58 | if (unlikely(c)) { | 
| 46 | /* Make a repeating word out of it */ | 59 | /* Make a repeating word out of it */ | 
| 47 | w32 = c; | 60 | w32 = c; | 
| @@ -72,12 +85,13 @@ void *memset(void *v_src, int c, __kernel_size_t n) | |||
| 72 | 85 | ||
| 73 | src = (void *)i_src; | 86 | src = (void *)i_src; | 
| 74 | } | 87 | } | 
| 75 | #endif | 88 | |
| 76 | /* Simple, byte oriented memset or the rest of count. */ | 89 | /* Simple, byte oriented memset or the rest of count. */ | 
| 77 | while (n--) | 90 | while (n--) | 
| 78 | *src++ = c; | 91 | *src++ = c; | 
| 79 | 92 | ||
| 80 | return v_src; | 93 | return v_src; | 
| 81 | } | 94 | } | 
| 95 | #endif /* CONFIG_OPT_LIB_FUNCTION */ | ||
| 82 | EXPORT_SYMBOL(memset); | 96 | EXPORT_SYMBOL(memset); | 
| 83 | #endif /* __HAVE_ARCH_MEMSET */ | 97 | #endif /* __HAVE_ARCH_MEMSET */ | 
