nommu.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * linux/arch/arm/mm/nommu.c
  3. *
  4. * ARM uCLinux supporting functions.
  5. */
  6. #include <linux/module.h>
  7. #include <linux/mm.h>
  8. #include <linux/pagemap.h>
  9. #include <linux/io.h>
  10. #include <linux/memblock.h>
  11. #include <asm/cacheflush.h>
  12. #include <asm/sections.h>
  13. #include <asm/page.h>
  14. #include <asm/setup.h>
  15. #include <asm/mach/arch.h>
  16. #include "mm.h"
  17. void __init arm_mm_memblock_reserve(void)
  18. {
  19. /*
  20. * Register the exception vector page.
  21. * some architectures which the DRAM is the exception vector to trap,
  22. * alloc_page breaks with error, although it is not NULL, but "0."
  23. */
  24. memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);
  25. }
  26. /*
  27. * paging_init() sets up the page tables, initialises the zone memory
  28. * maps, and sets up the zero page, bad page and bad page tables.
  29. */
  30. void __init paging_init(struct machine_desc *mdesc)
  31. {
  32. bootmem_init();
  33. }
  34. /*
  35. * We don't need to do anything here for nommu machines.
  36. */
  37. void setup_mm_for_reboot(char mode)
  38. {
  39. }
  40. void flush_dcache_page(struct page *page)
  41. {
  42. __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE);
  43. }
  44. EXPORT_SYMBOL(flush_dcache_page);
  45. void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
  46. unsigned long uaddr, void *dst, const void *src,
  47. unsigned long len)
  48. {
  49. memcpy(dst, src, len);
  50. if (vma->vm_flags & VM_EXEC)
  51. __cpuc_coherent_user_range(uaddr, uaddr + len);
  52. }
  53. void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
  54. size_t size, unsigned int mtype)
  55. {
  56. if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
  57. return NULL;
  58. return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
  59. }
  60. EXPORT_SYMBOL(__arm_ioremap_pfn);
  61. void __iomem *__arm_ioremap_pfn_caller(unsigned long pfn, unsigned long offset,
  62. size_t size, unsigned int mtype, void *caller)
  63. {
  64. return __arm_ioremap_pfn(pfn, offset, size, mtype);
  65. }
  66. void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
  67. unsigned int mtype)
  68. {
  69. return (void __iomem *)phys_addr;
  70. }
  71. EXPORT_SYMBOL(__arm_ioremap);
  72. void __iomem *__arm_ioremap_caller(unsigned long phys_addr, size_t size,
  73. unsigned int mtype, void *caller)
  74. {
  75. return __arm_ioremap(phys_addr, size, mtype);
  76. }
  77. void __iounmap(volatile void __iomem *addr)
  78. {
  79. }
  80. EXPORT_SYMBOL(__iounmap);