diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/romstage_handoff.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/romstage_handoff.c b/src/lib/romstage_handoff.c index 0a7a822f7b..faa2bc9f04 100644 --- a/src/lib/romstage_handoff.c +++ b/src/lib/romstage_handoff.c @@ -55,12 +55,23 @@ int romstage_handoff_init(int is_s3_resume) int romstage_handoff_is_resume(void) { + static int once, s3_resume; struct romstage_handoff *handoff; - handoff = cbmem_find(CBMEM_ID_ROMSTAGE_INFO); + if (once) + return s3_resume; + /* Only try evaluate handoff once for s3 resume state. */ + once = 1; + handoff = cbmem_find(CBMEM_ID_ROMSTAGE_INFO); if (handoff == NULL) return 0; - return handoff->s3_resume; + s3_resume = handoff->s3_resume; + if (s3_resume) + printk(BIOS_DEBUG, "S3 Resume\n"); + else + printk(BIOS_DEBUG, "Normal boot\n"); + + return s3_resume; } |