[coreboot-gerrit] Patch set updated for coreboot: 7bcb821 loading: move ramstage cache function declarations

Aaron Durbin (adurbin@google.com) gerrit at coreboot.org
Mon Mar 30 23:43:04 CEST 2015


Aaron Durbin (adurbin at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8835

-gerrit

commit 7bcb8214e2877047d4286f97c662f92f7e30cff3
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Fri Mar 20 10:58:41 2015 -0500

    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 at chromium.org>
---
 src/include/cbfs.h            | 38 --------------------------------------
 src/include/program_loading.h | 36 ++++++++++++++++++++++++++++++++++++
 src/lib/ramstage_cache.c      |  2 +-
 3 files changed, 37 insertions(+), 39 deletions(-)

diff --git a/src/include/cbfs.h b/src/include/cbfs.h
index 2db3c94..c0e3d80 100644
--- a/src/include/cbfs.h
+++ b/src/include/cbfs.h
@@ -79,43 +79,5 @@ int run_address(void *f);
 /* Defined in individual arch / board implementation. */
 int init_default_cbfs_media(struct cbfs_media *media);
 
-#if defined(__PRE_RAM__)
-struct romstage_handoff;
-struct cbmem_entry;
-
-#if CONFIG_RELOCATABLE_RAMSTAGE && defined(__PRE_RAM__)
-/* 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__) */
-
 #endif
 
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index 21d2c1e..e071db9 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);
 
diff --git a/src/lib/ramstage_cache.c b/src/lib/ramstage_cache.c
index 814d807..d61f1c1 100644
--- a/src/lib/ramstage_cache.c
+++ b/src/lib/ramstage_cache.c
@@ -19,8 +19,8 @@
 
 #include <stddef.h>
 #include <string.h>
-#include <cbfs.h>
 #include <console/console.h>
+#include <program_loading.h>
 #include <ramstage_cache.h>
 #include <romstage_handoff.h>
 



More information about the coreboot-gerrit mailing list