mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
HV: platform acpi info refactor
Replace platform_acpi_info.c with platform_acpi_info.h and define needed host ACPI info in MACROs. Then the struct host_acpi_info is not needed any more. This header file should be generated by offline tool automatically; Tracked-On: #1500 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -111,17 +111,15 @@ void vm_setup_cpu_state(struct vm *vm)
|
||||
*/
|
||||
int vm_load_pm_s_state(struct vm *vm)
|
||||
{
|
||||
if ((boot_cpu_data.family == host_acpi_info.x86_family)
|
||||
&& (boot_cpu_data.model == host_acpi_info.x86_model)) {
|
||||
vm->pm.sx_state_data = (struct pm_s_state_data *)
|
||||
&host_acpi_info.pm_s_state;
|
||||
pr_info("System S3/S5 is supported.");
|
||||
return 0;
|
||||
} else {
|
||||
vm->pm.sx_state_data = NULL;
|
||||
pr_err("System S3/S5 is NOT supported.");
|
||||
return -1;
|
||||
}
|
||||
#ifdef ACPI_INFO_VALIDATED
|
||||
vm->pm.sx_state_data = (struct pm_s_state_data *)&host_pm_s_state;
|
||||
pr_info("System S3/S5 is supported.");
|
||||
return 0;
|
||||
#else
|
||||
vm->pm.sx_state_data = NULL;
|
||||
pr_err("System S3/S5 is NOT supported.");
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline uint32_t s3_enabled(uint32_t pm1_cnt)
|
||||
|
@@ -7,6 +7,50 @@
|
||||
|
||||
struct cpu_context cpu_ctx;
|
||||
|
||||
/* The values in this structure should come from host ACPI table */
|
||||
struct pm_s_state_data host_pm_s_state = {
|
||||
.pm1a_evt = {
|
||||
.space_id = PM1A_EVT_SPACE_ID,
|
||||
.bit_width = PM1A_EVT_BIT_WIDTH,
|
||||
.bit_offset = PM1A_EVT_BIT_OFFSET,
|
||||
.access_size = PM1A_EVT_ACCESS_SIZE,
|
||||
.address = PM1A_EVT_ADDRESS
|
||||
},
|
||||
.pm1b_evt = {
|
||||
.space_id = PM1B_EVT_SPACE_ID,
|
||||
.bit_width = PM1B_EVT_BIT_WIDTH,
|
||||
.bit_offset = PM1B_EVT_BIT_OFFSET,
|
||||
.access_size = PM1B_EVT_ACCESS_SIZE,
|
||||
.address = PM1B_EVT_ADDRESS
|
||||
},
|
||||
.pm1a_cnt = {
|
||||
.space_id = PM1A_CNT_SPACE_ID,
|
||||
.bit_width = PM1A_CNT_BIT_WIDTH,
|
||||
.bit_offset = PM1A_CNT_BIT_OFFSET,
|
||||
.access_size = PM1A_CNT_ACCESS_SIZE,
|
||||
.address = PM1A_CNT_ADDRESS
|
||||
},
|
||||
.pm1b_cnt = {
|
||||
.space_id = PM1B_CNT_SPACE_ID,
|
||||
.bit_width = PM1B_CNT_BIT_WIDTH,
|
||||
.bit_offset = PM1B_CNT_BIT_OFFSET,
|
||||
.access_size = PM1B_CNT_ACCESS_SIZE,
|
||||
.address = PM1B_CNT_ADDRESS
|
||||
},
|
||||
.s3_pkg = {
|
||||
.val_pm1a = S3_PKG_VAL_PM1A,
|
||||
.val_pm1b = S3_PKG_VAL_PM1B,
|
||||
.reserved = S3_PKG_RESERVED
|
||||
},
|
||||
.s5_pkg = {
|
||||
.val_pm1a = S5_PKG_VAL_PM1A,
|
||||
.val_pm1b = S5_PKG_VAL_PM1B,
|
||||
.reserved = S5_PKG_RESERVED
|
||||
},
|
||||
.wake_vector_32 = (uint32_t *)WAKE_VECTOR_32,
|
||||
.wake_vector_64 = (uint64_t *)WAKE_VECTOR_64
|
||||
};
|
||||
|
||||
/* whether the host enter s3 success */
|
||||
uint8_t host_enter_s3_success = 1U;
|
||||
|
||||
|
Reference in New Issue
Block a user