diff options
author | David Howells <dhowells@redhat.com> | 2006-12-08 05:37:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:28:51 -0500 |
commit | ef55d53caa055aedee13e77da82740987dd64f2d (patch) | |
tree | 243bbfca98e504401ea563d6c799ed23c12c08b8 /include/asm-powerpc/page_32.h | |
parent | 39d61db0edb34d60b83c5e0d62d0e906578cc707 (diff) |
[PATCH] LOG2: Provide ilog2() fallbacks for powerpc
Provide ilog2() fallbacks for powerpc for 32-bit numbers and 64-bit numbers on
ppc64.
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-powerpc/page_32.h')
-rw-r--r-- | include/asm-powerpc/page_32.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/include/asm-powerpc/page_32.h b/include/asm-powerpc/page_32.h index 2677bad70f40..07f6d3cf5e5a 100644 --- a/include/asm-powerpc/page_32.h +++ b/include/asm-powerpc/page_32.h | |||
@@ -26,15 +26,7 @@ extern void clear_pages(void *page, int order); | |||
26 | static inline void clear_page(void *page) { clear_pages(page, 0); } | 26 | static inline void clear_page(void *page) { clear_pages(page, 0); } |
27 | extern void copy_page(void *to, void *from); | 27 | extern void copy_page(void *to, void *from); |
28 | 28 | ||
29 | /* Pure 2^n version of get_order */ | 29 | #include <asm-generic/page.h> |
30 | extern __inline__ int get_order(unsigned long size) | ||
31 | { | ||
32 | int lz; | ||
33 | |||
34 | size = (size-1) >> PAGE_SHIFT; | ||
35 | asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size)); | ||
36 | return 32 - lz; | ||
37 | } | ||
38 | 30 | ||
39 | #endif /* __ASSEMBLY__ */ | 31 | #endif /* __ASSEMBLY__ */ |
40 | 32 | ||