page.h 410 B

123456789101112131415161718192021222324
  1. #ifndef _ASM_GENERIC_PAGE_H
  2. #define _ASM_GENERIC_PAGE_H
  3. #ifndef __ASSEMBLY__
  4. #include <linux/compiler.h>
  5. /* Pure 2^n version of get_order */
  6. static __inline__ __attribute_const__ int get_order(unsigned long size)
  7. {
  8. int order;
  9. size = (size - 1) >> (PAGE_SHIFT - 1);
  10. order = -1;
  11. do {
  12. size >>= 1;
  13. order++;
  14. } while (size);
  15. return order;
  16. }
  17. #endif /* __ASSEMBLY__ */
  18. #endif /* _ASM_GENERIC_PAGE_H */