diff mbox

Call pagefault_disable/pagefault_enable in kmap_atomic/kunmap_atomic

Message ID 20100411163613.GA7365@hiauly1.hia.nrc.ca
State Accepted
Headers show

Commit Message

John David Anglin April 11, 2010, 4:36 p.m. UTC
diff mbox


diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h
index 7a73b61..ab87176 100644
--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -2,6 +2,7 @@ 
 #include <linux/mm.h>
+#include <linux/uaccess.h>
 /* The usual comment is "Caches aren't brain-dead on the <architecture>".
  * Unfortunately, that doesn't apply to PA-RISC. */
@@ -113,11 +114,20 @@  static inline void *kmap(struct page *page)
 #define kunmap(page)			kunmap_parisc(page_address(page))
-#define kmap_atomic(page, idx)		page_address(page)
+static inline void *kmap_atomic(struct page *page, enum km_type idx)
+	pagefault_disable();
+	return page_address(page);
-#define kunmap_atomic(addr, idx)	kunmap_parisc(addr)
+static inline void kunmap_atomic(void *addr, enum km_type idx)
+	kunmap_parisc(addr);
+	pagefault_enable();
-#define kmap_atomic_pfn(pfn, idx)	page_address(pfn_to_page(pfn))
+#define kmap_atomic_prot(page, idx, prot)	kmap_atomic(page, idx)
+#define kmap_atomic_pfn(pfn, idx)	kmap_atomic(pfn_to_page(pfn), (idx))
 #define kmap_atomic_to_page(ptr)	virt_to_page(ptr)