From be2512973d04f3da3cebfd3e7ee10809fbe4ae4a Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 12 Dec 2013 10:10:52 -0800 Subject: ramstage_cache: allow ramstage usage add valid helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow ramstage cache to be used from ramstage proper. Also add a helper function for checking validity of ramstage cache structure. BUG=chrome-os-partner:22867 BRANCH=None TEST=Built and booted. S3 resumed. Change-Id: If1f2ad1bcf64504b42e315be243a12432b50e3d5 Signed-off-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/179775 Reviewed-by: Duncan Laurie Reviewed-on: http://review.coreboot.org/5011 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki --- src/lib/ramstage_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/ramstage_cache.c b/src/lib/ramstage_cache.c index a1a4804..0f7273a 100644 --- a/src/lib/ramstage_cache.c +++ b/src/lib/ramstage_cache.c @@ -79,7 +79,7 @@ void *load_cached_ramstage(struct romstage_handoff *handoff, cache = ramstage_cache_location(&size); - if (cache == NULL || cache->magic != RAMSTAGE_CACHE_MAGIC) { + if (!ramstage_cache_is_valid(cache)) { printk(BIOS_DEBUG, "Invalid ramstage cache found.\n"); ramstage_cache_invalid(cache); return NULL; -- cgit v1.1