@@ -1930,11 +1930,15 @@ struct xc_get_cpufreq_para {
int32_t turbo_enabled;
};
+typedef struct xen_set_cppc_para xc_set_cppc_para_t;
+
int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
struct xc_get_cpufreq_para *user_para);
int xc_set_cpufreq_gov(xc_interface *xch, int cpuid, char *govname);
int xc_set_cpufreq_para(xc_interface *xch, int cpuid,
int ctrl_type, int ctrl_value);
+int xc_set_cpufreq_cppc(xc_interface *xch, int cpuid,
+ const xc_set_cppc_para_t *set_cppc);
int xc_get_cpufreq_avgfreq(xc_interface *xch, int cpuid, int *avg_freq);
int xc_set_sched_opt_smt(xc_interface *xch, uint32_t value);
@@ -329,6 +329,24 @@ int xc_set_cpufreq_para(xc_interface *xch, int cpuid,
return xc_sysctl(xch, &sysctl);
}
+int xc_set_cpufreq_cppc(xc_interface *xch, int cpuid,
+ const xc_set_cppc_para_t *set_cppc)
+{
+ DECLARE_SYSCTL;
+
+ if ( !xch )
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ sysctl.cmd = XEN_SYSCTL_pm_op;
+ sysctl.u.pm_op.cmd = SET_CPUFREQ_CPPC;
+ sysctl.u.pm_op.cpuid = cpuid;
+ sysctl.u.pm_op.u.set_cppc = *set_cppc;
+
+ return xc_sysctl(xch, &sysctl);
+}
+
int xc_get_cpufreq_avgfreq(xc_interface *xch, int cpuid, int *avg_freq)
{
int ret = 0;