From 4677f6bbfa412bbdaa6f2fdf65e45e83eb9f6fb3 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Tue, 3 Apr 2018 00:08:12 -0600 Subject: lib/bootmem: tightly couple bootmem_init to bootmem_write_memory_table In https://review.coreboot.org/25383 people were confused about the ordering of bootmem calls w.r.t. when entries are exposed to the OS. To alleviate this add a notion of bootmem being initialized. In addition to that, only mark bootmem initialized when bootmem_write_memory_table() is called. Any other calls to bootmem before that will report an error on the console. Change-Id: I5bc31f555038ccabb82d902c54f95858679b1695 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/25503 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/lib/coreboot_table.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/lib/coreboot_table.c') diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c index d03b771f48..e786443cf6 100644 --- a/src/lib/coreboot_table.c +++ b/src/lib/coreboot_table.c @@ -524,11 +524,7 @@ static uintptr_t write_coreboot_table(uintptr_t rom_table_end) } #endif - /* Initialize the memory map at boot time. */ - bootmem_init(); - - /* No other memory areas can be added after the memory table has been - * committed as the entries won't show up in the serialize mem table. */ + /* Serialize resource map into mem table types (LB_MEM_*) */ bootmem_write_memory_table(lb_memory(head)); /* Record our motherboard */ -- cgit v1.2.3