From dc4d7b377c1e07918eeca704477851ddef37d472 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Tue, 14 Jan 2014 01:30:56 +0400 Subject: MIPS: ZBOOT: gather string functions into string.c In the worst case this adds less then 128 bytes of code but on the other hand this makes code organization more clear. Signed-off-by: Antony Pavlov Reviewed-by: Florian Fainelli Cc: linux-mips@linux-mips.org Cc: Ralf Baechle Cc: John Crispin Cc: Florian Fainelli Acked-by: Florian Fainelli Signed-off-by: John Crispin Patchwork: http://patchwork.linux-mips.org/patch/6344/ --- arch/mips/boot/compressed/string.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 arch/mips/boot/compressed/string.c (limited to 'arch/mips/boot/compressed/string.c') diff --git a/arch/mips/boot/compressed/string.c b/arch/mips/boot/compressed/string.c new file mode 100644 index 000000000000..9de9885acd0d --- /dev/null +++ b/arch/mips/boot/compressed/string.c @@ -0,0 +1,28 @@ +/* + * arch/mips/boot/compressed/string.c + * + * Very small subset of simple string routines + */ + +#include + +void *memcpy(void *dest, const void *src, size_t n) +{ + int i; + const char *s = src; + char *d = dest; + + for (i = 0; i < n; i++) + d[i] = s[i]; + return dest; +} + +void *memset(void *s, int c, size_t n) +{ + int i; + char *ss = s; + + for (i = 0; i < n; i++) + ss[i] = c; + return s; +} -- cgit v1.2.3