1
2
3
4
5
6
7
8
9
10
11 #ifndef __UNICORE_MEMORY_H__
12 #define __UNICORE_MEMORY_H__
13
14 #include <linux/compiler.h>
15 #include <linux/const.h>
16 #include <linux/sizes.h>
17 #include <mach/memory.h>
18
19
20
21
22
23
24 #define PAGE_OFFSET UL(0xC0000000)
25 #define TASK_SIZE (PAGE_OFFSET - UL(0x41000000))
26 #define TASK_UNMAPPED_BASE (PAGE_OFFSET / 3)
27
28
29
30
31
32 #define MODULES_VADDR (PAGE_OFFSET - 16*1024*1024)
33 #if TASK_SIZE > MODULES_VADDR
34 #error Top of user space clashes with start of module space
35 #endif
36
37 #define MODULES_END (PAGE_OFFSET)
38
39
40
41
42 #define IOREMAP_MAX_ORDER 24
43
44
45
46
47
48
49 #ifndef __virt_to_phys
50 #define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET)
51 #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET)
52 #endif
53
54
55
56
57 #define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page)))
58 #define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys)))
59
60 #ifndef __ASSEMBLY__
61
62 #ifndef arch_adjust_zones
63 #define arch_adjust_zones(size, holes) do { } while (0)
64 #endif
65
66
67
68
69
70
71
72
73
74 #define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT)
75
76
77
78
79 #define __pa(x) __virt_to_phys((unsigned long)(x))
80 #define __va(x) ((void *)__phys_to_virt((unsigned long)(x)))
81 #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
82
83
84
85
86
87
88
89
90
91
92 #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
93
94 #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
95 #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && \
96 (unsigned long)(kaddr) < (unsigned long)high_memory)
97
98 #endif
99
100 #include <asm-generic/memory_model.h>
101
102 #endif