mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 00:21:59 +00:00
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: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
bf64f0517e
commit
3615d01114
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user