本文整理汇总了C++中cpu_notify函数的典型用法代码示例。如果您正苦于以下问题:C++ cpu_notify函数的具体用法?C++ cpu_notify怎么用?C++ cpu_notify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cpu_notify函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: take_cpu_down
static int __ref take_cpu_down(void *_param)
{
struct take_cpu_down_param *param = _param;
int err;
err = __cpu_disable();
if (err < 0)
return err;
cpu_notify(CPU_DYING | param->mod, param->hcpu);
return 0;
}
开发者ID:ivanmeler,项目名称:android_kernel_htc_g3u,代码行数:13,代码来源:cpu.c
示例2: take_cpu_down
/* Take this CPU down. */
static int __ref take_cpu_down(void *_param)
{
struct take_cpu_down_param *param = _param;
int err;
/* Ensure this CPU doesn't handle any more interrupts. */
err = __cpu_disable();
if (err < 0)
return err;
cpu_notify(CPU_DYING | param->mod, param->hcpu);
return 0;
}
开发者ID:Banjo0917,项目名称:mt6577_kernel3.4,代码行数:14,代码来源:cpu.c
示例3: _cpu_up
/* Requires cpu_add_remove_lock to be held */
static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
{
int ret, nr_calls = 0;
void *hcpu = (void *)(long)cpu;
unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0;
struct task_struct *idle;
if (cpu_online(cpu) || !cpu_present(cpu))
return -EINVAL;
cpu_hotplug_begin();
idle = idle_thread_get(cpu);
if (IS_ERR(idle)) {
ret = PTR_ERR(idle);
goto out;
}
ret = smpboot_create_threads(cpu);
if (ret)
goto out;
ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls);
if (ret) {
nr_calls--;
printk(KERN_WARNING "%s: attempt to bring up CPU %u failed\n",
__func__, cpu);
goto out_notify;
}
/* Arch-specific enabling code. */
ret = __cpu_up(cpu);
if (ret != 0)
goto out_notify;
BUG_ON(!cpu_online(cpu));
/* Wake the per cpu threads */
smpboot_unpark_threads(cpu);
/* Now call notifier in preparation. */
cpu_notify(CPU_ONLINE | mod, hcpu);
out_notify:
if (ret != 0)
__cpu_notify(CPU_UP_CANCELED | mod, hcpu, nr_calls, NULL);
out:
cpu_hotplug_done();
trace_sched_cpu_hotplug(cpu, ret, 1);
return ret;
}
开发者ID:robcore,项目名称:nuk3rn3l_htc_msm8960-lollipop,代码行数:52,代码来源:cpu.c
示例4: bringup_cpu
static int bringup_cpu(unsigned int cpu)
{
struct task_struct *idle = idle_thread_get(cpu);
int ret;
/* Arch-specific enabling code. */
ret = __cpu_up(cpu, idle);
if (ret) {
cpu_notify(CPU_UP_CANCELED, cpu);
return ret;
}
ret = bringup_wait_for_ap(cpu);
BUG_ON(!cpu_online(cpu));
return ret;
}
开发者ID:545191228,项目名称:linux,代码行数:15,代码来源:cpu.c
示例5: take_cpu_down
/* Take this CPU down. */
static int take_cpu_down(void *_param)
{
struct take_cpu_down_param *param = _param;
int err;
/* Ensure this CPU doesn't handle any more interrupts. */
err = __cpu_disable();
if (err < 0)
return err;
cpu_notify(CPU_DYING | param->mod, param->hcpu);
/* Give up timekeeping duties */
tick_handover_do_timer();
/* Park the stopper thread */
stop_machine_park((long)param->hcpu);
return 0;
}
开发者ID:andy-shev,项目名称:linux,代码行数:18,代码来源:cpu.c
示例6: take_cpu_down
/* Take this CPU down. */
static int __ref take_cpu_down(void *_param)
{
struct take_cpu_down_param *param = _param;
int err;
err=migration_call(&migration_notifier, CPU_DYING | param->mod, param->hcpu);
if(err==NOTIFY_BAD){
printk("[Warning]take_cpu_down: CPU%lu donw failed!\n",(long)param->hcpu);
return err ;
}
/* Ensure this CPU doesn't handle any more interrupts. */
err = __cpu_disable();
if (err < 0)
return err;
cpu_notify(CPU_DYING | param->mod, param->hcpu);
return 0;
}
开发者ID:dadavid,项目名称:asus_kernel_tf101,代码行数:19,代码来源:cpu.c
示例7: take_cpu_down
/* Take this CPU down. */
static int __ref take_cpu_down(void *_param)
{
struct take_cpu_down_param *param = _param;
unsigned int cpu = (unsigned long)param->hcpu;
int err;
/* Ensure this CPU doesn't handle any more interrupts. */
err = __cpu_disable();
if (err < 0)
return err;
cpu_notify(CPU_DYING | param->mod, param->hcpu);
if (task_cpu(param->caller) == cpu)
move_task_off_dead_cpu(cpu, param->caller);
/* Force idle task to run as soon as we yield: it should
immediately notice cpu is offline and die quickly. */
sched_idle_next();
return 0;
}
开发者ID:myfluxi,项目名称:xxKernel,代码行数:21,代码来源:cpu.c
示例8: _cpu_up
static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
{
int ret, nr_calls = 0;
void *hcpu = (void *)(long)cpu;
unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0;
if (cpu_online(cpu) || !cpu_present(cpu))
return -EINVAL;
cpu_hotplug_begin();
ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls);
if (ret) {
nr_calls--;
printk(KERN_WARNING "%s: attempt to bring up CPU %u failed\n",
__func__, cpu);
goto out_notify;
}
ret = __cpu_up(cpu);
if (ret != 0)
goto out_notify;
BUG_ON(!cpu_online(cpu));
cpu_notify(CPU_ONLINE | mod, hcpu);
#ifdef CONFIG_HTC_ACPU_DEBUG
{
unsigned int status = 1;
msm_proc_comm(PCOM_BACKUP_CPU_STATUS, (unsigned*)&cpu, (unsigned*) &status);
}
#endif
out_notify:
if (ret != 0)
__cpu_notify(CPU_UP_CANCELED | mod, hcpu, nr_calls, NULL);
cpu_hotplug_done();
return ret;
}
开发者ID:ivanmeler,项目名称:android_kernel_htc_g3u,代码行数:40,代码来源:cpu.c
示例9: _cpu_up
/* Requires cpu_add_remove_lock to be held */
static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
{
int ret, nr_calls = 0;
void *hcpu = (void *)(long)cpu;
unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0;
if (cpu_online(cpu) || !cpu_present(cpu))
return -EINVAL;
cpu_hotplug_begin();
ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls);
if (ret) {
nr_calls--;
printk(KERN_WARNING "%s: attempt to bring up CPU %u failed\n",
__func__, cpu);
goto out_notify;
}
/* Arch-specific enabling code. */
ret = __cpu_up(cpu);
if (ret != 0)
goto out_notify;
BUG_ON(!cpu_online(cpu));
/* Now call notifier in preparation. */
cpu_notify(CPU_ONLINE | mod, hcpu);
#ifdef CONFIG_MT_LOAD_BALANCE_PROFILER
mt_lbprof_update_state(cpu, MT_LBPROF_NO_TASK_STATE);
#endif
out_notify:
if (ret != 0)
__cpu_notify(CPU_UP_CANCELED | mod, hcpu, nr_calls, NULL);
cpu_hotplug_done();
return ret;
}
开发者ID:Banjo0917,项目名称:mt6577_kernel3.4,代码行数:38,代码来源:cpu.c
示例10: notify_online
static int notify_online(unsigned int cpu)
{
cpu_notify(CPU_ONLINE, cpu);
return 0;
}
开发者ID:545191228,项目名称:linux,代码行数:5,代码来源:cpu.c
示例11: notify_starting
static int notify_starting(unsigned int cpu)
{
cpu_notify(CPU_STARTING, cpu);
return 0;
}
开发者ID:545191228,项目名称:linux,代码行数:5,代码来源:cpu.c
示例12: notify_dying
static int notify_dying(unsigned int cpu)
{
cpu_notify(CPU_DYING, cpu);
return 0;
}
开发者ID:545191228,项目名称:linux,代码行数:5,代码来源:cpu.c
示例13: cpu_notify_nofail
static void cpu_notify_nofail(unsigned long val, unsigned int cpu)
{
BUG_ON(cpu_notify(val, cpu));
}
开发者ID:545191228,项目名称:linux,代码行数:4,代码来源:cpu.c
注:本文中的cpu_notify函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论