string.c 397 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * arch/mips/boot/compressed/string.c
  3. *
  4. * Very small subset of simple string routines
  5. */
  6. #include <linux/types.h>
  7. void *memcpy(void *dest, const void *src, size_t n)
  8. {
  9. int i;
  10. const char *s = src;
  11. char *d = dest;
  12. for (i = 0; i < n; i++)
  13. d[i] = s[i];
  14. return dest;
  15. }
  16. void *memset(void *s, int c, size_t n)
  17. {
  18. int i;
  19. char *ss = s;
  20. for (i = 0; i < n; i++)
  21. ss[i] = c;
  22. return s;
  23. }