aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/include/asm/memory.h')
-rw-r--r--arch/arm/include/asm/memory.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 57870ab313c5..e750a938fd3c 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -18,6 +18,8 @@
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/sizes.h> 19#include <linux/sizes.h>
20 20
21#include <asm/cache.h>
22
21#ifdef CONFIG_NEED_MACH_MEMORY_H 23#ifdef CONFIG_NEED_MACH_MEMORY_H
22#include <mach/memory.h> 24#include <mach/memory.h>
23#endif 25#endif
@@ -141,6 +143,20 @@
141#define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page))) 143#define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page)))
142#define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys))) 144#define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys)))
143 145
146/*
147 * Minimum guaranted alignment in pgd_alloc(). The page table pointers passed
148 * around in head.S and proc-*.S are shifted by this amount, in order to
149 * leave spare high bits for systems with physical address extension. This
150 * does not fully accomodate the 40-bit addressing capability of ARM LPAE, but
151 * gives us about 38-bits or so.
152 */
153#ifdef CONFIG_ARM_LPAE
154#define ARCH_PGD_SHIFT L1_CACHE_SHIFT
155#else
156#define ARCH_PGD_SHIFT 0
157#endif
158#define ARCH_PGD_MASK ((1 << ARCH_PGD_SHIFT) - 1)
159
144#ifndef __ASSEMBLY__ 160#ifndef __ASSEMBLY__
145 161
146/* 162/*
@@ -207,7 +223,7 @@ static inline unsigned long __phys_to_virt(unsigned long x)
207 * direct-mapped view. We assume this is the first page 223 * direct-mapped view. We assume this is the first page
208 * of RAM in the mem_map as well. 224 * of RAM in the mem_map as well.
209 */ 225 */
210#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT) 226#define PHYS_PFN_OFFSET ((unsigned long)(PHYS_OFFSET >> PAGE_SHIFT))
211 227
212/* 228/*
213 * These are *only* valid on the kernel direct mapped RAM memory. 229 * These are *only* valid on the kernel direct mapped RAM memory.
@@ -260,12 +276,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
260/* 276/*
261 * Conversion between a struct page and a physical address. 277 * Conversion between a struct page and a physical address.
262 * 278 *
263 * Note: when converting an unknown physical address to a
264 * struct page, the resulting pointer must be validated
265 * using VALID_PAGE(). It must return an invalid struct page
266 * for any physical address not corresponding to a system
267 * RAM address.
268 *
269 * page_to_pfn(page) convert a struct page * to a PFN number 279 * page_to_pfn(page) convert a struct page * to a PFN number
270 * pfn_to_page(pfn) convert a _valid_ PFN number to struct page * 280 * pfn_to_page(pfn) convert a _valid_ PFN number to struct page *
271 * 281 *