Commit | Line | Data |
---|---|---|
22a9835c DH |
1 | #ifndef _LINUX_PFN_H_ |
2 | #define _LINUX_PFN_H_ | |
3 | ||
947d0496 JF |
4 | #ifndef __ASSEMBLY__ |
5 | #include <linux/types.h> | |
34c0fd54 DW |
6 | |
7 | /* | |
8 | * pfn_t: encapsulates a page-frame number that is optionally backed | |
9 | * by memmap (struct page). Whether a pfn_t has a 'struct page' | |
10 | * backing is indicated by flags in the high bits of the value. | |
11 | */ | |
12 | typedef struct { | |
13 | unsigned long val; | |
14 | } pfn_t; | |
947d0496 JF |
15 | #endif |
16 | ||
22a9835c DH |
17 | #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) |
18 | #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) | |
19 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) | |
947d0496 | 20 | #define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT) |
8f235d1a | 21 | #define PHYS_PFN(x) ((unsigned long)((x) >> PAGE_SHIFT)) |
22a9835c DH |
22 | |
23 | #endif |