060-mips_decompressor_memmove.patch 472 B

12345678910111213141516171819202122
  1. --- a/arch/mips/boot/compressed/string.c
  2. +++ b/arch/mips/boot/compressed/string.c
  3. @@ -26,3 +26,19 @@ void *memset(void *s, int c, size_t n)
  4. ss[i] = c;
  5. return s;
  6. }
  7. +
  8. +void *memmove(void *__dest, __const void *__src, size_t count)
  9. +{
  10. + unsigned char *d = __dest;
  11. + const unsigned char *s = __src;
  12. +
  13. + if (__dest == __src)
  14. + return __dest;
  15. +
  16. + if (__dest < __src)
  17. + return memcpy(__dest, __src, count);
  18. +
  19. + while (count--)
  20. + d[count] = s[count];
  21. + return __dest;
  22. +}