nommu.c 2.2 KB
Newer Older
1 2 3 4 5 6
/*
 *  linux/arch/arm/mm/nommu.c
 *
 * ARM uCLinux supporting functions.
 */
#include <linux/module.h>
7 8
#include <linux/mm.h>
#include <linux/pagemap.h>
9
#include <linux/io.h>
R
Russell King 已提交
10
#include <linux/memblock.h>
11

12
#include <asm/cacheflush.h>
R
Russell King 已提交
13
#include <asm/sections.h>
14
#include <asm/page.h>
15
#include <asm/setup.h>
R
Russell King 已提交
16
#include <asm/mach/arch.h>
17

18 19
#include "mm.h"

R
Russell King 已提交
20
void __init arm_mm_memblock_reserve(void)
21 22 23 24 25 26
{
	/*
	 * Register the exception vector page.
	 * some architectures which the DRAM is the exception vector to trap,
	 * alloc_page breaks with error, although it is not NULL, but "0."
	 */
R
Russell King 已提交
27
	memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);
28 29
}

30 31 32 33
void __init sanity_check_meminfo(void)
{
}

34 35 36 37
/*
 * paging_init() sets up the page tables, initialises the zone memory
 * maps, and sets up the zero page, bad page and bad page tables.
 */
38
void __init paging_init(struct machine_desc *mdesc)
39
{
40
	bootmem_init();
41 42
}

43 44 45 46 47 48 49
/*
 * We don't need to do anything here for nommu machines.
 */
void setup_mm_for_reboot(char mode)
{
}

50 51
void flush_dcache_page(struct page *page)
{
52
	__cpuc_flush_dcache_area(page_address(page), PAGE_SIZE);
53
}
54
EXPORT_SYMBOL(flush_dcache_page);
55

56 57 58 59 60 61 62 63 64
void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
		       unsigned long uaddr, void *dst, const void *src,
		       unsigned long len)
{
	memcpy(dst, src, len);
	if (vma->vm_flags & VM_EXEC)
		__cpuc_coherent_user_range(uaddr, uaddr + len);
}

65 66
void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
				size_t size, unsigned int mtype)
67 68 69 70 71
{
	if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
		return NULL;
	return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
}
72
EXPORT_SYMBOL(__arm_ioremap_pfn);
73

74 75 76 77 78 79
void __iomem *__arm_ioremap_pfn_caller(unsigned long pfn, unsigned long offset,
			   size_t size, unsigned int mtype, void *caller)
{
	return __arm_ioremap_pfn(pfn, offset, size, mtype);
}

80 81
void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
			    unsigned int mtype)
82 83 84
{
	return (void __iomem *)phys_addr;
}
85
EXPORT_SYMBOL(__arm_ioremap);
86

87 88
void __iomem *__arm_ioremap_caller(unsigned long phys_addr, size_t size,
				   unsigned int mtype, void *caller)
89 90 91 92
{
	return __arm_ioremap(phys_addr, size, mtype);
}

R
Russell King 已提交
93
void __iounmap(volatile void __iomem *addr)
94 95 96
{
}
EXPORT_SYMBOL(__iounmap);