summaryrefslogtreecommitdiffstats
path: root/src/include/stage_cache.h
diff options
context:
space:
mode:
authorMarshall Dawson <marshalldawson3rd@gmail.com>2018-01-30 15:33:23 -0700
committerMartin Roth <martinroth@google.com>2018-02-07 16:22:40 +0000
commit8d6e0e0a72ed81d44ba61add0c2aab55bb217412 (patch)
treed910a30a26bab28ec8d24b8a9de341ca8eba4985 /src/include/stage_cache.h
parentac1cd44525d7230a0138fdd3e442ad8b1363c4dc (diff)
downloadcoreboot-8d6e0e0a72ed81d44ba61add0c2aab55bb217412.tar.gz
coreboot-8d6e0e0a72ed81d44ba61add0c2aab55bb217412.tar.bz2
coreboot-8d6e0e0a72ed81d44ba61add0c2aab55bb217412.zip
lib/stage_cache: Add save/get raw storage
Leverage the stage_cache mechanism to store a non-specific type of data. This is not interesting when the location for the cache is in cbmem. However it will be more useful when an external location is used, e.g. when the cache is in TSEG, locked from user modification. Change-Id: Iaf0b25ebe14c176bbd24fc8942f902f627ca8e6f Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-on: https://review.coreboot.org/23518 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/include/stage_cache.h')
-rw-r--r--src/include/stage_cache.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/stage_cache.h b/src/include/stage_cache.h
index 08312ff55495..28cb85998b26 100644
--- a/src/include/stage_cache.h
+++ b/src/include/stage_cache.h
@@ -20,14 +20,24 @@
#include <stdint.h>
#include <program_loading.h>
+/* Types of stages that may be stored in stage cache */
enum {
STAGE_RAMSTAGE,
STAGE_REFCODE,
STAGE_POSTCAR,
};
+/* Types of raw data that may be stored in stage cache */
+enum {
+ STAGE_S3_DATA,
+};
+
/* Cache the loaded stage provided according to the parameters. */
void stage_cache_add(int stage_id, const struct prog *stage);
+/* Cache non-specific data or code. */
+void stage_cache_add_raw(int stage_id, const void *base, const size_t size);
+/* Get a pointer to cached raw data and its size. */
+void stage_cache_get_raw(int stage_id, void **base, size_t *size);
/* Load the cached stage at given location returning the stage entry point. */
void stage_cache_load_stage(int stage_id, struct prog *stage);
/* Fill in parameters for the external stage cache, if utilized. */