lib/memrange: Introduce method to clone memrange

Add a new method to clone an existing memrange with all of its entries.
Required for new bootmem type LB_MEM_RAM_DONT_OVERLAP.

Change-Id: I64b27bf2611ca310385ef680f030a3e4aa0c2680
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/25582
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Rudolph
2018-04-10 09:31:10 +02:00
committed by Patrick Georgi
parent c578efd9ca
commit d67a4bd5a7
2 changed files with 19 additions and 0 deletions

View File

@@ -98,6 +98,9 @@ void memranges_init(struct memranges *ranges,
unsigned long mask, unsigned long match,
unsigned long tag);
/* Clone a memrange. The new memrange has the same entries as the old one. */
void memranges_clone(struct memranges *newranges, struct memranges *oldranges);
/* Remove and free all entries within the memranges structure. */
void memranges_teardown(struct memranges *ranges);