patch-2.3.46 linux/include/asm-arm/page.h

Next file: linux/include/asm-i386/floppy.h
Previous file: linux/include/asm-alpha/page.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.45/linux/include/asm-arm/page.h linux/include/asm-arm/page.h
@@ -65,6 +65,20 @@
 #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>

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)