diff options
author | Yinghai Lu <yinghai@kernel.org> | 2010-08-25 16:39:14 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-08-27 14:07:56 -0400 |
commit | 7950c407c0288b223a200c1bba8198941599ca37 (patch) | |
tree | 4d7ad677fa918630cc29363c197d2593198727be /mm/memblock.c | |
parent | 5303b68f57c227c27193a14e57dd12be27cd670f (diff) |
memblock: Add memblock_free/reserve_reserved_regions()
So we can avoid export memblock_reserved_init_regions()
Suggested by Ben.
-v2: use __init_memblock attribute
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'mm/memblock.c')
-rw-r--r-- | mm/memblock.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index b7ab10a2ef46..65e3ba8d09fb 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -170,6 +170,30 @@ u64 __init_memblock memblock_find_in_range(u64 start, u64 end, u64 size, u64 ali | |||
170 | return memblock_find_base(size, align, start, end); | 170 | return memblock_find_base(size, align, start, end); |
171 | } | 171 | } |
172 | 172 | ||
173 | /* | ||
174 | * Free memblock.reserved.regions | ||
175 | */ | ||
176 | int __init_memblock memblock_free_reserved_regions(void) | ||
177 | { | ||
178 | if (memblock.reserved.regions == memblock_reserved_init_regions) | ||
179 | return 0; | ||
180 | |||
181 | return memblock_free(__pa(memblock.reserved.regions), | ||
182 | sizeof(struct memblock_region) * memblock.reserved.max); | ||
183 | } | ||
184 | |||
185 | /* | ||
186 | * Reserve memblock.reserved.regions | ||
187 | */ | ||
188 | int __init_memblock memblock_reserve_reserved_regions(void) | ||
189 | { | ||
190 | if (memblock.reserved.regions == memblock_reserved_init_regions) | ||
191 | return 0; | ||
192 | |||
193 | return memblock_reserve(__pa(memblock.reserved.regions), | ||
194 | sizeof(struct memblock_region) * memblock.reserved.max); | ||
195 | } | ||
196 | |||
173 | static void __init_memblock memblock_remove_region(struct memblock_type *type, unsigned long r) | 197 | static void __init_memblock memblock_remove_region(struct memblock_type *type, unsigned long r) |
174 | { | 198 | { |
175 | unsigned long i; | 199 | unsigned long i; |