diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-09-03 18:54:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:05:39 -0400 |
commit | fd4fd5aac1282825195c6816ed40a2a6d42db5bf (patch) | |
tree | 5908cf4c88a7c9d69ea7bdc1c354d51b6ff47f86 /include/asm-i386/page.h | |
parent | 28ae55c98e4d16eac9a05a8a259d7763ef3aeb18 (diff) |
[PATCH] mm: consolidate get_order
Someone mentioned that almost all the architectures used basically the same
implementation of get_order. This patch consolidates them into
asm-generic/page.h and includes that in the appropriate places. The
exceptions are ia64 and ppc which have their own (presumably optimised)
versions.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-i386/page.h')
-rw-r--r-- | include/asm-i386/page.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index 8d93f732d72d..10045fd82103 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h | |||
@@ -104,20 +104,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
104 | */ | 104 | */ |
105 | extern unsigned int __VMALLOC_RESERVE; | 105 | extern unsigned int __VMALLOC_RESERVE; |
106 | 106 | ||
107 | /* Pure 2^n version of get_order */ | ||
108 | static __inline__ int get_order(unsigned long size) | ||
109 | { | ||
110 | int order; | ||
111 | |||
112 | size = (size-1) >> (PAGE_SHIFT-1); | ||
113 | order = -1; | ||
114 | do { | ||
115 | size >>= 1; | ||
116 | order++; | ||
117 | } while (size); | ||
118 | return order; | ||
119 | } | ||
120 | |||
121 | extern int sysctl_legacy_va_layout; | 107 | extern int sysctl_legacy_va_layout; |
122 | 108 | ||
123 | extern int page_is_ram(unsigned long pagenr); | 109 | extern int page_is_ram(unsigned long pagenr); |
@@ -156,4 +142,6 @@ extern int page_is_ram(unsigned long pagenr); | |||
156 | 142 | ||
157 | #endif /* __KERNEL__ */ | 143 | #endif /* __KERNEL__ */ |
158 | 144 | ||
145 | #include <asm-generic/page.h> | ||
146 | |||
159 | #endif /* _I386_PAGE_H */ | 147 | #endif /* _I386_PAGE_H */ |