diff options
author | Randy Dunlap <randy.dunlap@oracle.com> | 2008-01-30 07:31:09 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:09 -0500 |
commit | 6b4b05bd790389962e6fcfc862562e7fa239c9d2 (patch) | |
tree | 72d7cad6d4554f48be4b2705208078c5827214ad /include/asm-x86/page_32.h | |
parent | b23be399da88a5008b1db4db06f03146b25cdc52 (diff) |
x64/page.h: convert some macros to inlines
Convert clear_page/copy_page macros to inline functions for type-checking.
Andrew wants to extirpate these ugly macros. (Ingo too. Thomas as well.
Please send us more "kill ugly macros" patches! :-)
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/page_32.h')
-rw-r--r-- | include/asm-x86/page_32.h | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h index 80ecc66b6d86..c620c934e557 100644 --- a/include/asm-x86/page_32.h +++ b/include/asm-x86/page_32.h | |||
@@ -12,12 +12,21 @@ | |||
12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
13 | #ifndef __ASSEMBLY__ | 13 | #ifndef __ASSEMBLY__ |
14 | 14 | ||
15 | #include <linux/string.h> | ||
16 | |||
15 | #ifdef CONFIG_X86_USE_3DNOW | 17 | #ifdef CONFIG_X86_USE_3DNOW |
16 | 18 | ||
17 | #include <asm/mmx.h> | 19 | #include <asm/mmx.h> |
18 | 20 | ||
19 | #define clear_page(page) mmx_clear_page((void *)(page)) | 21 | static inline void clear_page(void *page) |
20 | #define copy_page(to,from) mmx_copy_page(to,from) | 22 | { |
23 | mmx_clear_page(page); | ||
24 | } | ||
25 | |||
26 | static inline void copy_page(void *to, void *from) | ||
27 | { | ||
28 | mmx_copy_page(to, from); | ||
29 | } | ||
21 | 30 | ||
22 | #else | 31 | #else |
23 | 32 | ||
@@ -26,13 +35,31 @@ | |||
26 | * Maybe the K6-III ? | 35 | * Maybe the K6-III ? |
27 | */ | 36 | */ |
28 | 37 | ||
29 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) | 38 | static inline void clear_page(void *page) |
30 | #define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) | 39 | { |
40 | memset(page, 0, PAGE_SIZE); | ||
41 | } | ||
42 | |||
43 | static inline void copy_page(void *to, void *from) | ||
44 | { | ||
45 | memcpy(to, from, PAGE_SIZE); | ||
46 | } | ||
31 | 47 | ||
32 | #endif | 48 | #endif |
33 | 49 | ||
34 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 50 | struct page; |
35 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 51 | |
52 | static void inline clear_user_page(void *page, unsigned long vaddr, | ||
53 | struct page *pg) | ||
54 | { | ||
55 | clear_page(page); | ||
56 | } | ||
57 | |||
58 | static void inline copy_user_page(void *to, void *from, unsigned long vaddr, | ||
59 | struct page *topage) | ||
60 | { | ||
61 | copy_page(to, from); | ||
62 | } | ||
36 | 63 | ||
37 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ | 64 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ |
38 | alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) | 65 | alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) |