From 482368b1a8e45430672c58c9a42e7d2004367126 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 24 Feb 2000 00:12:35 +0000 Subject: Merge with 2.3.47. Guys, this is buggy as shit. You've been warned. --- include/asm-sh/page.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/asm-sh/page.h') diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 867c07122..24a374d4b 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h @@ -76,6 +76,21 @@ extern int console_loglevel; #define PAGE_BUG(page) do { \ BUG(); \ } while (0) + +/* 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 #endif /* __KERNEL__ */ -- cgit v1.2.3