2 * linux/arch/arm/mm/nommu.c
4 * ARM uCLinux supporting functions.
6 #include <linux/module.h>
8 #include <linux/pagemap.h>
9 #include <linux/bootmem.h>
12 #include <asm/cacheflush.h>
13 #include <asm/sections.h>
15 #include <asm/setup.h>
16 #include <asm/mach/arch.h>
21 * Reserve the various regions
23 void __init
reserve_special_regions(void)
26 * Register the kernel text and data with bootmem.
27 * Note that this can only be in node 0.
29 #ifdef CONFIG_XIP_KERNEL
30 reserve_bootmem(__pa(_data
), _end
- _data
, BOOTMEM_DEFAULT
);
32 reserve_bootmem(__pa(_stext
), _end
- _stext
, BOOTMEM_DEFAULT
);
36 * Register the exception vector page.
37 * some architectures which the DRAM is the exception vector to trap,
38 * alloc_page breaks with error, although it is not NULL, but "0."
40 reserve_bootmem(CONFIG_VECTORS_BASE
, PAGE_SIZE
, BOOTMEM_DEFAULT
);
44 * paging_init() sets up the page tables, initialises the zone memory
45 * maps, and sets up the zero page, bad page and bad page tables.
47 void __init
paging_init(struct machine_desc
*mdesc
)
53 * We don't need to do anything here for nommu machines.
55 void setup_mm_for_reboot(char mode
)
59 void flush_dcache_page(struct page
*page
)
61 __cpuc_flush_dcache_area(page_address(page
), PAGE_SIZE
);
63 EXPORT_SYMBOL(flush_dcache_page
);
65 void copy_to_user_page(struct vm_area_struct
*vma
, struct page
*page
,
66 unsigned long uaddr
, void *dst
, const void *src
,
69 memcpy(dst
, src
, len
);
70 if (vma
->vm_flags
& VM_EXEC
)
71 __cpuc_coherent_user_range(uaddr
, uaddr
+ len
);
74 void __iomem
*__arm_ioremap_pfn(unsigned long pfn
, unsigned long offset
,
75 size_t size
, unsigned int mtype
)
77 if (pfn
>= (0x100000000ULL
>> PAGE_SHIFT
))
79 return (void __iomem
*) (offset
+ (pfn
<< PAGE_SHIFT
));
81 EXPORT_SYMBOL(__arm_ioremap_pfn
);
83 void __iomem
*__arm_ioremap_pfn_caller(unsigned long pfn
, unsigned long offset
,
84 size_t size
, unsigned int mtype
, void *caller
)
86 return __arm_ioremap_pfn(pfn
, offset
, size
, mtype
);
89 void __iomem
*__arm_ioremap(unsigned long phys_addr
, size_t size
,
92 return (void __iomem
*)phys_addr
;
94 EXPORT_SYMBOL(__arm_ioremap
);
96 void __iomem
*__arm_ioremap_caller(unsigned long phys_addr
, size_t size
,
97 unsigned int mtype
, void *caller
)
99 return __arm_ioremap(phys_addr
, size
, mtype
);
102 void __iounmap(volatile void __iomem
*addr
)
105 EXPORT_SYMBOL(__iounmap
);