]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/mm/pageattr.c
Hibernation: Handle DEBUG_PAGEALLOC on x86
[linux-2.6-omap-h63xx.git] / arch / x86 / mm / pageattr.c
index e2a74ea11a5309ec4e8181f26bb8b62271ec0d15..464d8fc21ce69b67d8d8bf057f5a57ef6a84c677 100644 (file)
@@ -899,7 +899,24 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
         */
        cpa_fill_pool();
 }
-#endif
+
+#ifdef CONFIG_HIBERNATION
+
+bool kernel_page_present(struct page *page)
+{
+       unsigned int level;
+       pte_t *pte;
+
+       if (PageHighMem(page))
+               return false;
+
+       pte = lookup_address((unsigned long)page_address(page), &level);
+       return (pte_val(*pte) & _PAGE_PRESENT);
+}
+
+#endif /* CONFIG_HIBERNATION */
+
+#endif /* CONFIG_DEBUG_PAGEALLOC */
 
 /*
  * The testcases use internal knowledge of the implementation that shouldn't