pg-nommu.c 766 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * arch/sh/mm/pg-nommu.c
  3. *
  4. * clear_page()/copy_page() implementation for MMUless SH.
  5. *
  6. * Copyright (C) 2003 Paul Mundt
  7. *
  8. * This file is subject to the terms and conditions of the GNU General Public
  9. * License. See the file "COPYING" in the main directory of this archive
  10. * for more details.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/kernel.h>
  14. #include <linux/string.h>
  15. #include <asm/page.h>
  16. #include <asm/uaccess.h>
  17. void copy_page(void *to, void *from)
  18. {
  19. memcpy(to, from, PAGE_SIZE);
  20. }
  21. void clear_page(void *to)
  22. {
  23. memset(to, 0, PAGE_SIZE);
  24. }
  25. __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n)
  26. {
  27. memcpy(to, from, n);
  28. return 0;
  29. }
  30. __kernel_size_t __clear_user(void *to, __kernel_size_t n)
  31. {
  32. memset(to, 0, n);
  33. return 0;
  34. }