nommu.c 1.9 KB

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