4 #define PAGETABLE_LEVELS 4
7 #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
8 #define CURRENT_MASK (~(THREAD_SIZE - 1))
10 #define EXCEPTION_STACK_ORDER 0
11 #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
13 #define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
14 #define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
16 #define IRQSTACK_ORDER 2
17 #define IRQSTACKSIZE (PAGE_SIZE << IRQSTACK_ORDER)
19 #define STACKFAULT_STACK 1
20 #define DOUBLEFAULT_STACK 2
24 #define N_EXCEPTION_STACKS 5 /* hw limit: 7 */
26 #define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT)
27 #define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1))
29 #define __PAGE_OFFSET _AC(0xffff810000000000, UL)
31 #define __PHYSICAL_START CONFIG_PHYSICAL_START
32 #define __KERNEL_ALIGN 0x200000
35 * Make sure kernel is aligned to 2MB address. Catching it at compile
36 * time is better. Change your config file and compile the kernel
37 * for a 2MB aligned address (CONFIG_PHYSICAL_START)
39 #if (CONFIG_PHYSICAL_START % __KERNEL_ALIGN) != 0
40 #error "CONFIG_PHYSICAL_START must be a multiple of 2MB"
43 #define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
44 #define __START_KERNEL_map _AC(0xffffffff80000000, UL)
46 /* See Documentation/x86_64/mm.txt for a description of the memory map. */
47 #define __PHYSICAL_MASK_SHIFT 46
48 #define __VIRTUAL_MASK_SHIFT 48
51 * Kernel image size is limited to 512 MB (see level2_kernel_pgt in
52 * arch/x86/kernel/head_64.S), and it is mapped here:
54 #define KERNEL_IMAGE_SIZE (512 * 1024 * 1024)
55 #define KERNEL_IMAGE_START _AC(0xffffffff80000000, UL)
58 void clear_page(void *page);
59 void copy_page(void *to, void *from);
61 extern unsigned long end_pfn;
62 extern unsigned long phys_base;
64 extern unsigned long __phys_addr(unsigned long);
65 #define __phys_reloc_hide(x) (x)
68 * These are used to make use of C type-checking..
70 typedef unsigned long pteval_t;
71 typedef unsigned long pmdval_t;
72 typedef unsigned long pudval_t;
73 typedef unsigned long pgdval_t;
74 typedef unsigned long pgprotval_t;
75 typedef unsigned long phys_addr_t;
77 typedef struct page *pgtable_t;
79 typedef struct { pteval_t pte; } pte_t;
81 #define vmemmap ((struct page *)VMEMMAP_START)
83 extern unsigned long init_memory_mapping(unsigned long start,
86 #endif /* !__ASSEMBLY__ */
89 #define pfn_valid(pfn) ((pfn) < end_pfn)
93 #endif /* _X86_64_PAGE_H */