memcpy.c 474 B

1234567891011121314151617181920212223
  1. /*
  2. * aboot/lib/memcpy.c
  3. *
  4. * Copyright (c) 1995 David Mosberger (davidm@cs.arizona.edu)
  5. */
  6. #include <linux/types.h>
  7. #include <stddef.h>
  8. /*
  9. * Booting is I/O bound so rather than a time-optimized, we want
  10. * a space-optimized memcpy. Not that the rest of the loader
  11. * were particularly small, though...
  12. */
  13. void *__memcpy(void *dest, const void *source, size_t n)
  14. {
  15. char *dst = dest;
  16. const char *src = source;
  17. while (n--) {
  18. *dst++ = *src++;
  19. }
  20. return dest;
  21. }