summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2020-11-18 07:40:21 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-01-23 20:19:47 +0000
commitac0dc4a8401e4531aa60a56d9ad4dfa0450eca78 (patch)
treed39f26cd8065a8189e9ddf1b05d4b23fe013ca86 /src/lib
parent540902ca47a9831d87761925b5df2699efc882a1 (diff)
downloadcoreboot-ac0dc4a8401e4531aa60a56d9ad4dfa0450eca78.tar.xz
ACPI S3: Replace stashed acpi_slp_typ value
We currently have a mixture of calls used to determine global ACPI S3 state. Reduce the boilerplate, ultimately acpi_wakeup_is_s3() should be the only to keep. Change-Id: Iff950d2bcf7eacbbdd40865abf62c35a2e8c3c69 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47694 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/romstage_handoff.c15
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;
}