Commit | Line | Data |
---|---|---|
11b7c7dc JF |
1 | #ifndef _ASM_X86_PAGE_32_H |
2 | #define _ASM_X86_PAGE_32_H | |
3 | ||
4 | /* | |
5 | * This handles the memory map. | |
6 | * | |
7 | * A __PAGE_OFFSET of 0xC0000000 means that the kernel has | |
8 | * a virtual address space of one gigabyte, which limits the | |
9 | * amount of physical memory you can use to about 950MB. | |
10 | * | |
11 | * If you want more physical memory than this then see the CONFIG_HIGHMEM4G | |
12 | * and CONFIG_HIGHMEM64G options in the kernel configuration. | |
13 | */ | |
14 | #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL) | |
15 | ||
16 | #ifdef CONFIG_X86_PAE | |
17 | #define __PHYSICAL_MASK_SHIFT 36 | |
18 | #define __VIRTUAL_MASK_SHIFT 32 | |
19 | #define PAGETABLE_LEVELS 3 | |
1da177e4 | 20 | |
1da177e4 | 21 | #ifndef __ASSEMBLY__ |
11b7c7dc JF |
22 | typedef u64 pteval_t; |
23 | typedef u64 pmdval_t; | |
24 | typedef u64 pudval_t; | |
25 | typedef u64 pgdval_t; | |
26 | typedef u64 pgprotval_t; | |
27 | typedef u64 phys_addr_t; | |
1da177e4 | 28 | |
c8e5393a JF |
29 | typedef union { |
30 | struct { | |
31 | unsigned long pte_low, pte_high; | |
32 | }; | |
33 | pteval_t pte; | |
34 | } pte_t; | |
11b7c7dc | 35 | #endif /* __ASSEMBLY__ |
1da177e4 | 36 | */ |
11b7c7dc JF |
37 | #else /* !CONFIG_X86_PAE */ |
38 | #define __PHYSICAL_MASK_SHIFT 32 | |
39 | #define __VIRTUAL_MASK_SHIFT 32 | |
40 | #define PAGETABLE_LEVELS 2 | |
41 | ||
42 | #ifndef __ASSEMBLY__ | |
43 | typedef unsigned long pteval_t; | |
44 | typedef unsigned long pmdval_t; | |
45 | typedef unsigned long pudval_t; | |
46 | typedef unsigned long pgdval_t; | |
47 | typedef unsigned long pgprotval_t; | |
48 | typedef unsigned long phys_addr_t; | |
3dc494e8 | 49 | |
095d1c4e JP |
50 | typedef union { |
51 | pteval_t pte; | |
52 | pteval_t pte_low; | |
53 | } pte_t; | |
11b7c7dc | 54 | |
11b7c7dc JF |
55 | #endif /* __ASSEMBLY__ */ |
56 | #endif /* CONFIG_X86_PAE */ | |
57 | ||
3bf8f5a9 IM |
58 | #ifndef __ASSEMBLY__ |
59 | typedef struct page *pgtable_t; | |
60 | #endif | |
61 | ||
11b7c7dc JF |
62 | #ifdef CONFIG_HUGETLB_PAGE |
63 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA | |
64 | #endif | |
1da177e4 | 65 | |
1da177e4 | 66 | #ifndef __ASSEMBLY__ |
095d1c4e | 67 | #define __phys_addr(x) ((x) - PAGE_OFFSET) |
11b7c7dc JF |
68 | #define __phys_reloc_hide(x) RELOC_HIDE((x), 0) |
69 | ||
70 | #ifdef CONFIG_FLATMEM | |
71 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | |
72 | #endif /* CONFIG_FLATMEM */ | |
73 | ||
74 | extern int nx_enabled; | |
75 | ||
76 | /* | |
77 | * This much address space is reserved for vmalloc() and iomap() | |
78 | * as well as fixmap mappings. | |
79 | */ | |
80 | extern unsigned int __VMALLOC_RESERVE; | |
81 | extern int sysctl_legacy_va_layout; | |
11b7c7dc JF |
82 | |
83 | #define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE) | |
095d1c4e | 84 | #define MAXMEM (-__PAGE_OFFSET - __VMALLOC_RESERVE) |
1da177e4 | 85 | |
11b7c7dc JF |
86 | #ifdef CONFIG_X86_USE_3DNOW |
87 | #include <asm/mmx.h> | |
e6e5494c | 88 | |
11b7c7dc JF |
89 | static inline void clear_page(void *page) |
90 | { | |
91 | mmx_clear_page(page); | |
92 | } | |
1da177e4 | 93 | |
11b7c7dc JF |
94 | static inline void copy_page(void *to, void *from) |
95 | { | |
96 | mmx_copy_page(to, from); | |
97 | } | |
98 | #else /* !CONFIG_X86_USE_3DNOW */ | |
99 | #include <linux/string.h> | |
1da177e4 | 100 | |
11b7c7dc JF |
101 | static inline void clear_page(void *page) |
102 | { | |
103 | memset(page, 0, PAGE_SIZE); | |
104 | } | |
fd4fd5aa | 105 | |
11b7c7dc JF |
106 | static inline void copy_page(void *to, void *from) |
107 | { | |
108 | memcpy(to, from, PAGE_SIZE); | |
109 | } | |
110 | #endif /* CONFIG_X86_3DNOW */ | |
111 | #endif /* !__ASSEMBLY__ */ | |
cd469e0c | 112 | |
11b7c7dc | 113 | #endif /* _ASM_X86_PAGE_32_H */ |