| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <string.h> |
| 5 |
#include <acpi/acpi.h> |
| 6 |
#include <arch/cpu.h> |
| 7 |
#include <commonlib/helpers.h> |
| 8 |
#include <fallback.h> |
| 9 |
#include <timestamp.h> |
| 10 |
|
| 11 |
#define WAKEUP_BASE 0x600 |
| 12 |
|
| 13 |
asmlinkage void (*acpi_do_wakeup)(uintptr_t vector) = (void *)WAKEUP_BASE; |
| 14 |
|
| 15 |
extern unsigned char __wakeup; |
| 16 |
extern unsigned int __wakeup_size; |
| 17 |
|
| 18 |
void __noreturn acpi_resume(void *wake_vec) |
| 19 |
{ |
| 20 |
|
| 21 |
mainboard_suspend_resume(); |
| 22 |
|
| 23 |
|
| 24 |
memcpy((void *)WAKEUP_BASE, &__wakeup, __wakeup_size); |
| 25 |
|
| 26 |
set_boot_successful(); |
| 27 |
|
| 28 |
timestamp_add_now(TS_ACPI_WAKE_JUMP); |
| 29 |
|
| 30 |
post_code(POSTCODE_OS_RESUME); |
| 31 |
acpi_do_wakeup((uintptr_t)wake_vec); |
| 32 |
|
| 33 |
die("Failed the jump to wakeup vector\n"); |
| 34 |
} |