From: Alessandro Rubini <rub...@unipv.it> Signed-off-by: Alessandro Rubini <rub...@unipv.it> Acked-by: Andrea Gallo <andrea.ga...@stericsson.com> --- lib_generic/string.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/lib_generic/string.c b/lib_generic/string.c index fdccab6..68e0255 100644 --- a/lib_generic/string.c +++ b/lib_generic/string.c @@ -404,7 +404,21 @@ char *strswab(const char *s) void * memset(void * s,int c,size_t count) { char *xs = (char *) s; + u32 *s32 = (u32 *) s; + int c32 = 0; /* most common case */ + /* do it 32 bits at a time if possible */ + if ( ((count & 3) | ((int)s & 3)) == 0) { + count /= 4; + if (c) { /* not 0: build 32-bit value */ + c32 = c | (c<<8); + c32 |= c32 << 16; + } + while (count--) + *s32++ = c32; + return s; + } + /* else, fill 8 bits at a time */ while (count--) *xs++ = c; -- 1.5.6.5 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot