aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/page_64.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-01-30 07:32:41 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:41 -0500
commit83a5101bf2fa7dcf09ffd436078a021d32c97f85 (patch)
tree57a99676a79c33274a4c0db5638fe30f434c4f94 /include/asm-x86/page_64.h
parent9566e91d494ed0668edf88f852de7f251fe8fe9a (diff)
x86: page.h: unify constants
# HG changeset patch # User Jeremy Fitzhardinge <jeremy@xensource.com> # Date 1199317360 28800 # Node ID ba0ec40a50a7aef1a3153cea124c35e261f5a2df # Parent c45c263179cb78284b6b869c574457df088027d1 x86: page.h: unify constants There are many constants which are shared by 32 and 64-bit. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/page_64.h')
-rw-r--r--include/asm-x86/page_64.h74
1 files changed, 5 insertions, 69 deletions
diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h
index 068b5e4cea4c..69ef7cf9dadd 100644
--- a/include/asm-x86/page_64.h
+++ b/include/asm-x86/page_64.h
@@ -1,42 +1,6 @@
1#ifndef _X86_64_PAGE_H 1#ifndef _X86_64_PAGE_H
2#define _X86_64_PAGE_H 2#define _X86_64_PAGE_H
3 3
4#include <linux/const.h>
5
6/* PAGE_SHIFT determines the page size */
7#define PAGE_SHIFT 12
8#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
9#define PAGE_MASK (~(PAGE_SIZE-1))
10#define PHYSICAL_PAGE_MASK (~(PAGE_SIZE-1) & __PHYSICAL_MASK)
11
12#define THREAD_ORDER 1
13#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
14#define CURRENT_MASK (~(THREAD_SIZE-1))
15
16#define EXCEPTION_STACK_ORDER 0
17#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
18
19#define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
20#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
21
22#define IRQSTACK_ORDER 2
23#define IRQSTACKSIZE (PAGE_SIZE << IRQSTACK_ORDER)
24
25#define STACKFAULT_STACK 1
26#define DOUBLEFAULT_STACK 2
27#define NMI_STACK 3
28#define DEBUG_STACK 4
29#define MCE_STACK 5
30#define N_EXCEPTION_STACKS 5 /* hw limit: 7 */
31
32#define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1))
33#define LARGE_PAGE_SIZE (_AC(1,UL) << PMD_SHIFT)
34
35#define HPAGE_SHIFT PMD_SHIFT
36#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
37#define HPAGE_MASK (~(HPAGE_SIZE - 1))
38#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
39
40#ifdef __KERNEL__ 4#ifdef __KERNEL__
41#ifndef __ASSEMBLY__ 5#ifndef __ASSEMBLY__
42 6
@@ -90,35 +54,6 @@ extern unsigned long phys_base;
90 54
91#endif /* !__ASSEMBLY__ */ 55#endif /* !__ASSEMBLY__ */
92 56
93#define __PHYSICAL_START CONFIG_PHYSICAL_START
94#define __KERNEL_ALIGN 0x200000
95
96/*
97 * Make sure kernel is aligned to 2MB address. Catching it at compile
98 * time is better. Change your config file and compile the kernel
99 * for a 2MB aligned address (CONFIG_PHYSICAL_START)
100 */
101#if (CONFIG_PHYSICAL_START % __KERNEL_ALIGN) != 0
102#error "CONFIG_PHYSICAL_START must be a multiple of 2MB"
103#endif
104
105#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
106#define __START_KERNEL_map _AC(0xffffffff80000000, UL)
107#define __PAGE_OFFSET _AC(0xffff810000000000, UL)
108
109/* to align the pointer to the (next) page boundary */
110#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
111
112/* See Documentation/x86_64/mm.txt for a description of the memory map. */
113#define __PHYSICAL_MASK_SHIFT 46
114#define __PHYSICAL_MASK ((_AC(1,UL) << __PHYSICAL_MASK_SHIFT) - 1)
115#define __VIRTUAL_MASK_SHIFT 48
116#define __VIRTUAL_MASK ((_AC(1,UL) << __VIRTUAL_MASK_SHIFT) - 1)
117
118#define KERNEL_TEXT_SIZE (40*1024*1024)
119#define KERNEL_TEXT_START _AC(0xffffffff80000000, UL)
120#define PAGE_OFFSET __PAGE_OFFSET
121
122#ifndef __ASSEMBLY__ 57#ifndef __ASSEMBLY__
123 58
124#include <asm/bug.h> 59#include <asm/bug.h>
@@ -138,10 +73,6 @@ extern unsigned long __phys_addr(unsigned long);
138#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 73#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
139#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 74#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
140 75
141#define VM_DATA_DEFAULT_FLAGS \
142 (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
143 VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
144
145#define __HAVE_ARCH_GATE_AREA 1 76#define __HAVE_ARCH_GATE_AREA 1
146#define vmemmap ((struct page *)VMEMMAP_START) 77#define vmemmap ((struct page *)VMEMMAP_START)
147 78
@@ -150,4 +81,9 @@ extern unsigned long __phys_addr(unsigned long);
150 81
151#endif /* __KERNEL__ */ 82#endif /* __KERNEL__ */
152 83
84#ifdef CONFIG_FLATMEM
85#define pfn_valid(pfn) ((pfn) < end_pfn)
86#endif
87
88
153#endif /* _X86_64_PAGE_H */ 89#endif /* _X86_64_PAGE_H */