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-ppc64 | |
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-ppc64')
-rw-r--r-- | include/asm-ppc64/page.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h index a79a08df62bd..a15422bcf30d 100644 --- a/include/asm-ppc64/page.h +++ b/include/asm-ppc64/page.h | |||
@@ -172,20 +172,6 @@ typedef unsigned long pgprot_t; | |||
172 | 172 | ||
173 | #endif | 173 | #endif |
174 | 174 | ||
175 | /* Pure 2^n version of get_order */ | ||
176 | static inline int get_order(unsigned long size) | ||
177 | { | ||
178 | int order; | ||
179 | |||
180 | size = (size-1) >> (PAGE_SHIFT-1); | ||
181 | order = -1; | ||
182 | do { | ||
183 | size >>= 1; | ||
184 | order++; | ||
185 | } while (size); | ||
186 | return order; | ||
187 | } | ||
188 | |||
189 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) | 175 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) |
190 | 176 | ||
191 | extern int page_is_ram(unsigned long pfn); | 177 | extern int page_is_ram(unsigned long pfn); |
@@ -270,4 +256,7 @@ extern u64 ppc64_pft_size; /* Log 2 of page table size */ | |||
270 | VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64) | 256 | VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64) |
271 | 257 | ||
272 | #endif /* __KERNEL__ */ | 258 | #endif /* __KERNEL__ */ |
259 | |||
260 | #include <asm-generic/page.h> | ||
261 | |||
273 | #endif /* _PPC64_PAGE_H */ | 262 | #endif /* _PPC64_PAGE_H */ |