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

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

diff -u --recursive --new-file v2.3.45/linux/include/asm-ia64/page.h linux/include/asm-ia64/page.h
@@ -127,6 +127,18 @@
 #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)
 #define PAGE_BUG(page) do { BUG(); } while (0)
 
+extern __inline__ int get_order(unsigned long size)
+{
+        double d = size - 1;
+	long order;
+                
+	__asm__ ("getf.exp %0=%1" : "=r"(order) : "f"(d));
+	order = order - PAGE_SHIFT - 0xffff + 1;
+	if (order < 0)
+		order = 0;
+	return order;
+}
+
 #endif /* !ASSEMBLY */
 
 #define PAGE_OFFSET		0xe000000000000000

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