MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / arch / arm / mm / nommu.c
blob3055e9d723cbaa0f11f948674382397ec5b42b58
1 /*
2 * linux/arch/arm/mm/nommu.c
4 * ARM uCLinux supporting functions.
5 */
6 #include <linux/module.h>
7 #include <linux/mm.h>
8 #include <linux/pagemap.h>
10 #include <asm/cacheflush.h>
11 #include <asm/io.h>
12 #include <asm/page.h>
14 #include "mm.h"
16 extern void _stext, __data_start, _end;
19 * Reserve the various regions of node 0
21 void __init reserve_node_zero(pg_data_t *pgdat)
24 * Register the kernel text and data with bootmem.
25 * Note that this can only be in node 0.
27 #ifdef CONFIG_XIP_KERNEL
28 reserve_bootmem_node(pgdat, __pa(&__data_start), &_end - &__data_start);
29 #else
30 reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext);
31 #endif
34 * Register the exception vector page.
35 * some architectures which the DRAM is the exception vector to trap,
36 * alloc_page breaks with error, although it is not NULL, but "0."
38 reserve_bootmem_node(pgdat, CONFIG_VECTORS_BASE, PAGE_SIZE);
42 * paging_init() sets up the page tables, initialises the zone memory
43 * maps, and sets up the zero page, bad page and bad page tables.
45 void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
47 bootmem_init(mi);
51 * We don't need to do anything here for nommu machines.
53 void setup_mm_for_reboot(char mode)
57 void flush_dcache_page(struct page *page)
59 __cpuc_flush_dcache_page(page_address(page));
61 EXPORT_SYMBOL(flush_dcache_page);
63 void __iomem *__ioremap_pfn(unsigned long pfn, unsigned long offset,
64 size_t size, unsigned long flags)
66 if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
67 return NULL;
68 return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
70 EXPORT_SYMBOL(__ioremap_pfn);
72 void __iomem *__ioremap(unsigned long phys_addr, size_t size,
73 unsigned long flags)
75 return (void __iomem *)phys_addr;
77 EXPORT_SYMBOL(__ioremap);
79 void __iounmap(volatile void __iomem *addr)
82 EXPORT_SYMBOL(__iounmap);
85 * You really shouldn't be using read() or write() on /dev/mem. This
86 * might go away in the future.
88 int valid_phys_addr_range(unsigned long addr, size_t size)
90 if (addr + size > __pa(high_memory))
91 return 0;
93 return 1;
97 * We don't use supersection mappings for mmap() on /dev/mem, which
98 * means that we can't map the memory area above the 4G barrier into
99 * userspace.
101 int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
103 return !(pfn + (size >> PAGE_SHIFT) > 0x00100000);