1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_PFN_H_
3 #define _LINUX_PFN_H_
4 
5 #ifndef __ASSEMBLY__
6 #include <linux/types.h>
7 #endif
8 
9 #define PFN_ALIGN(x)	(((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
10 #define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
11 #define PFN_DOWN(x)	((x) >> PAGE_SHIFT)
12 #define PFN_PHYS(x)	((phys_addr_t)(x) << PAGE_SHIFT)
13 #define PHYS_PFN(x)	((unsigned long)((x) >> PAGE_SHIFT))
14 
15 #endif
16