ARM: 7772/1: Fix missing flush_kernel_dcache_page() for noMMU
[pandora-kernel.git] / 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/mach/arch.h>
17
18 #include "mm.h"
19
20 void __init arm_mm_memblock_reserve(void)
21 {
22         /*
23          * Register the exception vector page.
24          * some architectures which the DRAM is the exception vector to trap,
25          * alloc_page breaks with error, although it is not NULL, but "0."
26          */
27         memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);
28 }
29
30 void __init sanity_check_meminfo(void)
31 {
32 }
33
34 /*
35  * paging_init() sets up the page tables, initialises the zone memory
36  * maps, and sets up the zero page, bad page and bad page tables.
37  */
38 void __init paging_init(struct machine_desc *mdesc)
39 {
40         bootmem_init();
41 }
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
50 void flush_dcache_page(struct page *page)
51 {
52         __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE);
53 }
54 EXPORT_SYMBOL(flush_dcache_page);
55
56 void flush_kernel_dcache_page(struct page *page)
57 {
58         __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE);
59 }
60 EXPORT_SYMBOL(flush_kernel_dcache_page);
61
62 void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
63                        unsigned long uaddr, void *dst, const void *src,
64                        unsigned long len)
65 {
66         memcpy(dst, src, len);
67         if (vma->vm_flags & VM_EXEC)
68                 __cpuc_coherent_user_range(uaddr, uaddr + len);
69 }
70
71 void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
72                                 size_t size, unsigned int mtype)
73 {
74         if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
75                 return NULL;
76         return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
77 }
78 EXPORT_SYMBOL(__arm_ioremap_pfn);
79
80 void __iomem *__arm_ioremap_pfn_caller(unsigned long pfn, unsigned long offset,
81                            size_t size, unsigned int mtype, void *caller)
82 {
83         return __arm_ioremap_pfn(pfn, offset, size, mtype);
84 }
85
86 void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
87                             unsigned int mtype)
88 {
89         return (void __iomem *)phys_addr;
90 }
91 EXPORT_SYMBOL(__arm_ioremap);
92
93 void __iomem *__arm_ioremap_caller(unsigned long phys_addr, size_t size,
94                                    unsigned int mtype, void *caller)
95 {
96         return __arm_ioremap(phys_addr, size, mtype);
97 }
98
99 void __iounmap(volatile void __iomem *addr)
100 {
101 }
102 EXPORT_SYMBOL(__iounmap);