nommu.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * arch/sh/mm/nommu.c
  4. *
  5. * Various helper routines and stubs for MMUless SH.
  6. *
  7. * Copyright (C) 2002 - 2009 Paul Mundt
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/init.h>
  11. #include <linux/string.h>
  12. #include <linux/mm.h>
  13. #include <asm/tlbflush.h>
  14. #include <asm/page.h>
  15. #include <linux/uaccess.h>
  16. /*
  17. * Nothing too terribly exciting here ..
  18. */
  19. void copy_page(void *to, void *from)
  20. {
  21. memcpy(to, from, PAGE_SIZE);
  22. }
  23. __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n)
  24. {
  25. memcpy(to, from, n);
  26. return 0;
  27. }
  28. __kernel_size_t __clear_user(void __user *to, __kernel_size_t n)
  29. {
  30. memset((__force void *)to, 0, n);
  31. return 0;
  32. }
  33. void local_flush_tlb_all(void)
  34. {
  35. BUG();
  36. }
  37. void local_flush_tlb_mm(struct mm_struct *mm)
  38. {
  39. BUG();
  40. }
  41. void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
  42. unsigned long end)
  43. {
  44. BUG();
  45. }
  46. void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
  47. {
  48. BUG();
  49. }
  50. void local_flush_tlb_one(unsigned long asid, unsigned long page)
  51. {
  52. BUG();
  53. }
  54. void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
  55. {
  56. BUG();
  57. }
  58. void __flush_tlb_global(void)
  59. {
  60. }
  61. void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
  62. {
  63. }
  64. void __init kmap_coherent_init(void)
  65. {
  66. }
  67. void *kmap_coherent(struct page *page, unsigned long addr)
  68. {
  69. BUG();
  70. return NULL;
  71. }
  72. void kunmap_coherent(void *kvaddr)
  73. {
  74. BUG();
  75. }
  76. void __init page_table_range_init(unsigned long start, unsigned long end,
  77. pgd_t *pgd_base)
  78. {
  79. }
  80. void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
  81. {
  82. }