diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c index 59da967e66..4276027a9f 100644 --- a/src/lib/hardwaremain.c +++ b/src/lib/hardwaremain.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -19,9 +20,6 @@ #include #include #include -#if CONFIG(HAVE_ACPI_RESUME) -#include -#endif #include #include #include @@ -151,16 +149,16 @@ static boot_state_t bs_post_device(void *arg) static boot_state_t bs_os_resume_check(void *arg) { -#if CONFIG(HAVE_ACPI_RESUME) - void *wake_vector; + void *wake_vector = NULL; - wake_vector = acpi_find_wakeup_vector(); + if (CONFIG(HAVE_ACPI_RESUME)) + wake_vector = acpi_find_wakeup_vector(); if (wake_vector != NULL) { boot_states[BS_OS_RESUME].arg = wake_vector; return BS_OS_RESUME; } -#endif + timestamp_add_now(TS_CBMEM_POST); return BS_WRITE_TABLES; @@ -168,10 +166,11 @@ static boot_state_t bs_os_resume_check(void *arg) static boot_state_t bs_os_resume(void *wake_vector) { -#if CONFIG(HAVE_ACPI_RESUME) - arch_bootstate_coreboot_exit(); - acpi_resume(wake_vector); -#endif + if (CONFIG(HAVE_ACPI_RESUME)) { + arch_bootstate_coreboot_exit(); + acpi_resume(wake_vector); + } + return BS_WRITE_TABLES; } @@ -445,9 +444,7 @@ void main(void) post_code(POST_ENTRY_RAMSTAGE); /* Handoff sleep type from romstage. */ -#if CONFIG(HAVE_ACPI_RESUME) acpi_is_wakeup(); -#endif threads_initialize(); /* Schedule the static boot state entries. */