summaryrefslogtreecommitdiff
path: root/src/include/program_loading.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-03-20 10:58:41 -0500
committerAaron Durbin <adurbin@google.com>2015-03-31 19:30:07 +0200
commitfcfdff84f4ddd6fe7bf68c3bc84c0173911d13de (patch)
treebef48145a31ff8e7bf735b085a5ece448af328fe /src/include/program_loading.h
parent7c2eb0d78bdf5faddef61e051a29a262ad29b26a (diff)
downloadcoreboot-fcfdff84f4ddd6fe7bf68c3bc84c0173911d13de.tar.xz
loading: move ramstage cache function declarations
The functions related to caching ramstage were in cbfs.h. Now that the loading code is separate move those declarations to the common program_loading.h. Change-Id: Ib22ef8a9c66e1d2b53388bceb8386baa6302d28b Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8835 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/include/program_loading.h')
-rw-r--r--src/include/program_loading.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index 21d2c1eaf2..e071db9729 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -40,8 +40,44 @@ void run_romstage(void);
* RAMSTAGE LOADING *
************************/
+struct romstage_handoff;
struct cbmem_entry;
+#if defined(__PRE_RAM__)
+#if CONFIG_RELOCATABLE_RAMSTAGE
+/* The cache_loaded_ramstage() and load_cached_ramstage() functions are defined
+ * to be weak so that board and chipset code may override them. Their job is to
+ * cache and load the ramstage for quick S3 resume. By default a copy of the
+ * relocated ramstage is saved using the cbmem infrastructure. These
+ * functions are only valid during romstage. */
+
+/* The implementer of cache_loaded_ramstage() may use the romstage_handoff
+ * structure to store information, but note that the handoff variable can be
+ * NULL. The ramstage cbmem_entry represents the region occupied by the loaded
+ * ramstage. */
+void cache_loaded_ramstage(struct romstage_handoff *handoff,
+ const struct cbmem_entry *ramstage, void *entry_point);
+/* Return NULL on error or entry point on success. The ramstage cbmem_entry is
+ * the region where to load the cached contents to. */
+void * load_cached_ramstage(struct romstage_handoff *handoff,
+ const struct cbmem_entry *ramstage);
+#else /* CONFIG_RELOCATABLE_RAMSTAGE */
+
+static inline void cache_loaded_ramstage(struct romstage_handoff *handoff,
+ const struct cbmem_entry *ramstage, void *entry_point)
+{
+}
+
+static inline void *
+load_cached_ramstage(struct romstage_handoff *handoff,
+ const struct cbmem_entry *ramstage)
+{
+ return NULL;
+}
+
+#endif /* CONFIG_RELOCATABLE_RAMSTAGE */
+#endif /* defined(__PRE_RAM__) */
+
/* Run ramstage from romstage. */
void run_ramstage(void);