blob: 97f3e88aead4acbb7dcb5e3ac4cf2c9e03885e6a [file] [log] [blame]
Dave Hansen22a98352006-03-27 01:16:04 -08001#ifndef _LINUX_PFN_H_
2#define _LINUX_PFN_H_
3
Jeremy Fitzhardinge947d0492008-09-11 01:31:48 -07004#ifndef __ASSEMBLY__
5#include <linux/types.h>
6#endif
7
Dave Hansen22a98352006-03-27 01:16:04 -08008#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
9#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
10#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
Jeremy Fitzhardinge947d0492008-09-11 01:31:48 -070011#define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT)
Chen Gang8f235d12016-01-14 15:18:33 -080012#define PHYS_PFN(x) ((unsigned long)((x) >> PAGE_SHIFT))
Dave Hansen22a98352006-03-27 01:16:04 -080013
14#endif