diff options
author | John David Anglin <dave@hiauly1.hia.nrc.ca> | 2010-04-11 12:36:14 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@dreadnought.i.jkkm.org> | 2010-05-30 05:48:32 -0400 |
commit | 210501aa570fdaa8b06e56fd1c04f31f2d3f368b (patch) | |
tree | 50d0cf3f68713b2d7acb7a3763fff3c0f89aa682 /arch/parisc | |
parent | 9b437bca163c44d4ec6544241f29451675693cd6 (diff) |
parisc: Call pagefault_disable/pagefault_enable in kmap_atomic/kunmap_atomic
Based on the generic implementation of kmap_atomic and kunmap_atomic,
we should call pagefault_disable and pagefault_enable in our PA8000
implementation.
The define for kmap_atomic_prot was also missing, and I updated
kmap_atomic_pfn to use the generic implementation because of the
change to kmap_atomic.
I believe that this change is needed to fix the fork copy-on-write
bug.
Signed-off-by: John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/include/asm/cacheflush.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h index 477277739da5..4556d820128a 100644 --- a/arch/parisc/include/asm/cacheflush.h +++ b/arch/parisc/include/asm/cacheflush.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _PARISC_CACHEFLUSH_H | 2 | #define _PARISC_CACHEFLUSH_H |
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | #include <linux/uaccess.h> | ||
5 | 6 | ||
6 | /* The usual comment is "Caches aren't brain-dead on the <architecture>". | 7 | /* The usual comment is "Caches aren't brain-dead on the <architecture>". |
7 | * Unfortunately, that doesn't apply to PA-RISC. */ | 8 | * Unfortunately, that doesn't apply to PA-RISC. */ |
@@ -125,11 +126,20 @@ static inline void *kmap(struct page *page) | |||
125 | 126 | ||
126 | #define kunmap(page) kunmap_parisc(page_address(page)) | 127 | #define kunmap(page) kunmap_parisc(page_address(page)) |
127 | 128 | ||
128 | #define kmap_atomic(page, idx) page_address(page) | 129 | static inline void *kmap_atomic(struct page *page, enum km_type idx) |
130 | { | ||
131 | pagefault_disable(); | ||
132 | return page_address(page); | ||
133 | } | ||
129 | 134 | ||
130 | #define kunmap_atomic(addr, idx) kunmap_parisc(addr) | 135 | static inline void kunmap_atomic(void *addr, enum km_type idx) |
136 | { | ||
137 | kunmap_parisc(addr); | ||
138 | pagefault_enable(); | ||
139 | } | ||
131 | 140 | ||
132 | #define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn)) | 141 | #define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) |
142 | #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) | ||
133 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) | 143 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) |
134 | #endif | 144 | #endif |
135 | 145 | ||