diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-01-30 07:32:44 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:44 -0500 |
commit | 11b7c7dc945b8802c459baa3304c1b501d2bf872 (patch) | |
tree | e07b1dbc96584362eabcca91f43177e15e0a1ced /include/asm-x86/page_32.h | |
parent | e62f4473f32a882a537b32cb7202da8d5d7c4f1f (diff) |
x86: page.h: move things back to their own files
# HG changeset patch
# User Jeremy Fitzhardinge <jeremy@xensource.com>
# Date 1199321648 28800
# Node ID 22f6a5902285b58bfc1fbbd9e183498c9017bd78
# Parent bba9287641ff90e836d090d80b5c0a846aab7162
x86: page.h: move things back to their own files
Oops, asm/page.h has turned into an #ifdef hellhole. Move
32/64-specific things back to their own headers to make it somewhat
comprehensible...
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/page_32.h')
-rw-r--r-- | include/asm-x86/page_32.h | 121 |
1 files changed, 111 insertions, 10 deletions
diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h index c27b41fd0254..e424bef4395a 100644 --- a/include/asm-x86/page_32.h +++ b/include/asm-x86/page_32.h | |||
@@ -1,23 +1,124 @@ | |||
1 | #ifndef _I386_PAGE_H | 1 | #ifndef _ASM_X86_PAGE_32_H |
2 | #define _I386_PAGE_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 | ||
3 | 20 | ||
4 | #ifdef __KERNEL__ | ||
5 | #ifndef __ASSEMBLY__ | 21 | #ifndef __ASSEMBLY__ |
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; | ||
6 | 28 | ||
7 | /* | 29 | typedef struct { unsigned long pte_low, pte_high; } pte_t; |
8 | * These are used to make use of C type-checking.. | 30 | |
31 | static inline unsigned long long native_pte_val(pte_t pte) | ||
32 | { | ||
33 | return pte.pte_low | ((unsigned long long)pte.pte_high << 32); | ||
34 | } | ||
35 | |||
36 | static inline pte_t native_make_pte(unsigned long long val) | ||
37 | { | ||
38 | return (pte_t) { .pte_low = val, .pte_high = (val >> 32) } ; | ||
39 | } | ||
40 | |||
41 | #endif /* __ASSEMBLY__ | ||
9 | */ | 42 | */ |
43 | #else /* !CONFIG_X86_PAE */ | ||
44 | #define __PHYSICAL_MASK_SHIFT 32 | ||
45 | #define __VIRTUAL_MASK_SHIFT 32 | ||
46 | #define PAGETABLE_LEVELS 2 | ||
47 | |||
48 | #ifndef __ASSEMBLY__ | ||
49 | typedef unsigned long pteval_t; | ||
50 | typedef unsigned long pmdval_t; | ||
51 | typedef unsigned long pudval_t; | ||
52 | typedef unsigned long pgdval_t; | ||
53 | typedef unsigned long pgprotval_t; | ||
54 | typedef unsigned long phys_addr_t; | ||
10 | 55 | ||
11 | #endif /* !__ASSEMBLY__ */ | 56 | typedef struct { pteval_t pte_low; } pte_t; |
57 | typedef pte_t boot_pte_t; | ||
58 | |||
59 | static inline unsigned long native_pte_val(pte_t pte) | ||
60 | { | ||
61 | return pte.pte_low; | ||
62 | } | ||
63 | |||
64 | static inline pte_t native_make_pte(unsigned long val) | ||
65 | { | ||
66 | return (pte_t) { .pte_low = val }; | ||
67 | } | ||
68 | |||
69 | #endif /* __ASSEMBLY__ */ | ||
70 | #endif /* CONFIG_X86_PAE */ | ||
71 | |||
72 | #ifdef CONFIG_HUGETLB_PAGE | ||
73 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA | ||
74 | #endif | ||
12 | 75 | ||
13 | #ifndef __ASSEMBLY__ | 76 | #ifndef __ASSEMBLY__ |
77 | #define __phys_addr(x) ((x)-PAGE_OFFSET) | ||
78 | #define __phys_reloc_hide(x) RELOC_HIDE((x), 0) | ||
79 | |||
80 | #ifdef CONFIG_FLATMEM | ||
81 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | ||
82 | #endif /* CONFIG_FLATMEM */ | ||
83 | |||
84 | extern int nx_enabled; | ||
85 | |||
86 | /* | ||
87 | * This much address space is reserved for vmalloc() and iomap() | ||
88 | * as well as fixmap mappings. | ||
89 | */ | ||
90 | extern unsigned int __VMALLOC_RESERVE; | ||
91 | extern int sysctl_legacy_va_layout; | ||
92 | extern int page_is_ram(unsigned long pagenr); | ||
93 | |||
94 | #define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE) | ||
95 | #define MAXMEM (-__PAGE_OFFSET-__VMALLOC_RESERVE) | ||
14 | 96 | ||
15 | struct vm_area_struct; | 97 | #ifdef CONFIG_X86_USE_3DNOW |
98 | #include <asm/mmx.h> | ||
16 | 99 | ||
17 | #endif /* __ASSEMBLY__ */ | 100 | static inline void clear_page(void *page) |
101 | { | ||
102 | mmx_clear_page(page); | ||
103 | } | ||
18 | 104 | ||
105 | static inline void copy_page(void *to, void *from) | ||
106 | { | ||
107 | mmx_copy_page(to, from); | ||
108 | } | ||
109 | #else /* !CONFIG_X86_USE_3DNOW */ | ||
110 | #include <linux/string.h> | ||
19 | 111 | ||
112 | static inline void clear_page(void *page) | ||
113 | { | ||
114 | memset(page, 0, PAGE_SIZE); | ||
115 | } | ||
20 | 116 | ||
21 | #endif /* __KERNEL__ */ | 117 | static inline void copy_page(void *to, void *from) |
118 | { | ||
119 | memcpy(to, from, PAGE_SIZE); | ||
120 | } | ||
121 | #endif /* CONFIG_X86_3DNOW */ | ||
122 | #endif /* !__ASSEMBLY__ */ | ||
22 | 123 | ||
23 | #endif /* _I386_PAGE_H */ | 124 | #endif /* _ASM_X86_PAGE_32_H */ |