summaryrefslogtreecommitdiff
path: root/src/arch/x86/boot/acpi.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-04-24 22:33:08 -0500
committerRonald G. Minnich <rminnich@gmail.com>2013-05-01 07:07:33 +0200
commit0a6c20a2a3bc16aa12b04dd3db1d1260777edf0e (patch)
treed5ab49da23e52e262c016ed7cb3a11f8e6a1556e /src/arch/x86/boot/acpi.c
parenta4feddf897023b37cfac2af529e787504849f985 (diff)
acpi: split resume check and actual resume code
It's helpful to provide a distinct state that affirmatively describes that OS resume will occur. The previous code included the check and the actual resuming in one function. Because of this grouping one had to annotate the innards of the ACPI resume path to perform specific actions before OS resume. By providing a distinct state in the boot state machine the necessary actions can be scheduled accordingly without modifying the ACPI code. Change-Id: I8b00aacaf820cbfbb21cb851c422a143371878bd Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/3134 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/arch/x86/boot/acpi.c')
-rw-r--r--src/arch/x86/boot/acpi.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 96ece06af9..1c373ac6c0 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -622,37 +622,31 @@ void acpi_write_hest(acpi_hest_t *hest)
}
#if CONFIG_HAVE_ACPI_RESUME
-void suspend_resume(void)
+void acpi_resume(void *wake_vec)
{
- void *wake_vec;
-
- /* If we happen to be resuming find wakeup vector and jump to OS. */
- wake_vec = acpi_find_wakeup_vector();
- if (wake_vec) {
#if CONFIG_HAVE_SMI_HANDLER
- u32 *gnvs_address = cbmem_find(CBMEM_ID_ACPI_GNVS_PTR);
+ u32 *gnvs_address = cbmem_find(CBMEM_ID_ACPI_GNVS_PTR);
- /* Restore GNVS pointer in SMM if found */
- if (gnvs_address && *gnvs_address) {
- printk(BIOS_DEBUG, "Restore GNVS pointer to 0x%08x\n",
- *gnvs_address);
- smm_setup_structures((void *)*gnvs_address, NULL, NULL);
- }
+ /* Restore GNVS pointer in SMM if found */
+ if (gnvs_address && *gnvs_address) {
+ printk(BIOS_DEBUG, "Restore GNVS pointer to 0x%08x\n",
+ *gnvs_address);
+ smm_setup_structures((void *)*gnvs_address, NULL, NULL);
+ }
#endif
- /* Call mainboard resume handler first, if defined. */
- if (mainboard_suspend_resume)
- mainboard_suspend_resume();
+ /* Call mainboard resume handler first, if defined. */
+ if (mainboard_suspend_resume)
+ mainboard_suspend_resume();
#if CONFIG_COVERAGE
- coverage_exit();
+ coverage_exit();
#endif
- /* Tear down the caching of the ROM. */
- if (disable_cache_rom)
- disable_cache_rom();
+ /* Tear down the caching of the ROM. */
+ if (disable_cache_rom)
+ disable_cache_rom();
- post_code(POST_OS_RESUME);
- acpi_jump_to_wakeup(wake_vec);
- }
+ post_code(POST_OS_RESUME);
+ acpi_jump_to_wakeup(wake_vec);
}
/* This is to be filled by SB code - startup value what was found. */