diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-01-09 13:30:57 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-01-29 10:53:33 +0000 |
commit | e0165fbc944521171cd2776be4d3f655712079d2 (patch) | |
tree | da303ac99860420f001a843c98e547576bc4cfc8 /src/include | |
parent | cdaddde0672643a2457b163ea1b286a4ea77c0f1 (diff) |
stage_cache: Add resume_from_stage_cache()
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 <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50000
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/stage_cache.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 <romstage_handoff.h> #include <stddef.h> #include <stdint.h> #include <program_loading.h> @@ -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); |