cpuidle: export max_cstate access via libxc

Signed-off-by: Wei Gang <gang.wei@intel.com>
This commit is contained in:
Keir Fraser committed 2009-03-31 11:19:26 +01:00
1 parent 6fe255bdc2
commit fd598342a0
4 files changed
+55

No files matched your search

+33
View File
@@ -362,3 +362,36 @@ int xc_set_sched_opt_smt(int xc_handle, uint32_t value)
return rc;
}
int xc_get_cpuidle_max_cstate(int xc_handle, uint32_t *value)
{
int rc;
DECLARE_SYSCTL;
if ( xc_handle < 0 || !value )
return -EINVAL;
sysctl.cmd = XEN_SYSCTL_pm_op;
sysctl.u.pm_op.cmd = XEN_SYSCTL_pm_op_get_max_cstate;
sysctl.u.pm_op.cpuid = 0;
sysctl.u.pm_op.get_max_cstate = 0;
rc = do_sysctl(xc_handle, &sysctl);
*value = sysctl.u.pm_op.get_max_cstate;
return rc;
}
int xc_set_cpuidle_max_cstate(int xc_handle, uint32_t value)
{
DECLARE_SYSCTL;
if ( xc_handle < 0 )
return -EINVAL;
sysctl.cmd = XEN_SYSCTL_pm_op;
sysctl.u.pm_op.cmd = XEN_SYSCTL_pm_op_set_max_cstate;
sysctl.u.pm_op.cpuid = 0;
sysctl.u.pm_op.set_max_cstate = value;
return do_sysctl(xc_handle, &sysctl);
}
+3
View File
@@ -1262,4 +1262,7 @@ int xc_get_cputopo(int xc_handle, struct xc_get_cputopo *info);
int xc_set_sched_opt_smt(int xc_handle, uint32_t value);
int xc_get_cpuidle_max_cstate(int xc_handle, uint32_t *value);
int xc_set_cpuidle_max_cstate(int xc_handle, uint32_t value);
#endif /* XENCTRL_H */
+13
View File
@@ -37,6 +37,7 @@
#include <asm/processor.h>
#include <xen/percpu.h>
#include <xen/domain.h>
#include <xen/acpi.h>
#include <public/sysctl.h>
#include <acpi/cpufreq/cpufreq.h>
@@ -527,6 +528,18 @@ int do_pm_op(struct xen_sysctl_pm_op *op)
break;
}
case XEN_SYSCTL_pm_op_get_max_cstate:
{
op->get_max_cstate = max_cstate;
break;
}
case XEN_SYSCTL_pm_op_set_max_cstate:
{
max_cstate = op->set_max_cstate;
break;
}
default:
printk("not defined sub-hypercall @ do_pm_op\n");
ret = -ENOSYS;
+6
View File
@@ -382,6 +382,10 @@ struct xen_sysctl_pm_op {
/* set/reset scheduler power saving option */
#define XEN_SYSCTL_pm_op_set_sched_opt_smt 0x21
/* cpuidle max_cstate access command */
#define XEN_SYSCTL_pm_op_get_max_cstate 0x22
#define XEN_SYSCTL_pm_op_set_max_cstate 0x23
uint32_t cmd;
uint32_t cpuid;
union {
@@ -391,6 +395,8 @@ struct xen_sysctl_pm_op {
uint64_t get_avgfreq;
struct xen_get_cputopo get_topo;
uint32_t set_sched_opt_smt;
uint32_t get_max_cstate;
uint32_t set_max_cstate;
};
};
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.