本文整理汇总了C++中cpuidle_disable_device函数的典型用法代码示例。如果您正苦于以下问题:C++ cpuidle_disable_device函数的具体用法?C++ cpuidle_disable_device怎么用?C++ cpuidle_disable_device使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cpuidle_disable_device函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: acpi_processor_hotplug
int acpi_processor_hotplug(struct acpi_processor *pr)
{
int ret = 0;
if (disabled_by_idle_boot_param())
return 0;
if (!pr)
return -EINVAL;
if (nocst) {
return -ENODEV;
}
if (!pr->flags.power_setup_done)
return -ENODEV;
cpuidle_pause_and_lock();
cpuidle_disable_device(&pr->power.dev);
acpi_processor_get_power_info(pr);
if (pr->flags.power) {
acpi_processor_setup_cpuidle_cx(pr);
ret = cpuidle_enable_device(&pr->power.dev);
}
cpuidle_resume_and_unlock();
return ret;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:28,代码来源:processor_idle.c
示例2: acpi_processor_hotplug
int acpi_processor_hotplug(struct acpi_processor *pr)
{
int ret = 0;
struct cpuidle_device *dev;
if (disabled_by_idle_boot_param())
return 0;
if (nocst)
return -ENODEV;
if (!pr->flags.power_setup_done)
return -ENODEV;
dev = per_cpu(acpi_cpuidle_device, pr->id);
cpuidle_pause_and_lock();
cpuidle_disable_device(dev);
acpi_processor_get_power_info(pr);
if (pr->flags.power) {
acpi_processor_setup_cpuidle_cx(pr, dev);
ret = cpuidle_enable_device(dev);
}
cpuidle_resume_and_unlock();
return ret;
}
开发者ID:magarto,项目名称:linux-rpi-grsecurity,代码行数:26,代码来源:processor_idle.c
示例3: pseries_cpuidle_add_cpu_notifier
static int pseries_cpuidle_add_cpu_notifier(struct notifier_block *n,
unsigned long action, void *hcpu)
{
int hotcpu = (unsigned long)hcpu;
struct cpuidle_device *dev =
per_cpu(cpuidle_devices, hotcpu);
if (dev && cpuidle_get_driver()) {
switch (action) {
case CPU_ONLINE:
case CPU_ONLINE_FROZEN:
cpuidle_pause_and_lock();
cpuidle_enable_device(dev);
cpuidle_resume_and_unlock();
break;
case CPU_DEAD:
case CPU_DEAD_FROZEN:
cpuidle_pause_and_lock();
cpuidle_disable_device(dev);
cpuidle_resume_and_unlock();
break;
default:
return NOTIFY_DONE;
}
}
return NOTIFY_OK;
}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:29,代码来源:cpuidle-pseries.c
示例4: cpuidle_unregister_device
/**
* cpuidle_unregister_device - unregisters a CPU's idle PM feature
* @dev: the cpu
*/
void cpuidle_unregister_device(struct cpuidle_device *dev)
{
struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu);
if (!sys_dev) {
pr_err(" ERR get_cpu_sysdev returned NULL\n");
return;
}
if (dev->registered == 0)
return;
if (!sys_dev)
return;
cpuidle_pause_and_lock();
cpuidle_disable_device(dev);
cpuidle_remove_sysfs(sys_dev);
list_del(&dev->device_list);
wait_for_completion(&dev->kobj_unregister);
per_cpu(cpuidle_devices, dev->cpu) = NULL;
cpuidle_resume_and_unlock();
module_put(cpuidle_curr_driver->owner);
}
开发者ID:dancing-leaves,项目名称:nst-linux-kernel,代码行数:32,代码来源:cpuidle.c
示例5: cpuidle_switch_governor
/**
* cpuidle_switch_governor - changes the governor
* @gov: the new target governor
*
* NOTE: "gov" can be NULL to specify disabled
* Must be called with cpuidle_lock acquired.
*/
int cpuidle_switch_governor(struct cpuidle_governor *gov)
{
struct cpuidle_device *dev;
if (gov == cpuidle_curr_governor)
return 0;
cpuidle_uninstall_idle_handler();
if (cpuidle_curr_governor) {
list_for_each_entry(dev, &cpuidle_detected_devices, device_list)
cpuidle_disable_device(dev);
module_put(cpuidle_curr_governor->owner);
}
cpuidle_curr_governor = gov;
if (gov) {
if (!try_module_get(cpuidle_curr_governor->owner))
return -EINVAL;
list_for_each_entry(dev, &cpuidle_detected_devices, device_list)
cpuidle_enable_device(dev);
cpuidle_install_idle_handler();
printk(KERN_INFO "cpuidle: using governor %s\n", gov->name);
}
return 0;
}
开发者ID:AdaLovelance,项目名称:lxcGrsecKernels,代码行数:35,代码来源:governor.c
示例6: cpuidle_unregister_device
/**
* cpuidle_unregister_device - unregisters a CPU's idle PM feature
* @dev: the cpu
*/
void cpuidle_unregister_device(struct cpuidle_device *dev)
{
struct device *cpu_dev;
struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver();
if (!dev)
return;
cpu_dev = get_cpu_device((unsigned long)dev->cpu);
if (!cpu_dev)
return;
if (dev->registered == 0)
return;
cpuidle_pause_and_lock();
cpuidle_disable_device(dev);
cpuidle_remove_sysfs(cpu_dev);
list_del(&dev->device_list);
wait_for_completion(&dev->kobj_unregister);
per_cpu(cpuidle_devices, dev->cpu) = NULL;
cpuidle_coupled_unregister_device(dev);
cpuidle_resume_and_unlock();
module_put(cpuidle_driver->owner);
}
开发者ID:Leoyzen,项目名称:Charm-Eye,代码行数:32,代码来源:cpuidle.c
示例7: acpi_processor_cst_has_changed
int acpi_processor_cst_has_changed(struct acpi_processor *pr)
{
int cpu;
struct acpi_processor *_pr;
struct cpuidle_device *dev;
if (disabled_by_idle_boot_param())
return 0;
if (!pr)
return -EINVAL;
if (nocst)
return -ENODEV;
if (!pr->flags.power_setup_done)
return -ENODEV;
/*
* FIXME: Design the ACPI notification to make it once per
* system instead of once per-cpu. This condition is a hack
* to make the code that updates C-States be called once.
*/
if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) {
cpuidle_pause_and_lock();
/* Protect against cpu-hotplug */
get_online_cpus();
/* Disable all cpuidle devices */
for_each_online_cpu(cpu) {
_pr = per_cpu(processors, cpu);
if (!_pr || !_pr->flags.power_setup_done)
continue;
dev = per_cpu(acpi_cpuidle_device, cpu);
cpuidle_disable_device(dev);
}
/* Populate Updated C-state information */
acpi_processor_get_power_info(pr);
acpi_processor_setup_cpuidle_states(pr);
/* Enable all cpuidle devices */
for_each_online_cpu(cpu) {
_pr = per_cpu(processors, cpu);
if (!_pr || !_pr->flags.power_setup_done)
continue;
acpi_processor_get_power_info(_pr);
if (_pr->flags.power) {
dev = per_cpu(acpi_cpuidle_device, cpu);
acpi_processor_setup_cpuidle_cx(_pr, dev);
cpuidle_enable_device(dev);
}
}
put_online_cpus();
cpuidle_resume_and_unlock();
}
开发者ID:AndroidGX,项目名称:SimpleGX-L-5.0.2_BOD6_G901F,代码行数:58,代码来源:processor_idle.c
示例8: pseries_notify_cpuidle_add_cpu
int pseries_notify_cpuidle_add_cpu(int cpu)
{
struct cpuidle_device *dev =
per_cpu_ptr(pseries_cpuidle_devices, cpu);
if (dev && cpuidle_get_driver()) {
cpuidle_disable_device(dev);
cpuidle_enable_device(dev);
}
return 0;
}
开发者ID:ArthySundaram,项目名称:chromeos-kvm,代码行数:10,代码来源:processor_idle.c
示例9: s5p6442_setup_lpaudio
int s5p6442_setup_lpaudio(unsigned int mode)
{
struct cpuidle_device *device;
int ret = 0;
cpuidle_pause_and_lock();
device = &per_cpu(s5p6442_cpuidle_device, smp_processor_id());
cpuidle_disable_device(device);
switch (mode) {
case NORMAL_MODE:
device->state_count = 1;
/* Wait for interrupt state */
device->states[0].enter = s5p6442_enter_idle_normal;
device->states[0].exit_latency = 1; /* uS */
device->states[0].target_residency = 10000;
device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
strcpy(device->states[0].name, "IDLE");
strcpy(device->states[0].desc, "ARM clock gating - WFI");
break;
case LPAUDIO_MODE:
device->state_count = 1;
/* Wait for interrupt state */
device->states[0].enter = s5p6442_enter_idle_bm;
device->states[0].exit_latency = 1; /* uS */
device->states[0].target_residency = 5000;
device->states[0].flags = CPUIDLE_FLAG_TIME_VALID |
CPUIDLE_FLAG_CHECK_BM;
strcpy(device->states[0].name, "DEEP IDLE");
strcpy(device->states[0].desc, "S5P6442 idle2");
break;
default:
printk(KERN_ERR "Can't find cpuidle mode %d\n", mode);
device->state_count = 1;
/* Wait for interrupt state */
device->states[0].enter = s5p6442_enter_idle_normal;
device->states[0].exit_latency = 1; /* uS */
device->states[0].target_residency = 10000;
device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
strcpy(device->states[0].name, "IDLE");
strcpy(device->states[0].desc, "ARM clock gating - WFI");
break;
}
cpuidle_enable_device(device);
cpuidle_resume_and_unlock();
return ret;
}
开发者ID:Arakmar,项目名称:G3MOD,代码行数:51,代码来源:cpuidle.c
示例10: acpi_processor_cst_has_changed
int acpi_processor_cst_has_changed(struct acpi_processor *pr)
{
int cpu;
struct acpi_processor *_pr;
if (disabled_by_idle_boot_param())
return 0;
if (!pr)
return -EINVAL;
if (nocst)
return -ENODEV;
if (!pr->flags.power_setup_done)
return -ENODEV;
if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) {
cpuidle_pause_and_lock();
get_online_cpus();
for_each_online_cpu(cpu) {
_pr = per_cpu(processors, cpu);
if (!_pr || !_pr->flags.power_setup_done)
continue;
cpuidle_disable_device(&_pr->power.dev);
}
acpi_processor_setup_cpuidle_states(pr);
for_each_online_cpu(cpu) {
_pr = per_cpu(processors, cpu);
if (!_pr || !_pr->flags.power_setup_done)
continue;
acpi_processor_get_power_info(_pr);
if (_pr->flags.power) {
acpi_processor_setup_cpuidle_cx(_pr);
cpuidle_enable_device(&_pr->power.dev);
}
}
put_online_cpus();
cpuidle_resume_and_unlock();
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:49,代码来源:processor_idle.c
示例11: mv_cpu_idle_write
static int mv_cpu_idle_write(struct file *file, const char *buffer,
unsigned long count, void *data)
{
MV_U32 regs[4];
/* Reading / Writing from system controller internal registers */
if (!strncmp (buffer, "enable", strlen("enable"))) {
if(device_registered == 0) {
device_registered = 1;
if (cpuidle_register_device(kirkwood_cpu_idle_device)) {
printk(KERN_ERR "mv_cpu_idle_write: Failed registering\n");
return -EIO;
}
}
cpuidle_enable_device(kirkwood_cpu_idle_device);
} else if (!strncmp (buffer, "disable", strlen("disable"))) {
cpuidle_disable_device(kirkwood_cpu_idle_device);
} else if (!strncmp (buffer, "test", strlen("test"))) {
/* Store Interrupt mask registers. */
regs[0] = MV_REG_READ(MV_IRQ_MASK_LOW_REG);
regs[1] = MV_REG_READ(MV_IRQ_MASK_HIGH_REG);
regs[2] = MV_REG_READ(MV_IRQ_MASK_ERROR_REG);
/* Disable all interrupts . */
MV_REG_WRITE(MV_IRQ_MASK_LOW_REG, 0x0);
MV_REG_WRITE(MV_IRQ_MASK_HIGH_REG, 0x0);
MV_REG_WRITE(MV_IRQ_MASK_ERROR_REG, 0x0);
/* Enable only the UART interrupt. */
MV_REG_BIT_SET(MV_IRQ_MASK_HIGH_REG, 1 << (UART_IRQ_NUM(0) - 32));
printk(KERN_INFO "Press any key to leave deep idle:");
mv_kw2_cpu_idle_enter();
/* Restore Interrupt mask registers. */
MV_REG_WRITE(MV_IRQ_MASK_LOW_REG, regs[0]);
MV_REG_WRITE(MV_IRQ_MASK_HIGH_REG, regs[1]);
MV_REG_WRITE(MV_IRQ_MASK_ERROR_REG, regs[2]);
}
return count;
}
开发者ID:DentonGentry,项目名称:gfiber-gfrg100,代码行数:43,代码来源:cpuidle.c
示例12: cpuidle_unregister_device
/**
* cpuidle_unregister_device - unregisters a CPU's idle PM feature
* @dev: the cpu
*/
void cpuidle_unregister_device(struct cpuidle_device *dev)
{
struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
if (dev->registered == 0)
return;
cpuidle_pause_and_lock();
cpuidle_disable_device(dev);
cpuidle_remove_sysfs(dev);
list_del(&dev->device_list);
per_cpu(cpuidle_devices, dev->cpu) = NULL;
cpuidle_coupled_unregister_device(dev);
cpuidle_resume_and_unlock();
module_put(drv->owner);
}
开发者ID:andy78328,项目名称:pmu-for-omap4,代码行数:25,代码来源:cpuidle.c
注:本文中的cpuidle_disable_device函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论