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
This commit is contained in:
Daniel Stenberg 2005-01-10 21:31:13 +00:00
parent 87923f2459
commit 39fb8f0705
2 changed files with 22 additions and 0 deletions

View file

@ -1,3 +1,6 @@
#ifdef ARCHOS_GMINI120
common/string.c
#endif
#ifdef IRIVER_H100
crt0.S
backlight.c

19
firmware/common/string.c Normal file
View file

@ -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;
}