summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/page.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
commit482368b1a8e45430672c58c9a42e7d2004367126 (patch)
treece2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /include/asm-arm/page.h
parente4d0251c6f56ab2e191afb70f80f382793e23f74 (diff)
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'include/asm-arm/page.h')
-rw-r--r--include/asm-arm/page.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h
index f46fadbb8..e33597ff6 100644
--- a/include/asm-arm/page.h
+++ b/include/asm-arm/page.h
@@ -65,6 +65,20 @@ extern void __bug(const char *file, int line, void *data);
#define BUG() __bug(__FILE__, __LINE__, NULL)
#define PAGE_BUG(page) __bug(__FILE__, __LINE__, page)
+/* Pure 2^n version of get_order */
+extern __inline__ int get_order(unsigned long size)
+{
+ int order;
+
+ size = (size-1) >> (PAGE_SHIFT-1);
+ order = -1;
+ do {
+ size >>= 1;
+ order++;
+ } while (size);
+ return order;
+}
+
#endif /* !__ASSEMBLY__ */
#include <asm/arch/memory.h>