UPSTREAM: examples: add fallback memcpy

Solves build issue:

  Building current source for 134 boards (12 threads, 1 job per thread)
         arm:  +   lsxhl
  +examples/api/vsprintf.o: In function `string16':
  +lib/vsprintf.c:278: undefined reference to `memcpy'
  +examples/api/uuid.o: In function `uuid_bin_to_str':
  +lib/uuid.c:197: undefined reference to `memcpy'
  +lib/uuid.c:199: undefined reference to `memcpy'
  +make[3]: *** [examples/api/demo] Error 1
  +make[2]: *** [examples/api] Error 2
  +make[1]: *** [examples] Error 2
  +make: *** [sub-make] Error 2
    133    0    1 /134    sheevaplug

Change-Id: I467ecc2957a5b74eaf3e368394441817f228a469
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 7e3e20560784b048ff19e90cd36b6680626b1ab3)
This commit is contained in:
Rob Clark 2017-09-09 06:47:43 -04:00 committed by Kever Yang
parent aa5728ff9b
commit 2272054111
1 changed files with 12 additions and 0 deletions

View File

@ -416,3 +416,15 @@ void ub_display_clear(void)
{
syscall(API_DISPLAY_CLEAR, NULL);
}
__weak void *memcpy(void *dest, const void *src, size_t size)
{
unsigned char *dptr = dest;
const unsigned char *ptr = src;
const unsigned char *end = src + size;
while (ptr < end)
*dptr++ = *ptr++;
return dest;
}