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 | ||
b84200b3 CL |
16 | #ifdef CONFIG_4KSTACKS |
17 | #define THREAD_ORDER 0 | |
18 | #else | |
19 | #define THREAD_ORDER 1 | |
20 | #endif | |
21 | #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) | |
22 | ||
23 | ||
11b7c7dc | 24 | #ifdef CONFIG_X86_PAE |
ad524d46 JF |
25 | /* 44=32+12, the limit we can fit into an unsigned long pfn */ |
26 | #define __PHYSICAL_MASK_SHIFT 44 | |
11b7c7dc JF |
27 | #define __VIRTUAL_MASK_SHIFT 32 |
28 | #define PAGETABLE_LEVELS 3 | |
1da177e4 | 29 | |
1da177e4 | 30 | #ifndef __ASSEMBLY__ |
11b7c7dc JF |
31 | typedef u64 pteval_t; |
32 | typedef u64 pmdval_t; | |
33 | typedef u64 pudval_t; | |
34 | typedef u64 pgdval_t; | |
35 | typedef u64 pgprotval_t; | |
36 | typedef u64 phys_addr_t; | |
1da177e4 | 37 | |
c8e5393a JF |
38 | typedef union { |
39 | struct { | |
40 | unsigned long pte_low, pte_high; | |
41 | }; | |
42 | pteval_t pte; | |
43 | } pte_t; | |
11b7c7dc | 44 | #endif /* __ASSEMBLY__ |
1da177e4 | 45 | */ |
11b7c7dc JF |
46 | #else /* !CONFIG_X86_PAE */ |
47 | #define __PHYSICAL_MASK_SHIFT 32 | |
48 | #define __VIRTUAL_MASK_SHIFT 32 | |
49 | #define PAGETABLE_LEVELS 2 | |
50 | ||
51 | #ifndef __ASSEMBLY__ | |
52 | typedef unsigned long pteval_t; | |
53 | typedef unsigned long pmdval_t; | |
54 | typedef unsigned long pudval_t; | |
55 | typedef unsigned long pgdval_t; | |
56 | typedef unsigned long pgprotval_t; | |
57 | typedef unsigned long phys_addr_t; | |
3dc494e8 | 58 | |
095d1c4e JP |
59 | typedef union { |
60 | pteval_t pte; | |
61 | pteval_t pte_low; | |
62 | } pte_t; | |
11b7c7dc | 63 | |
11b7c7dc JF |
64 | #endif /* __ASSEMBLY__ */ |
65 | #endif /* CONFIG_X86_PAE */ | |
66 | ||
3bf8f5a9 IM |
67 | #ifndef __ASSEMBLY__ |
68 | typedef struct page *pgtable_t; | |
69 | #endif | |
70 | ||
11b7c7dc JF |
71 | #ifdef CONFIG_HUGETLB_PAGE |
72 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA | |
73 | #endif | |
1da177e4 | 74 | |
1da177e4 | 75 | #ifndef __ASSEMBLY__ |
095d1c4e | 76 | #define __phys_addr(x) ((x) - PAGE_OFFSET) |
11b7c7dc JF |
77 | #define __phys_reloc_hide(x) RELOC_HIDE((x), 0) |
78 | ||
79 | #ifdef CONFIG_FLATMEM | |
80 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | |
81 | #endif /* CONFIG_FLATMEM */ | |
82 | ||
83 | extern int nx_enabled; | |
84 | ||
85 | /* | |
86 | * This much address space is reserved for vmalloc() and iomap() | |
87 | * as well as fixmap mappings. | |
88 | */ | |
89 | extern unsigned int __VMALLOC_RESERVE; | |
90 | extern int sysctl_legacy_va_layout; | |
11b7c7dc JF |
91 | |
92 | #define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE) | |
095d1c4e | 93 | #define MAXMEM (-__PAGE_OFFSET - __VMALLOC_RESERVE) |
1da177e4 | 94 | |
b2ac82a0 YL |
95 | extern unsigned long initmem_init(unsigned long, unsigned long); |
96 | extern void zone_sizes_init(void); | |
97 | extern void setup_bootmem_allocator(void); | |
98 | ||
99 | ||
11b7c7dc JF |
100 | #ifdef CONFIG_X86_USE_3DNOW |
101 | #include <asm/mmx.h> | |
e6e5494c | 102 | |
11b7c7dc JF |
103 | static inline void clear_page(void *page) |
104 | { | |
105 | mmx_clear_page(page); | |
106 | } | |
1da177e4 | 107 | |
11b7c7dc JF |
108 | static inline void copy_page(void *to, void *from) |
109 | { | |
110 | mmx_copy_page(to, from); | |
111 | } | |
112 | #else /* !CONFIG_X86_USE_3DNOW */ | |
113 | #include <linux/string.h> | |
1da177e4 | 114 | |
11b7c7dc JF |
115 | static inline void clear_page(void *page) |
116 | { | |
117 | memset(page, 0, PAGE_SIZE); | |
118 | } | |
fd4fd5aa | 119 | |
11b7c7dc JF |
120 | static inline void copy_page(void *to, void *from) |
121 | { | |
122 | memcpy(to, from, PAGE_SIZE); | |
123 | } | |
124 | #endif /* CONFIG_X86_3DNOW */ | |
125 | #endif /* !__ASSEMBLY__ */ | |
cd469e0c | 126 | |
11b7c7dc | 127 | #endif /* _ASM_X86_PAGE_32_H */ |