nommu.c 1.8 KB

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