blob: 766ea16fbbbda730a9952a67d85c8cda954f62ef [file] [log] [blame]
Jeremy Fitzhardingefb355142009-02-08 18:50:52 -08001#ifndef _ASM_X86_PGTABLE_64_DEFS_H
2#define _ASM_X86_PGTABLE_64_DEFS_H
3
Jeremy Fitzhardinge54321d92009-02-11 10:20:05 -08004#ifndef __ASSEMBLY__
5#include <linux/types.h>
6
7/*
8 * These are used to make use of C type-checking..
9 */
10typedef unsigned long pteval_t;
11typedef unsigned long pmdval_t;
12typedef unsigned long pudval_t;
13typedef unsigned long pgdval_t;
14typedef unsigned long pgprotval_t;
15
16typedef struct { pteval_t pte; } pte_t;
17
18#endif /* !__ASSEMBLY__ */
19
Jeremy Fitzhardingefb355142009-02-08 18:50:52 -080020#define SHARED_KERNEL_PMD 0
Jeremy Fitzhardinge9b3651c2009-02-13 11:01:54 -080021#define PAGETABLE_LEVELS 4
Jeremy Fitzhardingefb355142009-02-08 18:50:52 -080022
23/*
24 * PGDIR_SHIFT determines what a top-level page table entry can map
25 */
26#define PGDIR_SHIFT 39
27#define PTRS_PER_PGD 512
28
29/*
30 * 3rd level page
31 */
32#define PUD_SHIFT 30
33#define PTRS_PER_PUD 512
34
35/*
36 * PMD_SHIFT determines the size of the area a middle-level
37 * page table can map
38 */
39#define PMD_SHIFT 21
40#define PTRS_PER_PMD 512
41
42/*
43 * entries per page directory level
44 */
45#define PTRS_PER_PTE 512
46
47#define PMD_SIZE (_AC(1, UL) << PMD_SHIFT)
48#define PMD_MASK (~(PMD_SIZE - 1))
49#define PUD_SIZE (_AC(1, UL) << PUD_SHIFT)
50#define PUD_MASK (~(PUD_SIZE - 1))
51#define PGDIR_SIZE (_AC(1, UL) << PGDIR_SHIFT)
52#define PGDIR_MASK (~(PGDIR_SIZE - 1))
53
Rik van Rielc898faf2009-05-05 17:28:56 -040054/* See Documentation/x86/x86_64/mm.txt for a description of the memory map. */
Jeremy Fitzhardingefb355142009-02-08 18:50:52 -080055#define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL)
Rik van Rielc898faf2009-05-05 17:28:56 -040056#define VMALLOC_START _AC(0xffffc90000000000, UL)
57#define VMALLOC_END _AC(0xffffe8ffffffffff, UL)
58#define VMEMMAP_START _AC(0xffffea0000000000, UL)
Jeremy Fitzhardingefb355142009-02-08 18:50:52 -080059#define MODULES_VADDR _AC(0xffffffffa0000000, UL)
60#define MODULES_END _AC(0xffffffffff000000, UL)
61#define MODULES_LEN (MODULES_END - MODULES_VADDR)
62
63#endif /* _ASM_X86_PGTABLE_64_DEFS_H */