diff options
Diffstat (limited to 'include/linux/memblock.h')
-rw-r--r-- | include/linux/memblock.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 5096458c7535..62a10c2a11f2 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -111,40 +111,39 @@ extern void memblock_set_current_limit(phys_addr_t limit); | |||
111 | */ | 111 | */ |
112 | 112 | ||
113 | /** | 113 | /** |
114 | * memblock_region_base_pfn - Return the lowest pfn intersecting with the region | 114 | * memblock_region_memory_base_pfn - Return the lowest pfn intersecting with the memory region |
115 | * @reg: memblock_region structure | 115 | * @reg: memblock_region structure |
116 | */ | 116 | */ |
117 | static inline unsigned long memblock_region_base_pfn(const struct memblock_region *reg) | 117 | static inline unsigned long memblock_region_memory_base_pfn(const struct memblock_region *reg) |
118 | { | 118 | { |
119 | return reg->base >> PAGE_SHIFT; | 119 | return PFN_UP(reg->base); |
120 | } | 120 | } |
121 | 121 | ||
122 | /** | 122 | /** |
123 | * memblock_region_last_pfn - Return the highest pfn intersecting with the region | 123 | * memblock_region_memory_end_pfn - Return the end_pfn this region |
124 | * @reg: memblock_region structure | 124 | * @reg: memblock_region structure |
125 | */ | 125 | */ |
126 | static inline unsigned long memblock_region_last_pfn(const struct memblock_region *reg) | 126 | static inline unsigned long memblock_region_memory_end_pfn(const struct memblock_region *reg) |
127 | { | 127 | { |
128 | return (reg->base + reg->size - 1) >> PAGE_SHIFT; | 128 | return PFN_DOWN(reg->base + reg->size); |
129 | } | 129 | } |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * memblock_region_end_pfn - Return the pfn of the first page following the region | 132 | * memblock_region_reserved_base_pfn - Return the lowest pfn intersecting with the reserved region |
133 | * but not intersecting it | ||
134 | * @reg: memblock_region structure | 133 | * @reg: memblock_region structure |
135 | */ | 134 | */ |
136 | static inline unsigned long memblock_region_end_pfn(const struct memblock_region *reg) | 135 | static inline unsigned long memblock_region_reserved_base_pfn(const struct memblock_region *reg) |
137 | { | 136 | { |
138 | return memblock_region_last_pfn(reg) + 1; | 137 | return PFN_DOWN(reg->base); |
139 | } | 138 | } |
140 | 139 | ||
141 | /** | 140 | /** |
142 | * memblock_region_pages - Return the number of pages covering a region | 141 | * memblock_region_reserved_end_pfn - Return the end_pfn this region |
143 | * @reg: memblock_region structure | 142 | * @reg: memblock_region structure |
144 | */ | 143 | */ |
145 | static inline unsigned long memblock_region_pages(const struct memblock_region *reg) | 144 | static inline unsigned long memblock_region_reserved_end_pfn(const struct memblock_region *reg) |
146 | { | 145 | { |
147 | return memblock_region_end_pfn(reg) - memblock_region_end_pfn(reg); | 146 | return PFN_UP(reg->base + reg->size); |
148 | } | 147 | } |
149 | 148 | ||
150 | #define for_each_memblock(memblock_type, region) \ | 149 | #define for_each_memblock(memblock_type, region) \ |