aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-30 07:34:03 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:34:03 -0500
commitace63e3743ae59fc0cce48450bd2e410776b4148 (patch)
tree77a1a67a8125ae447d36eff62915fb93dd2c88bc
parentf5a50ce1bf53a07cb7d0bab1a87e62cc4f34f0ab (diff)
x86: add kernel_map_pages() to 64-bit
needed for DEBUG_PAGEALLOC support and for unification. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/mm/pageattr_64.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c
index 4053832d4108..e1c860800ff1 100644
--- a/arch/x86/mm/pageattr_64.c
+++ b/arch/x86/mm/pageattr_64.c
@@ -260,3 +260,33 @@ void global_flush_tlb(void)
260 on_each_cpu(flush_kernel_map, NULL, 1, 1); 260 on_each_cpu(flush_kernel_map, NULL, 1, 1);
261} 261}
262EXPORT_SYMBOL(global_flush_tlb); 262EXPORT_SYMBOL(global_flush_tlb);
263
264#ifdef CONFIG_DEBUG_PAGEALLOC
265void kernel_map_pages(struct page *page, int numpages, int enable)
266{
267 if (PageHighMem(page))
268 return;
269 if (!enable) {
270 debug_check_no_locks_freed(page_address(page),
271 numpages * PAGE_SIZE);
272 }
273
274 /*
275 * If page allocator is not up yet then do not call c_p_a():
276 */
277 if (!debug_pagealloc_enabled)
278 return;
279
280 /*
281 * the return value is ignored - the calls cannot fail,
282 * large pages are disabled at boot time.
283 */
284 change_page_attr(page, numpages, enable ? PAGE_KERNEL : __pgprot(0));
285
286 /*
287 * we should perform an IPI and flush all tlbs,
288 * but that can deadlock->flush only current cpu.
289 */
290 __flush_tlb_all();
291}
292#endif