diff options
Diffstat (limited to 'include/linux/highmem.h')
| -rw-r--r-- | include/linux/highmem.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index ab2cc20e21a5..e3060ef85b6d 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _LINUX_HIGHMEM_H | 2 | #define _LINUX_HIGHMEM_H |
| 3 | 3 | ||
| 4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
| 5 | #include <linux/kernel.h> | ||
| 5 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
| 6 | #include <linux/uaccess.h> | 7 | #include <linux/uaccess.h> |
| 7 | 8 | ||
| @@ -17,11 +18,17 @@ static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page | |||
| 17 | static inline void flush_kernel_dcache_page(struct page *page) | 18 | static inline void flush_kernel_dcache_page(struct page *page) |
| 18 | { | 19 | { |
| 19 | } | 20 | } |
| 21 | static inline void flush_kernel_vmap_range(void *vaddr, int size) | ||
| 22 | { | ||
| 23 | } | ||
| 24 | static inline void invalidate_kernel_vmap_range(void *vaddr, int size) | ||
| 25 | { | ||
| 26 | } | ||
| 20 | #endif | 27 | #endif |
| 21 | 28 | ||
| 22 | #include <asm/kmap_types.h> | 29 | #include <asm/kmap_types.h> |
| 23 | 30 | ||
| 24 | #if defined(CONFIG_DEBUG_HIGHMEM) && defined(CONFIG_TRACE_IRQFLAGS_SUPPORT) | 31 | #ifdef CONFIG_DEBUG_HIGHMEM |
| 25 | 32 | ||
| 26 | void debug_kmap_atomic(enum km_type type); | 33 | void debug_kmap_atomic(enum km_type type); |
| 27 | 34 | ||
| @@ -66,7 +73,11 @@ static inline void *kmap_atomic(struct page *page, enum km_type idx) | |||
| 66 | } | 73 | } |
| 67 | #define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) | 74 | #define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) |
| 68 | 75 | ||
| 69 | #define kunmap_atomic(addr, idx) do { pagefault_enable(); } while (0) | 76 | static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx) |
| 77 | { | ||
| 78 | pagefault_enable(); | ||
| 79 | } | ||
| 80 | |||
| 70 | #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) | 81 | #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) |
| 71 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) | 82 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) |
| 72 | 83 | ||
| @@ -75,6 +86,13 @@ static inline void *kmap_atomic(struct page *page, enum km_type idx) | |||
| 75 | 86 | ||
| 76 | #endif /* CONFIG_HIGHMEM */ | 87 | #endif /* CONFIG_HIGHMEM */ |
| 77 | 88 | ||
| 89 | /* Prevent people trying to call kunmap_atomic() as if it were kunmap() */ | ||
| 90 | /* kunmap_atomic() should get the return value of kmap_atomic, not the page. */ | ||
| 91 | #define kunmap_atomic(addr, idx) do { \ | ||
| 92 | BUILD_BUG_ON(__same_type((addr), struct page *)); \ | ||
| 93 | kunmap_atomic_notypecheck((addr), (idx)); \ | ||
| 94 | } while (0) | ||
| 95 | |||
| 78 | /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ | 96 | /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ |
| 79 | #ifndef clear_user_highpage | 97 | #ifndef clear_user_highpage |
| 80 | static inline void clear_user_highpage(struct page *page, unsigned long vaddr) | 98 | static inline void clear_user_highpage(struct page *page, unsigned long vaddr) |
