lkml.org 
[lkml]   [2005]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] [12/48] Suspend2 2.1.9.8 for 2.6.12: 402-mtrr-remove-sysdev.patch
Date
From
diff -ruNp 403-debug-pagealloc-support.patch-old/arch/i386/mm/pageattr.c 403-debug-pagealloc-support.patch-new/arch/i386/mm/pageattr.c
--- 403-debug-pagealloc-support.patch-old/arch/i386/mm/pageattr.c 2005-06-20 11:46:43.000000000 +1000
+++ 403-debug-pagealloc-support.patch-new/arch/i386/mm/pageattr.c 2005-07-04 23:14:19.000000000 +1000
@@ -217,5 +217,46 @@ void kernel_map_pages(struct page *page,
}
#endif

+#ifdef CONFIG_SUSPEND2
+#ifdef CONFIG_DEBUG_PAGEALLOC
+static int page_is_kernel_mapped(struct page * page)
+{
+ pte_t *kpte;
+ unsigned long address;
+
+ if (PageHighMem(page))
+ return 0;
+
+ address = (unsigned long)page_address(page);
+
+ kpte = lookup_address(address);
+ if (!kpte)
+ return 0;
+
+ if (pte_same(*kpte, mk_pte(page, PAGE_KERNEL)))
+ return 1;
+
+ return 0;
+}
+
+int suspend_map_kernel_page(struct page * page, int enable)
+{
+ int is_already_mapped = page_is_kernel_mapped(page);
+
+ if (enable == is_already_mapped)
+ return 1;
+
+ kernel_map_pages(page, 1, enable);
+
+ return 0;
+}
+#else
+int suspend_map_kernel_page(struct page * page, int enable)
+{
+ return (enable == 1);
+}
+#endif
+#endif
+
EXPORT_SYMBOL(change_page_attr);
EXPORT_SYMBOL(global_flush_tlb);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-06 04:29    [W:0.613 / U:1.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site