Commit 3615d011 authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Heiko Carstens

s390/mem_detect: add get_mem_detect_online_total()

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: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent bf64f051
......@@ -66,6 +66,17 @@ static inline int __get_mem_detect_block(u32 n, unsigned long *start,
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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment