diff --git a/hypervisor/boot/acpi.c b/hypervisor/boot/acpi.c index b5732e0e0..81d62d4e8 100644 --- a/hypervisor/boot/acpi.c +++ b/hypervisor/boot/acpi.c @@ -364,4 +364,19 @@ static void *get_facs_table(void) return facs_addr; } +/* put all ACPI fix up code here */ +void acpi_fixup(void) +{ + uint8_t *facs_addr; + + facs_addr = get_facs_table(); + + if (facs_addr != NULL) { + host_acpi_info.pm_s_state.wake_vector_32 = + (uint32_t *)(facs_addr + OFFSET_WAKE_VECTOR_32); + host_acpi_info.pm_s_state.wake_vector_64 = + (uint64_t *)(facs_addr + OFFSET_WAKE_VECTOR_64); + } +} + #endif diff --git a/hypervisor/bsp/include/bsp_extern.h b/hypervisor/bsp/include/bsp_extern.h index d392963bb..ae4ae1d3c 100644 --- a/hypervisor/bsp/include/bsp_extern.h +++ b/hypervisor/bsp/include/bsp_extern.h @@ -36,4 +36,8 @@ extern struct acpi_info host_acpi_info; /* BSP Interfaces */ void init_bsp(void); +#ifndef CONFIG_CONSTANT_ACPI +void acpi_fixup(void); +#endif + #endif /* BSP_EXTERN_H */ diff --git a/hypervisor/bsp/sbl/sbl.c b/hypervisor/bsp/sbl/sbl.c index 94f429657..e99f2964b 100644 --- a/hypervisor/bsp/sbl/sbl.c +++ b/hypervisor/bsp/sbl/sbl.c @@ -62,4 +62,7 @@ struct dmar_info *get_dmar_info(void) void init_bsp(void) { +#ifndef CONFIG_CONSTANT_ACPI + acpi_fixup(); +#endif } diff --git a/hypervisor/bsp/uefi/uefi.c b/hypervisor/bsp/uefi/uefi.c index 5b90bdbc3..77f32d8a2 100644 --- a/hypervisor/bsp/uefi/uefi.c +++ b/hypervisor/bsp/uefi/uefi.c @@ -115,6 +115,9 @@ static void efi_init(void) void init_bsp(void) { +#ifndef CONFIG_CONSTANT_ACPI + acpi_fixup(); +#endif parse_hv_cmdline(); #ifdef CONFIG_EFI_STUB