patch-2.3.46 linux/include/asm-mips/page.h
Next file: linux/include/asm-ppc/hardirq.h
Previous file: linux/include/asm-m68k/page.h
Back to the patch index
Back to the overall index
- Lines: 21
- Date:
Mon Feb 14 15:34:21 2000
- Orig file:
v2.3.45/linux/include/asm-mips/page.h
- Orig date:
Fri Jun 25 17:37:53 1999
diff -u --recursive --new-file v2.3.45/linux/include/asm-mips/page.h linux/include/asm-mips/page.h
@@ -65,6 +65,20 @@
#endif /* !defined (STRICT_MM_TYPECHECKS) */
+/* 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 /* _LANGUAGE_ASSEMBLY */
/* to align the pointer to the (next) page boundary */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)