patch-2.3.46 linux/include/asm-i386/page.h
Next file: linux/include/asm-i386/pgtable.h
Previous file: linux/include/asm-i386/floppy.h
Back to the patch index
Back to the overall index
- Lines: 21
- Date:
Wed Feb 16 12:54:41 2000
- Orig file:
v2.3.45/linux/include/asm-i386/page.h
- Orig date:
Thu Feb 10 17:11:20 2000
diff -u --recursive --new-file v2.3.45/linux/include/asm-i386/page.h linux/include/asm-i386/page.h
@@ -94,6 +94,20 @@
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 /* __ASSEMBLY__ */
#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)