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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user