9 #define PAGE_SIZE (1 << PAGE_SHIFT)
15 struct list_head list;
17 #define list_to_maps_list(list_head) \
18 container_of((list_head), struct maps_list, list)
20 #define BITRANGE(first, last) (((2ll << (last - first)) - 1) << first)
24 struct maps_list ml; /* List to mappings which point to this pfn */
26 unsigned long long pf; /* page frame entry from /proc/pid/pagemap */
31 #define tree_to_pageframe(tree_struct) \
32 container_of((tree_struct), struct pageframe, tree)
34 static inline int page_present(struct pageframe *p)
36 return !!(BITRANGE(63, 63) & p->pf);
39 static inline int page_swapped(struct pageframe *p)
41 return !!(BITRANGE(62, 62) & p->pf);
44 static inline int page_shift(struct pageframe *p)
46 return (BITRANGE(55, 60) & p->pf) >> 55;
49 static inline long int pfn(struct pageframe *p)
51 return (BITRANGE(0, 54) & p->pf);
54 static inline int swap_type(struct pageframe *p)
56 return (BITRANGE(0, 4) & p->pf);
59 static inline int swap_offset(struct pageframe *p)
61 return (BITRANGE(5, 54) & p->pf) >> 5;
65 struct list_head list;
67 /* Memory segment of a mapping */
72 long int pages_present;
73 long int pages_swapped;
75 /* Name of the mapping, such as library name or something else */
77 int pid; /* Process which address space the mapping belongs to */
78 int tid; /* thread id */
81 #define list_to_maps(list_head) \
82 container_of((list_head), struct maps, list)
86 struct list_head list;
91 long int pages_present;
92 long int pages_swapped;
96 #define PARSE_MAP_NAME 0x2
97 #define PARSE_PROCESS_NAME 0x4
98 #define PARSE_DUMP 0x8
99 #define PARSE_NOADD_TREE 0x10