summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/cbmem_stage_cache.c1
-rw-r--r--src/lib/ext_stage_cache.c20
2 files changed, 7 insertions, 14 deletions
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 <arch/early_variables.h>
#include <cbmem.h>
#include <stage_cache.h>
#include <string.h>
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 <arch/early_variables.h>
#include <bootstate.h>
#include <cbmem.h>
#include <console/console.h>
@@ -21,12 +20,7 @@
#include <stage_cache.h>
#include <string.h>
-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",