Add a function to get online memory in total. It is supposed to be used
in the decompressor as well as during early kernel startup.
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
i < mem_detect.count; \
i++, __get_mem_detect_block(i, p_start, p_end))
+static inline unsigned long get_mem_detect_online_total(void)
+{
+ unsigned long start, end, total = 0;
+ int i;
+
+ for_each_mem_detect_block(i, &start, &end)
+ total += end - start;
+
+ return total;
+}
+
static inline void get_mem_detect_reserved(unsigned long *start,
unsigned long *size)
{