1 #ifndef _ASM_X86_PAGE_32_H
2 #define _ASM_X86_PAGE_32_H
5 * This handles the memory map.
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.
11 * If you want more physical memory than this then see the CONFIG_HIGHMEM4G
12 * and CONFIG_HIGHMEM64G options in the kernel configuration.
14 #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
16 #ifdef CONFIG_4KSTACKS
17 #define THREAD_ORDER 0
19 #define THREAD_ORDER 1
21 #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
25 /* 44=32+12, the limit we can fit into an unsigned long pfn */
26 #define __PHYSICAL_MASK_SHIFT 44
27 #define __VIRTUAL_MASK_SHIFT 32
28 #define PAGETABLE_LEVELS 3
35 typedef u64 pgprotval_t;
36 typedef u64 phys_addr_t;
40 unsigned long pte_low, pte_high;
44 #endif /* __ASSEMBLY__
46 #else /* !CONFIG_X86_PAE */
47 #define __PHYSICAL_MASK_SHIFT 32
48 #define __VIRTUAL_MASK_SHIFT 32
49 #define PAGETABLE_LEVELS 2
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;
64 #endif /* __ASSEMBLY__ */
65 #endif /* CONFIG_X86_PAE */
68 typedef struct page *pgtable_t;
71 #ifdef CONFIG_HUGETLB_PAGE
72 #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
76 #define __phys_addr(x) ((x) - PAGE_OFFSET)
77 #define __phys_reloc_hide(x) RELOC_HIDE((x), 0)
80 #define pfn_valid(pfn) ((pfn) < max_mapnr)
81 #endif /* CONFIG_FLATMEM */
83 extern int nx_enabled;
86 * This much address space is reserved for vmalloc() and iomap()
87 * as well as fixmap mappings.
89 extern unsigned int __VMALLOC_RESERVE;
90 extern int sysctl_legacy_va_layout;
92 #define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE)
93 #define MAXMEM (-__PAGE_OFFSET - __VMALLOC_RESERVE)
95 extern void find_low_pfn_range(void);
96 extern unsigned long init_memory_mapping(unsigned long start,
98 extern void initmem_init(unsigned long, unsigned long);
99 extern void setup_bootmem_allocator(void);
102 #ifdef CONFIG_X86_USE_3DNOW
105 static inline void clear_page(void *page)
107 mmx_clear_page(page);
110 static inline void copy_page(void *to, void *from)
112 mmx_copy_page(to, from);
114 #else /* !CONFIG_X86_USE_3DNOW */
115 #include <linux/string.h>
117 static inline void clear_page(void *page)
119 memset(page, 0, PAGE_SIZE);
122 static inline void copy_page(void *to, void *from)
124 memcpy(to, from, PAGE_SIZE);
126 #endif /* CONFIG_X86_3DNOW */
127 #endif /* !__ASSEMBLY__ */
129 #endif /* _ASM_X86_PAGE_32_H */