summaryrefslogtreecommitdiff
path: root/src/lib/imd_cbmem.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-06-09 13:54:10 -0500
committerAaron Durbin <adurbin@chromium.org>2015-06-09 22:03:30 +0200
commit41607a4682c75b716e342cfc773926c753fb6086 (patch)
tree9fe3ea3bbbcce423cc9dfb6c91a890a2dab3a942 /src/lib/imd_cbmem.c
parentdb23215039894cf7668cba21c94753a9fcc546a0 (diff)
cbmem: add indicator to hooks if cbmem is being recovered
It can be helpful to certain users of the cbmem init hooks to know if recovery was done or not. Therefore, add this as a parameter to the hooks. Change-Id: I049fc191059cfdb8095986d3dc4eee9e25cf5452 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/10480 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/lib/imd_cbmem.c')
-rw-r--r--src/lib/imd_cbmem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c
index d1ff57d96c..fa6533484f 100644
--- a/src/lib/imd_cbmem.c
+++ b/src/lib/imd_cbmem.c
@@ -101,6 +101,7 @@ void cbmem_initialize_empty_id_size(u32 id, u64 size)
{
struct imd *imd;
struct imd imd_backing;
+ const int no_recovery = 0;
imd = imd_init_backing(&imd_backing);
imd_handle_init(imd, cbmem_top());
@@ -118,7 +119,7 @@ void cbmem_initialize_empty_id_size(u32 id, u64 size)
cbmem_add(id, size);
/* Complete migration to CBMEM. */
- cbmem_run_init_hooks();
+ cbmem_run_init_hooks(no_recovery);
}
static inline int cbmem_fail_recovery(void)
@@ -137,6 +138,7 @@ int cbmem_initialize_id_size(u32 id, u64 size)
{
struct imd *imd;
struct imd imd_backing;
+ const int recovery = 1;
imd = imd_init_backing(&imd_backing);
imd_handle_init(imd, cbmem_top());
@@ -158,7 +160,7 @@ int cbmem_initialize_id_size(u32 id, u64 size)
cbmem_add(id, size);
/* Complete migration to CBMEM. */
- cbmem_run_init_hooks();
+ cbmem_run_init_hooks(recovery);
/* Recovery successful. */
return 0;