当前位置: 首页>>代码示例>>C++>>正文


C++ cpuidle_install_idle_handler函数代码示例

本文整理汇总了C++中cpuidle_install_idle_handler函数的典型用法代码示例。如果您正苦于以下问题:C++ cpuidle_install_idle_handler函数的具体用法?C++ cpuidle_install_idle_handler怎么用?C++ cpuidle_install_idle_handler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cpuidle_install_idle_handler函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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

示例2: cpuidle_register_device

/**
 * cpuidle_register_device - registers a CPU's idle PM feature
 * @dev: the cpu
 */
int cpuidle_register_device(struct cpuidle_device *dev)
{
    int ret;
    struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu);

    if (!sys_dev)
        return -EINVAL;
    if (!try_module_get(cpuidle_curr_driver->owner))
        return -EINVAL;

    init_completion(&dev->kobj_unregister);

    mutex_lock(&cpuidle_lock);

    poll_idle_init(dev);

    per_cpu(cpuidle_devices, dev->cpu) = dev;
    list_add(&dev->device_list, &cpuidle_detected_devices);
    if ((ret = cpuidle_add_sysfs(sys_dev))) {
        mutex_unlock(&cpuidle_lock);
        module_put(cpuidle_curr_driver->owner);
        return ret;
    }

    cpuidle_enable_device(dev);
    cpuidle_install_idle_handler();

    mutex_unlock(&cpuidle_lock);

    return 0;

}
开发者ID:Tigrouzen,项目名称:k1099,代码行数:36,代码来源:cpuidle.c

示例3: cpuidle_resume

/* Currently used in suspend/resume path to resume cpuidle */
void cpuidle_resume(void)
{
	mutex_lock(&cpuidle_lock);
	cpuidle_install_idle_handler();
	mutex_unlock(&cpuidle_lock);
}
开发者ID:Snuzzo,项目名称:msm8974_G2_render_kernel,代码行数:7,代码来源:cpuidle.c


注:本文中的cpuidle_install_idle_handler函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。