pfn.h 385 B

1234567891011121314
  1. #ifndef _LINUX_PFN_H_
  2. #define _LINUX_PFN_H_
  3. #ifndef __ASSEMBLY__
  4. #include <linux/types.h>
  5. #endif
  6. #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
  7. #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
  8. #define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
  9. #define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT)
  10. #define PHYS_PFN(x) ((unsigned long)((x) >> PAGE_SHIFT))
  11. #endif