diff options
-rw-r--r-- | arch/x86/mm/init_64.c | 12 | ||||
-rw-r--r-- | arch/x86/mm/pgtable.c | 14 | ||||
-rw-r--r-- | arch/x86/mm/pgtable_32.c | 14 | ||||
-rw-r--r-- | include/asm-x86/fixmap.h | 2 |
4 files changed, 17 insertions, 25 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 156e6d7b0e32..e5f531949857 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -213,18 +213,6 @@ void __init cleanup_highmap(void) | |||
213 | } | 213 | } |
214 | } | 214 | } |
215 | 215 | ||
216 | /* NOTE: this is meant to be run only at boot */ | ||
217 | void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot) | ||
218 | { | ||
219 | unsigned long address = __fix_to_virt(idx); | ||
220 | |||
221 | if (idx >= __end_of_fixed_addresses) { | ||
222 | printk(KERN_ERR "Invalid __set_fixmap\n"); | ||
223 | return; | ||
224 | } | ||
225 | set_pte_phys(address, phys, prot); | ||
226 | } | ||
227 | |||
228 | static unsigned long __initdata table_start; | 216 | static unsigned long __initdata table_start; |
229 | static unsigned long __meminitdata table_end; | 217 | static unsigned long __meminitdata table_end; |
230 | 218 | ||
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 50159764f694..3ebebe480b53 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -274,3 +274,17 @@ int ptep_clear_flush_young(struct vm_area_struct *vma, | |||
274 | 274 | ||
275 | return young; | 275 | return young; |
276 | } | 276 | } |
277 | |||
278 | int fixmaps_set; | ||
279 | |||
280 | void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags) | ||
281 | { | ||
282 | unsigned long address = __fix_to_virt(idx); | ||
283 | |||
284 | if (idx >= __end_of_fixed_addresses) { | ||
285 | BUG(); | ||
286 | return; | ||
287 | } | ||
288 | set_pte_pfn(address, phys >> PAGE_SHIFT, flags); | ||
289 | fixmaps_set++; | ||
290 | } | ||
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c index 369cf065b6a4..3f97c3c87288 100644 --- a/arch/x86/mm/pgtable_32.c +++ b/arch/x86/mm/pgtable_32.c | |||
@@ -145,18 +145,6 @@ static int fixmaps; | |||
145 | unsigned long __FIXADDR_TOP = 0xfffff000; | 145 | unsigned long __FIXADDR_TOP = 0xfffff000; |
146 | EXPORT_SYMBOL(__FIXADDR_TOP); | 146 | EXPORT_SYMBOL(__FIXADDR_TOP); |
147 | 147 | ||
148 | void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags) | ||
149 | { | ||
150 | unsigned long address = __fix_to_virt(idx); | ||
151 | |||
152 | if (idx >= __end_of_fixed_addresses) { | ||
153 | BUG(); | ||
154 | return; | ||
155 | } | ||
156 | set_pte_pfn(address, phys >> PAGE_SHIFT, flags); | ||
157 | fixmaps++; | ||
158 | } | ||
159 | |||
160 | /** | 148 | /** |
161 | * reserve_top_address - reserves a hole in the top of kernel address space | 149 | * reserve_top_address - reserves a hole in the top of kernel address space |
162 | * @reserve - size of hole to reserve | 150 | * @reserve - size of hole to reserve |
@@ -166,7 +154,7 @@ void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags) | |||
166 | */ | 154 | */ |
167 | void reserve_top_address(unsigned long reserve) | 155 | void reserve_top_address(unsigned long reserve) |
168 | { | 156 | { |
169 | BUG_ON(fixmaps > 0); | 157 | BUG_ON(fixmaps_set > 0); |
170 | printk(KERN_INFO "Reserving virtual address space above 0x%08x\n", | 158 | printk(KERN_INFO "Reserving virtual address space above 0x%08x\n", |
171 | (int)-reserve); | 159 | (int)-reserve); |
172 | __FIXADDR_TOP = -reserve - PAGE_SIZE; | 160 | __FIXADDR_TOP = -reserve - PAGE_SIZE; |
diff --git a/include/asm-x86/fixmap.h b/include/asm-x86/fixmap.h index 01b0f98f9929..934d6b49b530 100644 --- a/include/asm-x86/fixmap.h +++ b/include/asm-x86/fixmap.h | |||
@@ -7,6 +7,8 @@ | |||
7 | # include "fixmap_64.h" | 7 | # include "fixmap_64.h" |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | extern int fixmaps_set; | ||
11 | |||
10 | extern void __set_fixmap(enum fixed_addresses idx, | 12 | extern void __set_fixmap(enum fixed_addresses idx, |
11 | unsigned long phys, pgprot_t flags); | 13 | unsigned long phys, pgprot_t flags); |
12 | #define set_fixmap(idx, phys) \ | 14 | #define set_fixmap(idx, phys) \ |