DM Cx: add function to get cx cnt and cx data

DM will use these functions to get cx entry cnt and cx data then inject
_CST objects to UOS DSDT table.

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-18 16:14:02 +08:00
committed by Jack Ren
parent bdd90e6597
commit a042538565
2 changed files with 61 additions and 2 deletions

View File

@@ -311,6 +311,21 @@ struct acrn_vm_pci_msix_remap {
* @brief Info The power state data of a VCPU.
*
*/
struct acrn_register {
uint8_t space_id;
uint8_t bit_width;
uint8_t bit_offset;
uint8_t access_size;
uint64_t address;
} __attribute__((aligned(8)));
struct cpu_cx_data {
struct acrn_register cx_reg;
uint8_t type;
uint32_t latency;
uint64_t power;
} __attribute__((aligned(8)));
struct cpu_px_data {
uint64_t core_frequency; /* megahertz */
uint64_t power; /* milliWatts */
@@ -323,8 +338,10 @@ struct cpu_px_data {
/**
* @brief Info PM command from DM/VHM.
*
* The command would specify request type(i.e. get px count or data) for
* specific VM and specific VCPU with specific state number.like P(n).
* The command would specify request type(e.g. get px count or data) for
* specific VM and specific VCPU with specific state number.
* For Px, PMCMD_STATE_NUM means Px number from 0 to (MAX_PSTATE - 1),
* For Cx, PMCMD_STATE_NUM means Cx entry index from 1 to MAX_CX_ENTRY.
*/
#define PMCMD_VMID_MASK 0xff000000
#define PMCMD_VCPUID_MASK 0x00ff0000
@@ -338,6 +355,8 @@ struct cpu_px_data {
enum pm_cmd_type {
PMCMD_GET_PX_CNT,
PMCMD_GET_PX_DATA,
PMCMD_GET_CX_CNT,
PMCMD_GET_CX_DATA,
};
/**