diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-10-31 11:08:35 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-11-27 18:53:47 -0500 |
commit | 063b0a4207e43acbeff3d4b09f43e750e0212b48 (patch) | |
tree | eb2a2c1faa732c763102040478830111fc13f2a5 /arch/arm/include/asm/page.h | |
parent | d73e60b7144a86baf0fdfcc9537a70bb4f72e11c (diff) |
[ARM] copypage: provide our own copy_user_highpage()
We used to override the copy_user_page() function. However, this
is not only inefficient, it also causes additional complexity for
highmem support, since we convert from a struct page to a kernel
direct mapped address and back to a struct page again.
Moreover, with highmem support, we end up pointlessly setting up
kmap entries for pages which we're going to remap. So, push the
kmapping down into the copypage implementation files where it's
required.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include/asm/page.h')
-rw-r--r-- | arch/arm/include/asm/page.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h index bed1c0a00368..1581b8cf8f33 100644 --- a/arch/arm/include/asm/page.h +++ b/arch/arm/include/asm/page.h | |||
@@ -108,30 +108,35 @@ | |||
108 | #error Unknown user operations model | 108 | #error Unknown user operations model |
109 | #endif | 109 | #endif |
110 | 110 | ||
111 | struct page; | ||
112 | |||
111 | struct cpu_user_fns { | 113 | struct cpu_user_fns { |
112 | void (*cpu_clear_user_page)(void *p, unsigned long user); | 114 | void (*cpu_clear_user_page)(void *p, unsigned long user); |
113 | void (*cpu_copy_user_page)(void *to, const void *from, | 115 | void (*cpu_copy_user_highpage)(struct page *to, struct page *from, |
114 | unsigned long user); | 116 | unsigned long vaddr); |
115 | }; | 117 | }; |
116 | 118 | ||
117 | #ifdef MULTI_USER | 119 | #ifdef MULTI_USER |
118 | extern struct cpu_user_fns cpu_user; | 120 | extern struct cpu_user_fns cpu_user; |
119 | 121 | ||
120 | #define __cpu_clear_user_page cpu_user.cpu_clear_user_page | 122 | #define __cpu_clear_user_page cpu_user.cpu_clear_user_page |
121 | #define __cpu_copy_user_page cpu_user.cpu_copy_user_page | 123 | #define __cpu_copy_user_highpage cpu_user.cpu_copy_user_highpage |
122 | 124 | ||
123 | #else | 125 | #else |
124 | 126 | ||
125 | #define __cpu_clear_user_page __glue(_USER,_clear_user_page) | 127 | #define __cpu_clear_user_page __glue(_USER,_clear_user_page) |
126 | #define __cpu_copy_user_page __glue(_USER,_copy_user_page) | 128 | #define __cpu_copy_user_highpage __glue(_USER,_copy_user_highpage) |
127 | 129 | ||
128 | extern void __cpu_clear_user_page(void *p, unsigned long user); | 130 | extern void __cpu_clear_user_page(void *p, unsigned long user); |
129 | extern void __cpu_copy_user_page(void *to, const void *from, | 131 | extern void __cpu_copy_user_highpage(struct page *to, struct page *from, |
130 | unsigned long user); | 132 | unsigned long vaddr); |
131 | #endif | 133 | #endif |
132 | 134 | ||
133 | #define clear_user_page(addr,vaddr,pg) __cpu_clear_user_page(addr, vaddr) | 135 | #define clear_user_page(addr,vaddr,pg) __cpu_clear_user_page(addr, vaddr) |
134 | #define copy_user_page(to,from,vaddr,pg) __cpu_copy_user_page(to, from, vaddr) | 136 | |
137 | #define __HAVE_ARCH_COPY_USER_HIGHPAGE | ||
138 | #define copy_user_highpage(to,from,vaddr,vma) \ | ||
139 | __cpu_copy_user_highpage(to, from, vaddr) | ||
135 | 140 | ||
136 | #define clear_page(page) memzero((void *)(page), PAGE_SIZE) | 141 | #define clear_page(page) memzero((void *)(page), PAGE_SIZE) |
137 | extern void copy_page(void *to, const void *from); | 142 | extern void copy_page(void *to, const void *from); |