1 #ifndef _ASM_X86_PAGE_H
2 #define _ASM_X86_PAGE_H
4 #include <linux/const.h>
6 /* PAGE_SHIFT determines the page size */
8 #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
9 #define PAGE_MASK (~(PAGE_SIZE-1))
11 #define PHYSICAL_PAGE_MASK (PAGE_MASK & __PHYSICAL_MASK)
13 #define LARGE_PAGE_SIZE (_AC(1,UL) << PMD_SHIFT)
14 #define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1))
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)
21 /* to align the pointer to the (next) page boundary */
22 #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
24 #define __PHYSICAL_MASK ((_AC(1,UL) << __PHYSICAL_MASK_SHIFT) - 1)
25 #define __VIRTUAL_MASK ((_AC(1,UL) << __VIRTUAL_MASK_SHIFT) - 1)
29 #define THREAD_ORDER 1
30 #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
31 #define CURRENT_MASK (~(THREAD_SIZE-1))
33 #define EXCEPTION_STACK_ORDER 0
34 #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
36 #define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
37 #define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
39 #define IRQSTACK_ORDER 2
40 #define IRQSTACKSIZE (PAGE_SIZE << IRQSTACK_ORDER)
42 #define STACKFAULT_STACK 1
43 #define DOUBLEFAULT_STACK 2
47 #define N_EXCEPTION_STACKS 5 /* hw limit: 7 */
49 #define __PAGE_OFFSET _AC(0xffff810000000000, UL)
51 #define __PHYSICAL_START CONFIG_PHYSICAL_START
52 #define __KERNEL_ALIGN 0x200000
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)
59 #if (CONFIG_PHYSICAL_START % __KERNEL_ALIGN) != 0
60 #error "CONFIG_PHYSICAL_START must be a multiple of 2MB"
63 #define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
64 #define __START_KERNEL_map _AC(0xffffffff80000000, UL)
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
70 #define KERNEL_TEXT_SIZE (40*1024*1024)
71 #define KERNEL_TEXT_START _AC(0xffffffff80000000, UL)
73 #endif /* CONFIG_X86_64 */
78 * This handles the memory map.
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.
84 * If you want more physical memory than this then see the CONFIG_HIGHMEM4G
85 * and CONFIG_HIGHMEM64G options in the kernel configuration.
87 #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
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 */
97 #ifdef CONFIG_HUGETLB_PAGE
98 #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
101 #endif /* CONFIG_X86_32 */
103 #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
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)
111 # include "page_32.h"
113 # include "page_64.h"
116 #endif /* _ASM_X86_PAGE_H */