• Yinghai Lu's avatar
    x86, memblock: Add memblock_x86_free_memory_in_range() · b52c17ce
    Yinghai Lu authored
    It will return free memory size in specified range.
    
    We can not use memory_size - reserved_size here, because some reserved area
    may not be in the scope of memblock.memory.region.
    
    Use memblock.memory.region subtracting memblock.reserved.region to get free range array.
    then count size of all free ranges.
    
    -v2: Ben insist on using _in_range
    Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
    b52c17ce
memblock.c 8.75 KB