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

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
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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)
{