1 #ifndef _LINUX_HIGHMEM_H
2 #define _LINUX_HIGHMEM_H
5 #include <linux/kernel.h>
11 #include <asm/cacheflush.h>
13 #ifndef ARCH_HAS_FLUSH_ANON_PAGE
19 #ifndef ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
20 static inline void flush_kernel_dcache_page(
struct page *
page)
23 static inline void flush_kernel_vmap_range(
void *
vaddr,
int size)
26 static inline void invalidate_kernel_vmap_range(
void *
vaddr,
int size)
31 #include <asm/kmap_types.h>
34 #include <asm/highmem.h>
37 unsigned int nr_free_highpages(
void);
42 struct page *kmap_to_page(
void *
addr);
46 static inline unsigned int nr_free_highpages(
void) {
return 0; }
48 static inline struct page *kmap_to_page(
void *
addr)
53 #define totalhigh_pages 0UL
71 #define kmap_atomic_prot(page, prot) kmap_atomic(page)
78 #define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn))
79 #define kmap_atomic_to_page(ptr) virt_to_page(ptr)
81 #define kmap_flush_unused() do {} while(0)
86 #if defined(CONFIG_HIGHMEM) || defined(CONFIG_X86_32)
90 static inline int kmap_atomic_idx_push(
void)
94 #ifdef CONFIG_DEBUG_HIGHMEM
101 static inline int kmap_atomic_idx(
void)
106 static inline void kmap_atomic_idx_pop(
void)
108 #ifdef CONFIG_DEBUG_HIGHMEM
123 #define kunmap_atomic(addr) \
125 BUILD_BUG_ON(__same_type((addr), struct page *)); \
126 __kunmap_atomic(addr); \
131 #ifndef clear_user_highpage
140 #ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
155 static inline struct page *
178 static inline struct page *
185 static inline void clear_highpage(
struct page *page)
192 static inline void zero_user_segments(
struct page *page,
193 unsigned start1,
unsigned end1,
194 unsigned start2,
unsigned end2)
201 memset(kaddr + start1, 0, end1 - start1);
204 memset(kaddr + start2, 0, end2 - start2);
210 static inline void zero_user_segment(
struct page *page,
213 zero_user_segments(page, start, end, 0, 0);
216 static inline void zero_user(
struct page *page,
219 zero_user_segments(page, start, start + size, 0, 0);
222 static inline void __deprecated memclear_highpage_flush(
struct page *page,
225 zero_user(page, offset, size);
228 #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE
244 static inline void copy_highpage(
struct page *to,
struct page *
from)