Loading...
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
20void __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
30void __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 */
38void __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 */
46void setup_mm_for_reboot(char mode)
47{
48}
49
50void flush_dcache_page(struct page *page)
51{
52 __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE);
53}
54EXPORT_SYMBOL(flush_dcache_page);
55
56void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
57 unsigned long uaddr, void *dst, const void *src,
58 unsigned long len)
59{
60 memcpy(dst, src, len);
61 if (vma->vm_flags & VM_EXEC)
62 __cpuc_coherent_user_range(uaddr, uaddr + len);
63}
64
65void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
66 size_t size, unsigned int mtype)
67{
68 if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
69 return NULL;
70 return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
71}
72EXPORT_SYMBOL(__arm_ioremap_pfn);
73
74void __iomem *__arm_ioremap_pfn_caller(unsigned long pfn, unsigned long offset,
75 size_t size, unsigned int mtype, void *caller)
76{
77 return __arm_ioremap_pfn(pfn, offset, size, mtype);
78}
79
80void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
81 unsigned int mtype)
82{
83 return (void __iomem *)phys_addr;
84}
85EXPORT_SYMBOL(__arm_ioremap);
86
87void __iomem *__arm_ioremap_caller(unsigned long phys_addr, size_t size,
88 unsigned int mtype, void *caller)
89{
90 return __arm_ioremap(phys_addr, size, mtype);
91}
92
93void __iounmap(volatile void __iomem *addr)
94{
95}
96EXPORT_SYMBOL(__iounmap);
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
21void __init arm_mm_memblock_reserve(void)
22{
23 /*
24 * Register the exception vector page.
25 * some architectures which the DRAM is the exception vector to trap,
26 * alloc_page breaks with error, although it is not NULL, but "0."
27 */
28 memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);
29}
30
31void __init sanity_check_meminfo(void)
32{
33 phys_addr_t end = bank_phys_end(&meminfo.bank[meminfo.nr_banks - 1]);
34 high_memory = __va(end - 1) + 1;
35}
36
37/*
38 * paging_init() sets up the page tables, initialises the zone memory
39 * maps, and sets up the zero page, bad page and bad page tables.
40 */
41void __init paging_init(struct machine_desc *mdesc)
42{
43 early_trap_init((void *)CONFIG_VECTORS_BASE);
44 bootmem_init();
45}
46
47/*
48 * We don't need to do anything here for nommu machines.
49 */
50void setup_mm_for_reboot(void)
51{
52}
53
54void flush_dcache_page(struct page *page)
55{
56 __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE);
57}
58EXPORT_SYMBOL(flush_dcache_page);
59
60void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
61 unsigned long uaddr, void *dst, const void *src,
62 unsigned long len)
63{
64 memcpy(dst, src, len);
65 if (vma->vm_flags & VM_EXEC)
66 __cpuc_coherent_user_range(uaddr, uaddr + len);
67}
68
69void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
70 size_t size, unsigned int mtype)
71{
72 if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
73 return NULL;
74 return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
75}
76EXPORT_SYMBOL(__arm_ioremap_pfn);
77
78void __iomem *__arm_ioremap_pfn_caller(unsigned long pfn, unsigned long offset,
79 size_t size, unsigned int mtype, void *caller)
80{
81 return __arm_ioremap_pfn(pfn, offset, size, mtype);
82}
83
84void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
85 unsigned int mtype)
86{
87 return (void __iomem *)phys_addr;
88}
89EXPORT_SYMBOL(__arm_ioremap);
90
91void __iomem * (*arch_ioremap_caller)(unsigned long, size_t, unsigned int, void *);
92
93void __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
99void (*arch_iounmap)(volatile void __iomem *);
100
101void __arm_iounmap(volatile void __iomem *addr)
102{
103}
104EXPORT_SYMBOL(__arm_iounmap);