From 39fb8f0705c60f3aedfe10a44a25b02ac1f4906d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Jan 2005 21:31:13 +0000 Subject: [PATCH] Jean-Philippe Bernardy: C versions of memset() and memcpy() for archs with no asm optimized versions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5550 a1c6a512-1295-4272-9138-f99709370657 --- firmware/SOURCES | 3 +++ firmware/common/string.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 firmware/common/string.c diff --git a/firmware/SOURCES b/firmware/SOURCES index 6df69bf2a3..e6c007c1d0 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -1,3 +1,6 @@ +#ifdef ARCHOS_GMINI120 +common/string.c +#endif #ifdef IRIVER_H100 crt0.S backlight.c diff --git a/firmware/common/string.c b/firmware/common/string.c new file mode 100644 index 0000000000..373aa92273 --- /dev/null +++ b/firmware/common/string.c @@ -0,0 +1,19 @@ +/* For archs that lack assembly optimized versions of those */ + +#include "string.h" + +_PTR _EXFUN(memset,(_PTR, int, size_t)); + +_PTR memset(_PTR data, int val, size_t count) +{ + for (int i=0; i < count; i++) + ((char*)data)[i] = val; + return data; +} + +_PTR memcpy(_PTR dst, const _PTR src, size_t count) +{ + for (int i=0; i < count; i++) + ((char*)dst)[i] = ((char*)src)[i]; + return dst; +}