nommu.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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/bootmem.h>
  10. #include <linux/io.h>
  11. #include <asm/cacheflush.h>
  12. #include <asm/sections.h>
  13. #include <asm/page.h>
  14. #include <asm/mach/arch.h>
  15. #include "mm.h"
  16. /*
  17. * Reserve the various regions of node 0
  18. */
  19. void __init reserve_node_zero(pg_data_t *pgdat)
  20. {
  21. /*
  22. * Register the kernel text and data with bootmem.
  23. * Note that this can only be in node 0.
  24. */
  25. #ifdef CONFIG_XIP_KERNEL
  26. reserve_bootmem_node(pgdat, __pa(_data), _end - _data,
  27. BOOTMEM_DEFAULT);
  28. #else
  29. reserve_bootmem_node(pgdat, __pa(_stext), _end - _stext,
  30. BOOTMEM_DEFAULT);
  31. #endif
  32. /*
  33. * Register the exception vector page.
  34. * some architectures which the DRAM is the exception vector to trap,
  35. * alloc_page breaks with error, although it is not NULL, but "0."
  36. */
  37. reserve_bootmem_node(pgdat, CONFIG_VECTORS_BASE, PAGE_SIZE,
  38. BOOTMEM_DEFAULT);
  39. }
  40. /*
  41. * paging_init() sets up the page tables, initialises the zone memory
  42. * maps, and sets up the zero page, bad page and bad page tables.
  43. */
  44. void __init paging_init(struct machine_desc *mdesc)
  45. {
  46. bootmem_init();
  47. }
  48. /*
  49. * We don't need to do anything here for nommu machines.
  50. */
  51. void setup_mm_for_reboot(char mode)
  52. {
  53. }
  54. void flush_dcache_page(struct page *page)
  55. {
  56. __cpuc_flush_dcache_page(page_address(page));
  57. }
  58. EXPORT_SYMBOL(flush_dcache_page);
  59. void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
  60. size_t size, unsigned int mtype)
  61. {
  62. if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
  63. return NULL;
  64. return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
  65. }
  66. EXPORT_SYMBOL(__arm_ioremap_pfn);
  67. void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
  68. unsigned int mtype)
  69. {
  70. return (void __iomem *)phys_addr;
  71. }
  72. EXPORT_SYMBOL(__arm_ioremap);
  73. void __iounmap(volatile void __iomem *addr)
  74. {
  75. }
  76. EXPORT_SYMBOL(__iounmap);