aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memblock.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-12-08 13:22:08 -0500
committerTejun Heo <tj@kernel.org>2011-12-08 13:22:08 -0500
commit1440c4e2c918532f39131c3330fe2226e16be7b6 (patch)
tree316b945da272f43bdb88d295c48926e471e47fad /include/linux/memblock.h
parent6fbef13c4feaf0c5576e2315f4d2999c4b670c88 (diff)
memblock: Track total size of regions automatically
Total size of memory regions was calculated by memblock_analyze() requiring explicitly calling the function between operations which can change memory regions and possible users of total size, which is cumbersome and fragile. This patch makes each memblock_type track total size automatically with minor modifications to memblock manipulation functions and remove requirements on calling memblock_analyze(). [__]memblock_dump_all() now also dumps the total size of reserved regions. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Yinghai Lu <yinghai@kernel.org>
Diffstat (limited to 'include/linux/memblock.h')
-rw-r--r--include/linux/memblock.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 6ac91c5b2fd3..5bb15005f0f7 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -30,12 +30,12 @@ struct memblock_region {
30struct memblock_type { 30struct memblock_type {
31 unsigned long cnt; /* number of regions */ 31 unsigned long cnt; /* number of regions */
32 unsigned long max; /* size of the allocated array */ 32 unsigned long max; /* size of the allocated array */
33 phys_addr_t total_size; /* size of all regions */
33 struct memblock_region *regions; 34 struct memblock_region *regions;
34}; 35};
35 36
36struct memblock { 37struct memblock {
37 phys_addr_t current_limit; 38 phys_addr_t current_limit;
38 phys_addr_t memory_size; /* Updated by memblock_analyze() */
39 struct memblock_type memory; 39 struct memblock_type memory;
40 struct memblock_type reserved; 40 struct memblock_type reserved;
41}; 41};