diff --git a/src/include/cbmem.h b/src/include/cbmem.h index 5c4b7c7189..c13fe925ad 100644 --- a/src/include/cbmem.h +++ b/src/include/cbmem.h @@ -158,4 +158,20 @@ void set_top_of_ram(uint64_t ramtop); void backup_top_of_ram(uint64_t ramtop); #endif +/* + * Returns 0 for the stages where we know that cbmem does not come online. + * Even if this function returns 1 for romstage, depending upon the point in + * bootup, cbmem might not actually be online. + */ +static inline int cbmem_possibly_online(void) +{ + if (ENV_BOOTBLOCK) + return 0; + + if (ENV_VERSTAGE && IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK)) + return 0; + + return 1; +} + #endif /* _CBMEM_H_ */ diff --git a/src/vboot/bootmode.c b/src/vboot/bootmode.c index 5bb70406e3..46b78e1dad 100644 --- a/src/vboot/bootmode.c +++ b/src/vboot/bootmode.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -67,22 +68,6 @@ static void vb2_clear_recovery_reason_vbnv(void *unused) BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_EXIT, vb2_clear_recovery_reason_vbnv, NULL); -/* - * Returns 0 for the stages where we know that cbmem does not come online. - * Even if this function returns 1 for romstage, depending upon the point in - * bootup, cbmem might not actually be online. - */ -static int cbmem_possibly_online(void) -{ - if (ENV_BOOTBLOCK) - return 0; - - if (ENV_VERSTAGE && IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK)) - return 0; - - return 1; -} - /* * Returns 1 if vboot is being used and currently in a stage which might have * already executed vboot verification.