From 7c2994bb73641826ab04ad622a0904c1c6096cc0 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 20 Nov 2019 20:01:11 +0100 Subject: lib/*_stage_cache.c: drop CAR_GLOBAL_MIGRATION support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I23d5367150649a64ec6d95601f38940dbb5972f8 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/37034 Reviewed-by: HAOUAS Elyes Reviewed-by: Kyösti Mälkki Tested-by: build bot (Jenkins) --- src/lib/cbmem_stage_cache.c | 1 - src/lib/ext_stage_cache.c | 20 +++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/lib/cbmem_stage_cache.c b/src/lib/cbmem_stage_cache.c index 299cb00dcf..dd56f62392 100644 --- a/src/lib/cbmem_stage_cache.c +++ b/src/lib/cbmem_stage_cache.c @@ -13,7 +13,6 @@ * GNU General Public License for more details. */ -#include #include #include #include diff --git a/src/lib/ext_stage_cache.c b/src/lib/ext_stage_cache.c index 354342d41b..466a65f53a 100644 --- a/src/lib/ext_stage_cache.c +++ b/src/lib/ext_stage_cache.c @@ -13,7 +13,6 @@ * GNU General Public License for more details. */ -#include #include #include #include @@ -21,12 +20,7 @@ #include #include -static struct imd imd_stage_cache CAR_GLOBAL = { }; - -static inline struct imd *imd_get(void) -{ - return car_get_var_ptr(&imd_stage_cache); -} +static struct imd imd_stage_cache; static void stage_cache_create_empty(void) { @@ -34,7 +28,7 @@ static void stage_cache_create_empty(void) void *base; size_t size; - imd = imd_get(); + imd = &imd_stage_cache; stage_cache_external_region(&base, &size); imd_handle_init(imd, (void *)(size + (uintptr_t)base)); @@ -50,7 +44,7 @@ static void stage_cache_recover(void) void *base; size_t size; - imd = imd_get(); + imd = &imd_stage_cache; stage_cache_external_region(&base, &size); imd_handle_init(imd, (void *)(size + (uintptr_t)base)); if (imd_recover(imd)) @@ -64,7 +58,7 @@ void stage_cache_add(int stage_id, const struct prog *stage) struct stage_cache *meta; void *c; - imd = imd_get(); + imd = &imd_stage_cache; e = imd_entry_add(imd, CBMEM_ID_STAGEx_META + stage_id, sizeof(*meta)); if (e == NULL) { @@ -99,7 +93,7 @@ void stage_cache_add_raw(int stage_id, const void *base, const size_t size) const struct imd_entry *e; void *c; - imd = imd_get(); + imd = &imd_stage_cache; e = imd_entry_add(imd, CBMEM_ID_STAGEx_RAW + stage_id, size); if (e == NULL) { printk(BIOS_DEBUG, "Error: Can't add %x raw data to imd\n", @@ -122,7 +116,7 @@ void stage_cache_get_raw(int stage_id, void **base, size_t *size) struct imd *imd; const struct imd_entry *e; - imd = imd_get(); + imd = &imd_stage_cache; e = imd_entry_find(imd, CBMEM_ID_STAGEx_RAW + stage_id); if (e == NULL) { printk(BIOS_DEBUG, "Error: Can't find %x raw data to imd\n", @@ -142,7 +136,7 @@ void stage_cache_load_stage(int stage_id, struct prog *stage) void *c; size_t size; - imd = imd_get(); + imd = &imd_stage_cache; e = imd_entry_find(imd, CBMEM_ID_STAGEx_META + stage_id); if (e == NULL) { printk(BIOS_DEBUG, "Error: Can't find %x metadata in imd\n", -- cgit v1.2.3