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)
17 #define __PHYSICAL_MASK_SHIFT 36
18 #define __VIRTUAL_MASK_SHIFT 32
19 #define PAGETABLE_LEVELS 3
26 typedef u64 pgprotval_t;
27 typedef u64 phys_addr_t;
31 unsigned long pte_low, pte_high;
35 #endif /* __ASSEMBLY__
37 #else /* !CONFIG_X86_PAE */
38 #define __PHYSICAL_MASK_SHIFT 32
39 #define __VIRTUAL_MASK_SHIFT 32
40 #define PAGETABLE_LEVELS 2
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;
50 typedef union { pteval_t pte, pte_low; } pte_t;
51 typedef pte_t boot_pte_t;
53 #endif /* __ASSEMBLY__ */
54 #endif /* CONFIG_X86_PAE */
57 typedef struct page *pgtable_t;
60 #ifdef CONFIG_HUGETLB_PAGE
61 #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
65 #define __phys_addr(x) ((x)-PAGE_OFFSET)
66 #define __phys_reloc_hide(x) RELOC_HIDE((x), 0)
69 #define pfn_valid(pfn) ((pfn) < max_mapnr)
70 #endif /* CONFIG_FLATMEM */
72 extern int nx_enabled;
75 * This much address space is reserved for vmalloc() and iomap()
76 * as well as fixmap mappings.
78 extern unsigned int __VMALLOC_RESERVE;
79 extern int sysctl_legacy_va_layout;
81 #define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE)
82 #define MAXMEM (-__PAGE_OFFSET-__VMALLOC_RESERVE)
84 #ifdef CONFIG_X86_USE_3DNOW
87 static inline void clear_page(void *page)
92 static inline void copy_page(void *to, void *from)
94 mmx_copy_page(to, from);
96 #else /* !CONFIG_X86_USE_3DNOW */
97 #include <linux/string.h>
99 static inline void clear_page(void *page)
101 memset(page, 0, PAGE_SIZE);
104 static inline void copy_page(void *to, void *from)
106 memcpy(to, from, PAGE_SIZE);
108 #endif /* CONFIG_X86_3DNOW */
109 #endif /* !__ASSEMBLY__ */
111 #endif /* _ASM_X86_PAGE_32_H */