From 6c191d8af41859dd94a01c6a868a9186d0120923 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Tue, 29 Nov 2016 21:22:42 -0600 Subject: romstage_handoff: add helper to determine resume status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of having callers query the romstage handoff resume status by inspecting the object themselves add romstage_handoff_is_resume() so that the same information can be queried easily. Change-Id: I40f3769b7646bf296ee4bc323a9ab1d5e5691e21 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/17647 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Furquan Shaikh --- src/include/romstage_handoff.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/include/romstage_handoff.h') diff --git a/src/include/romstage_handoff.h b/src/include/romstage_handoff.h index 3eba0fdaf1..9e254cd807 100644 --- a/src/include/romstage_handoff.h +++ b/src/include/romstage_handoff.h @@ -78,4 +78,17 @@ static inline int romstage_handoff_init(int is_s3_resume) return 0; } +/* Return 1 if resuming or 0 if not. */ +static inline int romstage_handoff_is_resume(void) +{ + struct romstage_handoff *handoff; + + handoff = cbmem_find(CBMEM_ID_ROMSTAGE_INFO); + + if (handoff == NULL) + return 0; + + return handoff->s3_resume; +} + #endif /* ROMSTAGE_HANDOFF_H */ -- cgit v1.2.3