Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jk/spufs into...
[deliverable/linux.git] / arch / x86 / include / asm / page_64.h
CommitLineData
1965aae3
PA
1#ifndef _ASM_X86_PAGE_64_H
2#define _ASM_X86_PAGE_64_H
1da177e4 3
11b7c7dc
JF
4#define PAGETABLE_LEVELS 4
5
6#define THREAD_ORDER 1
7#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
b20a4615 8#define CURRENT_MASK (~(THREAD_SIZE - 1))
11b7c7dc
JF
9
10#define EXCEPTION_STACK_ORDER 0
11#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
12
13#define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
14#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
15
16#define IRQSTACK_ORDER 2
17#define IRQSTACKSIZE (PAGE_SIZE << IRQSTACK_ORDER)
18
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 */
25
fbff3c21
AK
26#define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT)
27#define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1))
28
a6523748
EH
29/*
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.
34 */
35#define __PAGE_OFFSET _AC(0xffff880000000000, UL)
11b7c7dc
JF
36
37#define __PHYSICAL_START CONFIG_PHYSICAL_START
38#define __KERNEL_ALIGN 0x200000
1da177e4 39
11b7c7dc
JF
40/*
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)
44 */
45#if (CONFIG_PHYSICAL_START % __KERNEL_ALIGN) != 0
46#error "CONFIG_PHYSICAL_START must be a multiple of 2MB"
47#endif
48
49#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
50#define __START_KERNEL_map _AC(0xffffffff80000000, UL)
51
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
55
88f3aec7 56/*
85eb69a1 57 * Kernel image size is limited to 512 MB (see level2_kernel_pgt in
88f3aec7
IM
58 * arch/x86/kernel/head_64.S), and it is mapped here:
59 */
b20a4615 60#define KERNEL_IMAGE_SIZE (512 * 1024 * 1024)
d4afe414 61#define KERNEL_IMAGE_START _AC(0xffffffff80000000, UL)
1da177e4 62
1da177e4 63#ifndef __ASSEMBLY__
11b7c7dc
JF
64void clear_page(void *page);
65void copy_page(void *to, void *from);
66
c987d12f
YL
67/* duplicated to the one in bootmem.h */
68extern unsigned long max_pfn;
11b7c7dc
JF
69extern unsigned long phys_base;
70
71extern unsigned long __phys_addr(unsigned long);
72#define __phys_reloc_hide(x) (x)
73
74/*
75 * These are used to make use of C type-checking..
76 */
77typedef unsigned long pteval_t;
78typedef unsigned long pmdval_t;
79typedef unsigned long pudval_t;
80typedef unsigned long pgdval_t;
81typedef unsigned long pgprotval_t;
11b7c7dc 82
2f569afd
MS
83typedef struct page *pgtable_t;
84
11b7c7dc 85typedef struct { pteval_t pte; } pte_t;
1da177e4 86
11b7c7dc 87#define vmemmap ((struct page *)VMEMMAP_START)
1da177e4 88
cc615032
AK
89extern unsigned long init_memory_mapping(unsigned long start,
90 unsigned long end);
91
1f75d7e3 92extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn);
a80495ec 93extern void free_initmem(void);
3a9e189d
JS
94
95extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
96extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
97
11b7c7dc 98#endif /* !__ASSEMBLY__ */
cd469e0c 99
83a5101b 100#ifdef CONFIG_FLATMEM
c987d12f 101#define pfn_valid(pfn) ((pfn) < max_pfn)
83a5101b
JF
102#endif
103
104
1965aae3 105#endif /* _ASM_X86_PAGE_64_H */
This page took 0.509524 seconds and 5 git commands to generate.