From ed17a33fed296a87219b0ff702045ce488bc3771 Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Mon, 26 Aug 2024 17:29:18 +0530 Subject: lmb: make LMB memory map persistent and global The current LMB API's for allocating and reserving memory use a per-caller based memory view. Memory allocated by a caller can then be overwritten by another caller. Make these allocations and reservations persistent using the alloced list data structure. Two alloced lists are declared -- one for the available(free) memory, and one for the used memory. Once full, the list can then be extended at runtime. [sjg: Use a stack to store pointer of lmb struct when running lmb tests] Signed-off-by: Sughosh Ganu Signed-off-by: Simon Glass [sjg: Optimise the logic to add a region in lmb_add_region_flags()] --- arch/arm/lib/stack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/lib/stack.c') diff --git a/arch/arm/lib/stack.c b/arch/arm/lib/stack.c index ea1b937add7..87d5c962d7f 100644 --- a/arch/arm/lib/stack.c +++ b/arch/arm/lib/stack.c @@ -42,7 +42,7 @@ static ulong get_sp(void) return ret; } -void arch_lmb_reserve(struct lmb *lmb) +void arch_lmb_reserve(void) { - arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 16384); + arch_lmb_reserve_generic(get_sp(), gd->ram_top, 16384); } -- cgit v1.2.3