]> Pileus Git - ~andy/linux/blob - arch/arm/mm/nommu.c
Merge branch 'core-mutexes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / arch / arm / mm / nommu.c
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
12 #include <asm/cacheflush.h>
13 #include <asm/sections.h>
14 #include <asm/page.h>
15 #include <asm/setup.h>
16 #include <asm/traps.h>
17 #include <asm/mach/arch.h>
18
19 #include "mm.h"
20
21 void __init arm_mm_memblock_reserve(void)
22 {
23 #ifndef CONFIG_CPU_V7M
24         /*
25          * Register the exception vector page.
26          * some architectures which the DRAM is the exception vector to trap,
27          * alloc_page breaks with error, although it is not NULL, but "0."
28          */
29         memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);
30 #else /* ifndef CONFIG_CPU_V7M */
31         /*
32          * There is no dedicated vector page on V7-M. So nothing needs to be
33          * reserved here.
34          */
35 #endif
36 }
37
38 void __init sanity_check_meminfo(void)
39 {
40         phys_addr_t end = bank_phys_end(&meminfo.bank[meminfo.nr_banks - 1]);
41         high_memory = __va(end - 1) + 1;
42 }
43
44 /*
45  * paging_init() sets up the page tables, initialises the zone memory
46  * maps, and sets up the zero page, bad page and bad page tables.
47  */
48 void __init paging_init(struct machine_desc *mdesc)
49 {
50         early_trap_init((void *)CONFIG_VECTORS_BASE);
51         bootmem_init();
52 }
53
54 /*
55  * We don't need to do anything here for nommu machines.
56  */
57 void setup_mm_for_reboot(void)
58 {
59 }
60
61 void flush_dcache_page(struct page *page)
62 {
63         __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE);
64 }
65 EXPORT_SYMBOL(flush_dcache_page);
66
67 void flush_kernel_dcache_page(struct page *page)
68 {
69         __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE);
70 }
71 EXPORT_SYMBOL(flush_kernel_dcache_page);
72
73 void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
74                        unsigned long uaddr, void *dst, const void *src,
75                        unsigned long len)
76 {
77         memcpy(dst, src, len);
78         if (vma->vm_flags & VM_EXEC)
79                 __cpuc_coherent_user_range(uaddr, uaddr + len);
80 }
81
82 void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
83                                 size_t size, unsigned int mtype)
84 {
85         if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
86                 return NULL;
87         return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
88 }
89 EXPORT_SYMBOL(__arm_ioremap_pfn);
90
91 void __iomem *__arm_ioremap_pfn_caller(unsigned long pfn, unsigned long offset,
92                            size_t size, unsigned int mtype, void *caller)
93 {
94         return __arm_ioremap_pfn(pfn, offset, size, mtype);
95 }
96
97 void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
98                             unsigned int mtype)
99 {
100         return (void __iomem *)phys_addr;
101 }
102 EXPORT_SYMBOL(__arm_ioremap);
103
104 void __iomem * (*arch_ioremap_caller)(unsigned long, size_t, unsigned int, void *);
105
106 void __iomem *__arm_ioremap_caller(unsigned long phys_addr, size_t size,
107                                    unsigned int mtype, void *caller)
108 {
109         return __arm_ioremap(phys_addr, size, mtype);
110 }
111
112 void (*arch_iounmap)(volatile void __iomem *);
113
114 void __arm_iounmap(volatile void __iomem *addr)
115 {
116 }
117 EXPORT_SYMBOL(__arm_iounmap);