HV: code cleanup for cpu state

Split pm.c from cpu_state_tbl.c to put guest power management related
functions, keep cpu_state_tbl.c to store host cpu state table and
related functions.

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
Victor Sun
2018-04-17 12:12:33 +08:00
committed by Jack Ren
parent 9dbcf7afaf
commit c3374a519a
10 changed files with 122 additions and 90 deletions

View File

@@ -236,13 +236,17 @@ enum feature_word {
FEATURE_WORDS,
};
struct cpu_state_info {
uint8_t px_cnt;
struct cpu_px_data *px_data;
};
struct cpuinfo_x86 {
uint8_t x86, x86_model;
uint64_t physical_address_mask;
uint32_t cpuid_leaves[FEATURE_WORDS];
char model_name[64];
uint8_t px_cnt;
struct cpu_px_data *px_data;
struct cpu_state_info state_info;
};
extern struct cpuinfo_x86 boot_cpu_data;
@@ -259,6 +263,7 @@ bool is_vapic_supported(void);
bool is_vapic_intr_delivery_supported(void);
bool is_vapic_virt_reg_supported(void);
bool cpu_has_cap(uint32_t bit);
void load_cpu_state_data(void);
/* Read control register */
#define CPU_CR_READ(cr, result_ptr) \