]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/memblock: Do some refactoring, enhance API
authorPhilipp Hachtmann <phacht@linux.vnet.ibm.com>
Wed, 29 Jan 2014 17:16:01 +0000 (18:16 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 17 Apr 2014 10:46:42 +0000 (12:46 +0200)
commit13bfdcfa3c76958a3b2d7146c0a2462b0f8b333e
tree789e9d448cb4607ef39761e9f819a129d2b6d61c
parent06cd7a874ec6e09d151aeb1fa8600e14f1ff89f6
mm/memblock: Do some refactoring, enhance API

Refactor the memblock code and extend the memblock API to make it
more flexible. With the extended API it is simple to define and
work with additional memory lists.

The static functions memblock_add_region and __memblock_remove are
renamed to memblock_add_range and meblock_remove_range and added to
the memblock API.

The __next_free_mem_range and __next_free_mem_range_rev functions
are replaced with calls to the more generic list walkers
__next_mem_range and __next_mem_range_rev.

To walk an arbitrary memory list two new macros for_each_mem_range
and for_each_mem_range_rev are added. These new macros are used
to define for_each_free_mem_range and for_each_free_mem_range_reverse.

Signed-off-by: Philipp Hachtmann <phacht@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
include/linux/memblock.h
mm/memblock.c