x86: fixed mainboard_suspend_resume will be called when it's not defined

There is no proto function for mainboard_suspend_resume
In this case mainboard_suspend_resume is not NULL,
and cause if statment true.
Bios will jump to an empty weak function,
if mainboard_suspend_resume is not defined in mainboard.c
Then system becomes panic during s3 resume

BUG=chrome-os-partner:31286
TEST=compile ok and make sure system can resume from s3
BRANCH=None

Change-Id: I76bdea1d96166e683c6284024e1befbfc0d64645
Signed-off-by: Kane Chen <kane.chen@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/215865
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
This commit is contained in:
Kane Chen 2014-09-02 12:59:19 -07:00 committed by chrome-internal-fetch
commit 25a5a808d3
2 changed files with 6 additions and 3 deletions

View file

@ -620,6 +620,10 @@ void acpi_write_hest(acpi_hest_t *hest)
header->checksum = acpi_checksum((void *)hest, header->length);
}
void __attribute__((weak)) mainboard_suspend_resume(void)
{
}
#if CONFIG_HAVE_ACPI_RESUME
void acpi_resume(void *wake_vec)
{
@ -635,8 +639,7 @@ void acpi_resume(void *wake_vec)
#endif
/* Call mainboard resume handler first, if defined. */
if (mainboard_suspend_resume)
mainboard_suspend_resume();
mainboard_suspend_resume();
post_code(POST_OS_RESUME);
acpi_jump_to_wakeup(wake_vec);

View file

@ -559,7 +559,7 @@ void acpi_save_gnvs(u32 gnvs_address);
extern u8 acpi_slp_type;
void acpi_resume(void *wake_vec);
void __attribute__((weak)) mainboard_suspend_resume(void);
void mainboard_suspend_resume(void);
void *acpi_find_wakeup_vector(void);
void *acpi_get_wakeup_rsdp(void);
void acpi_jump_to_wakeup(void *wakeup_addr);