x86_cpuid_query x86_cstate_notification
API Reference Manual  /  4 Model-to-Model Interfaces  / 

x86_cstate

Description
The methods in this interface can be used to read or change the current power state the CPU is in. A state value of 0 corresponds to C0, a value of 1 corresponds to C1, etc. HLT will be reported as state 1, substate 0. MWAIT will reported based upon the eax hint, decoded as state = (eax[7:4] + 1) mod 16, substate = eax[3:0].

set_cstate will perform side-effects such as putting the processor to sleep or waking it up, and call the registered cstate listeners.

typedef struct {
        uint32 state;
        uint32 sub_state;
} x86_cstate_t;

SIM_INTERFACE(x86_cstate) {
        x86_cstate_t (*get_cstate)(conf_object_t *cpu_obj);
        void (*set_cstate)(conf_object_t *cpu_obj,
                           uint32 state, uint32 sub_state);
};

#define X86_CSTATE_INTERFACE "x86_cstate"

Execution Context
Cell Context for all methods.

x86_cpuid_query x86_cstate_notification