summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-01-06 17:20:31 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-01-22 20:54:57 +0100
commit2d8520b275d47e0670e7f9e166e0f63c32855548 (patch)
tree71b69480daeb5e800b3863448cd0776dba265b7c /src/include
parent97e1b11f416aa23787e71b6133702b82daf1552e (diff)
downloadcoreboot-2d8520b275d47e0670e7f9e166e0f63c32855548.tar.xz
CBMEM: Replace cbmem_initialize() with cbmem_recovery()
The replacement function confirms CBMEM TOC is wiped clean on power cycles and resets. It also introduces compatibility interface to ease up transition to DYNAMIC_CBMEM. Change-Id: Ic5445c5bff4aff22a43821f3064f2df458b9f250 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/4668 Reviewed-by: Aaron Durbin <adurbin@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cbmem.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/include/cbmem.h b/src/include/cbmem.h
index 5f1ac3c581..eff18956cc 100644
--- a/src/include/cbmem.h
+++ b/src/include/cbmem.h
@@ -90,6 +90,9 @@ struct cbmem_entry;
#define DYN_CBMEM_ALIGN_SIZE (4096)
+/* By default cbmem is attempted to be recovered. Returns 0 if cbmem was
+ * recovered or 1 if cbmem had to be reinitialized. */
+int cbmem_initialize(void);
/* Initialize cbmem to be empty. */
void cbmem_initialize_empty(void);
@@ -153,9 +156,9 @@ struct cbmem_entry *get_cbmem_toc(void);
unsigned long get_top_of_ram(void);
-/* By default cbmem is attempted to be recovered. Returns 0 if cbmem was
- * recovered or 1 if cbmem had to be reinitialized. */
-int cbmem_initialize(void);
+/* Returns 0 if old cbmem was recovered. Recovery is only attempted if
+ * s3resume is non-zero. */
+int cbmem_recovery(int s3resume);
/* Add a cbmem entry of a given size and id. These return NULL on failure. The
* add function performs a find first and do not check against the original
* size. */