aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/page.h
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-01-12 17:47:08 -0500
committerSteve French <sfrench@us.ibm.com>2006-01-12 17:47:08 -0500
commit94bc2be31a01a3055ec94176e595dfe208e92d3b (patch)
treeebfbe81c6718a6390bfa1b99c6d228237d818576 /include/asm-powerpc/page.h
parentc32a0b689cb9cc160cfcd19735bbf50bb70c6ef4 (diff)
parent58cba4650a7a414eabd2b40cc9d8e45fcdf192d9 (diff)
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'include/asm-powerpc/page.h')
-rw-r--r--include/asm-powerpc/page.h34
1 files changed, 31 insertions, 3 deletions
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h
index 18c1e5ee81a3..0b82df483f7f 100644
--- a/include/asm-powerpc/page.h
+++ b/include/asm-powerpc/page.h
@@ -37,8 +37,30 @@
37 */ 37 */
38#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) 38#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
39 39
40/*
41 * KERNELBASE is the virtual address of the start of the kernel, it's often
42 * the same as PAGE_OFFSET, but _might not be_.
43 *
44 * The kdump dump kernel is one example where KERNELBASE != PAGE_OFFSET.
45 *
46 * To get a physical address from a virtual one you subtract PAGE_OFFSET,
47 * _not_ KERNELBASE.
48 *
49 * If you want to know something's offset from the start of the kernel you
50 * should subtract KERNELBASE.
51 *
52 * If you want to test if something's a kernel address, use is_kernel_addr().
53 */
54
55#ifdef CONFIG_CRASH_DUMP
56/* Kdump kernel runs at 32 MB, change at your peril. */
57#define PHYSICAL_START 0x2000000
58#else
59#define PHYSICAL_START 0x0
60#endif
61
40#define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) 62#define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START)
41#define KERNELBASE PAGE_OFFSET 63#define KERNELBASE (PAGE_OFFSET + PHYSICAL_START)
42 64
43#ifdef CONFIG_DISCONTIGMEM 65#ifdef CONFIG_DISCONTIGMEM
44#define page_to_pfn(page) discontigmem_page_to_pfn(page) 66#define page_to_pfn(page) discontigmem_page_to_pfn(page)
@@ -56,7 +78,7 @@
56#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 78#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
57#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 79#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
58 80
59#define __va(x) ((void *)((unsigned long)(x) + KERNELBASE)) 81#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET))
60#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET) 82#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET)
61 83
62/* 84/*
@@ -86,6 +108,12 @@
86/* to align the pointer to the (next) page boundary */ 108/* to align the pointer to the (next) page boundary */
87#define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE) 109#define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE)
88 110
111/*
112 * Don't compare things with KERNELBASE or PAGE_OFFSET to test for
113 * "kernelness", use is_kernel_addr() - it should do what you want.
114 */
115#define is_kernel_addr(x) ((x) >= PAGE_OFFSET)
116
89#ifndef __ASSEMBLY__ 117#ifndef __ASSEMBLY__
90 118
91#undef STRICT_MM_TYPECHECKS 119#undef STRICT_MM_TYPECHECKS
@@ -150,7 +178,7 @@ typedef unsigned long pmd_t;
150#define pmd_val(x) (x) 178#define pmd_val(x) (x)
151#define __pmd(x) (x) 179#define __pmd(x) (x)
152 180
153#ifndef CONFIG_PPC_64K_PAGES 181#if defined(CONFIG_PPC64) && !defined(CONFIG_PPC_64K_PAGES)
154typedef unsigned long pud_t; 182typedef unsigned long pud_t;
155#define pud_val(x) (x) 183#define pud_val(x) (x)
156#define __pud(x) (x) 184#define __pud(x) (x)