x86: refactor x86_quirks support
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / x86 / include / asm / page_64_types.h
blobbc73af3eda9ceaf6dc7a0f5a0d759c061e8c1c2a
1 #ifndef _ASM_X86_PAGE_64_DEFS_H
2 #define _ASM_X86_PAGE_64_DEFS_H
4 #define PAGETABLE_LEVELS 4
6 #define THREAD_ORDER 1
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 IRQ_STACK_ORDER 2
17 #define IRQ_STACK_SIZE (PAGE_SIZE << IRQ_STACK_ORDER)
19 #define STACKFAULT_STACK 1
20 #define DOUBLEFAULT_STACK 2
21 #define NMI_STACK 3
22 #define DEBUG_STACK 4
23 #define MCE_STACK 5
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))
30 * Set __PAGE_OFFSET to the most negative possible address +
31 * PGDIR_SIZE*16 (pgd slot 272). The gap is to allow a space for a
32 * hypervisor to fit. Choosing 16 slots here is arbitrary, but it's
33 * what Xen requires.
35 #define __PAGE_OFFSET _AC(0xffff880000000000, UL)
37 #define __PHYSICAL_START CONFIG_PHYSICAL_START
38 #define __KERNEL_ALIGN 0x200000
41 * Make sure kernel is aligned to 2MB address. Catching it at compile
42 * time is better. Change your config file and compile the kernel
43 * for a 2MB aligned address (CONFIG_PHYSICAL_START)
45 #if (CONFIG_PHYSICAL_START % __KERNEL_ALIGN) != 0
46 #error "CONFIG_PHYSICAL_START must be a multiple of 2MB"
47 #endif
49 #define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
50 #define __START_KERNEL_map _AC(0xffffffff80000000, UL)
52 /* See Documentation/x86_64/mm.txt for a description of the memory map. */
53 #define __PHYSICAL_MASK_SHIFT 46
54 #define __VIRTUAL_MASK_SHIFT 48
57 * Kernel image size is limited to 512 MB (see level2_kernel_pgt in
58 * arch/x86/kernel/head_64.S), and it is mapped here:
60 #define KERNEL_IMAGE_SIZE (512 * 1024 * 1024)
61 #define KERNEL_IMAGE_START _AC(0xffffffff80000000, UL)
63 #ifndef __ASSEMBLY__
64 void clear_page(void *page);
65 void copy_page(void *to, void *from);
67 /* duplicated to the one in bootmem.h */
68 extern unsigned long max_pfn;
69 extern unsigned long phys_base;
71 extern unsigned long __phys_addr(unsigned long);
72 #define __phys_reloc_hide(x) (x)
74 #define vmemmap ((struct page *)VMEMMAP_START)
76 extern unsigned long init_memory_mapping(unsigned long start,
77 unsigned long end);
79 extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn);
80 extern void free_initmem(void);
82 extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
83 extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
85 #endif /* !__ASSEMBLY__ */
87 #ifdef CONFIG_FLATMEM
88 #define pfn_valid(pfn) ((pfn) < max_pfn)
89 #endif
91 #endif /* _ASM_X86_PAGE_64_DEFS_H */