diff options
Diffstat (limited to 'include/asm-x86/page.h')
-rw-r--r-- | include/asm-x86/page.h | 125 |
1 files changed, 114 insertions, 11 deletions
diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h index a757eb26141d..e0fa4a032ea7 100644 --- a/include/asm-x86/page.h +++ b/include/asm-x86/page.h | |||
@@ -1,13 +1,116 @@ | |||
1 | #ifdef __KERNEL__ | 1 | #ifndef _ASM_X86_PAGE_H |
2 | # ifdef CONFIG_X86_32 | 2 | #define _ASM_X86_PAGE_H |
3 | # include "page_32.h" | 3 | |
4 | # else | 4 | #include <linux/const.h> |
5 | # include "page_64.h" | 5 | |
6 | # endif | 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 | |||
11 | #define PHYSICAL_PAGE_MASK (PAGE_MASK & __PHYSICAL_MASK) | ||
12 | |||
13 | #define LARGE_PAGE_SIZE (_AC(1,UL) << PMD_SHIFT) | ||
14 | #define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1)) | ||
15 | |||
16 | #define HPAGE_SHIFT PMD_SHIFT | ||
17 | #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) | ||
18 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) | ||
19 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | ||
20 | |||
21 | /* to align the pointer to the (next) page boundary */ | ||
22 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
23 | |||
24 | #define __PHYSICAL_MASK ((_AC(1,UL) << __PHYSICAL_MASK_SHIFT) - 1) | ||
25 | #define __VIRTUAL_MASK ((_AC(1,UL) << __VIRTUAL_MASK_SHIFT) - 1) | ||
26 | |||
27 | |||
28 | #ifdef CONFIG_X86_64 | ||
29 | #define THREAD_ORDER 1 | ||
30 | #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) | ||
31 | #define CURRENT_MASK (~(THREAD_SIZE-1)) | ||
32 | |||
33 | #define EXCEPTION_STACK_ORDER 0 | ||
34 | #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER) | ||
35 | |||
36 | #define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1) | ||
37 | #define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER) | ||
38 | |||
39 | #define IRQSTACK_ORDER 2 | ||
40 | #define IRQSTACKSIZE (PAGE_SIZE << IRQSTACK_ORDER) | ||
41 | |||
42 | #define STACKFAULT_STACK 1 | ||
43 | #define DOUBLEFAULT_STACK 2 | ||
44 | #define NMI_STACK 3 | ||
45 | #define DEBUG_STACK 4 | ||
46 | #define MCE_STACK 5 | ||
47 | #define N_EXCEPTION_STACKS 5 /* hw limit: 7 */ | ||
48 | |||
49 | #define __PAGE_OFFSET _AC(0xffff810000000000, UL) | ||
50 | |||
51 | #define __PHYSICAL_START CONFIG_PHYSICAL_START | ||
52 | #define __KERNEL_ALIGN 0x200000 | ||
53 | |||
54 | /* | ||
55 | * Make sure kernel is aligned to 2MB address. Catching it at compile | ||
56 | * time is better. Change your config file and compile the kernel | ||
57 | * for a 2MB aligned address (CONFIG_PHYSICAL_START) | ||
58 | */ | ||
59 | #if (CONFIG_PHYSICAL_START % __KERNEL_ALIGN) != 0 | ||
60 | #error "CONFIG_PHYSICAL_START must be a multiple of 2MB" | ||
61 | #endif | ||
62 | |||
63 | #define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START) | ||
64 | #define __START_KERNEL_map _AC(0xffffffff80000000, UL) | ||
65 | |||
66 | /* See Documentation/x86_64/mm.txt for a description of the memory map. */ | ||
67 | #define __PHYSICAL_MASK_SHIFT 46 | ||
68 | #define __VIRTUAL_MASK_SHIFT 48 | ||
69 | |||
70 | #define KERNEL_TEXT_SIZE (40*1024*1024) | ||
71 | #define KERNEL_TEXT_START _AC(0xffffffff80000000, UL) | ||
72 | |||
73 | #endif /* CONFIG_X86_64 */ | ||
74 | |||
75 | #ifdef CONFIG_X86_32 | ||
76 | |||
77 | /* | ||
78 | * This handles the memory map. | ||
79 | * | ||
80 | * A __PAGE_OFFSET of 0xC0000000 means that the kernel has | ||
81 | * a virtual address space of one gigabyte, which limits the | ||
82 | * amount of physical memory you can use to about 950MB. | ||
83 | * | ||
84 | * If you want more physical memory than this then see the CONFIG_HIGHMEM4G | ||
85 | * and CONFIG_HIGHMEM64G options in the kernel configuration. | ||
86 | */ | ||
87 | #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL) | ||
88 | |||
89 | #ifdef CONFIG_X86_PAE | ||
90 | #define __PHYSICAL_MASK_SHIFT 36 | ||
91 | #define __VIRTUAL_MASK_SHIFT 32 | ||
92 | #else /* !CONFIG_X86_PAE */ | ||
93 | #define __PHYSICAL_MASK_SHIFT 32 | ||
94 | #define __VIRTUAL_MASK_SHIFT 32 | ||
95 | #endif /* CONFIG_X86_PAE */ | ||
96 | |||
97 | #ifdef CONFIG_HUGETLB_PAGE | ||
98 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA | ||
99 | #endif | ||
100 | |||
101 | #endif /* CONFIG_X86_32 */ | ||
102 | |||
103 | #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) | ||
104 | |||
105 | #define VM_DATA_DEFAULT_FLAGS \ | ||
106 | (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ | ||
107 | VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | ||
108 | |||
109 | |||
110 | #ifdef CONFIG_X86_32 | ||
111 | # include "page_32.h" | ||
7 | #else | 112 | #else |
8 | # ifdef __i386__ | 113 | # include "page_64.h" |
9 | # include "page_32.h" | ||
10 | # else | ||
11 | # include "page_64.h" | ||
12 | # endif | ||
13 | #endif | 114 | #endif |
115 | |||
116 | #endif /* _ASM_X86_PAGE_H */ | ||