From e0165fbc944521171cd2776be4d3f655712079d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sat, 9 Jan 2021 13:30:57 +0200 Subject: stage_cache: Add resume_from_stage_cache() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Factor out the condition when an attempt to load stage from cache can be tried. Change-Id: I936f07bed6fc82f46118d217f1fd233e2e041405 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/50000 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/include/stage_cache.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/include') diff --git a/src/include/stage_cache.h b/src/include/stage_cache.h index ba8827dad6..1e46b5cfe2 100644 --- a/src/include/stage_cache.h +++ b/src/include/stage_cache.h @@ -3,6 +3,7 @@ #ifndef _STAGE_CACHE_H_ #define _STAGE_CACHE_H_ +#include #include #include #include @@ -38,6 +39,15 @@ static inline void stage_cache_get_raw(int stage_id, void **base, size_t *size) #endif +static inline int resume_from_stage_cache(void) +{ + if (CONFIG(NO_STAGE_CACHE)) + return 0; + + /* TBD: Replace this with acpi_is_wakeup_s3(). */ + return romstage_handoff_is_resume(); +} + /* Fill in parameters for the external stage cache, if utilized. */ void stage_cache_external_region(void **base, size_t *size); -- cgit v1.2.3