patch-2.4.25 linux-2.4.25/include/asm-cris/page.h
Next file: linux-2.4.25/include/asm-cris/sync_serial.h
Previous file: linux-2.4.25/include/asm-cris/ipc.h
Back to the patch index
Back to the overall index
- Lines: 21
- Date:
2004-02-18 05:36:32.000000000 -0800
- Orig file:
linux-2.4.24/include/asm-cris/page.h
- Orig date:
2002-08-02 17:39:45.000000000 -0700
diff -urN linux-2.4.24/include/asm-cris/page.h linux-2.4.25/include/asm-cris/page.h
@@ -80,6 +80,20 @@
BUG(); \
} while (0)
+/* Pure 2^n version of get_order */
+static __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__ */
/* macros to convert between really physical and virtual addresses
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)