aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/highmem.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/highmem.h')
-rw-r--r--include/linux/highmem.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index fd7d12daa94f..645d440807c2 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -3,11 +3,12 @@
3 3
4#include <linux/fs.h> 4#include <linux/fs.h>
5#include <linux/mm.h> 5#include <linux/mm.h>
6#include <linux/uaccess.h>
6 7
7#include <asm/cacheflush.h> 8#include <asm/cacheflush.h>
8 9
9#ifndef ARCH_HAS_FLUSH_ANON_PAGE 10#ifndef ARCH_HAS_FLUSH_ANON_PAGE
10static inline void flush_anon_page(struct page *page, unsigned long vmaddr) 11static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr)
11{ 12{
12} 13}
13#endif 14#endif
@@ -41,9 +42,10 @@ static inline void *kmap(struct page *page)
41 42
42#define kunmap(page) do { (void) (page); } while (0) 43#define kunmap(page) do { (void) (page); } while (0)
43 44
44#define kmap_atomic(page, idx) page_address(page) 45#define kmap_atomic(page, idx) \
45#define kunmap_atomic(addr, idx) do { } while (0) 46 ({ pagefault_disable(); page_address(page); })
46#define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn)) 47#define kunmap_atomic(addr, idx) do { pagefault_enable(); } while (0)
48#define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx))
47#define kmap_atomic_to_page(ptr) virt_to_page(ptr) 49#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
48#endif 50#endif
49 51
@@ -94,7 +96,10 @@ static inline void memclear_highpage_flush(struct page *page, unsigned int offse
94 kunmap_atomic(kaddr, KM_USER0); 96 kunmap_atomic(kaddr, KM_USER0);
95} 97}
96 98
97static inline void copy_user_highpage(struct page *to, struct page *from, unsigned long vaddr) 99#ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE
100
101static inline void copy_user_highpage(struct page *to, struct page *from,
102 unsigned long vaddr, struct vm_area_struct *vma)
98{ 103{
99 char *vfrom, *vto; 104 char *vfrom, *vto;
100 105
@@ -107,6 +112,8 @@ static inline void copy_user_highpage(struct page *to, struct page *from, unsign
107 smp_wmb(); 112 smp_wmb();
108} 113}
109 114
115#endif
116
110static inline void copy_highpage(struct page *to, struct page *from) 117static inline void copy_highpage(struct page *to, struct page *from)
111{ 118{
112 char *vfrom, *vto; 119 char *vfrom, *vto;