• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ smp_call_function_single函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: poll_channel

static void poll_channel(struct vmbus_channel *channel)
{
	if (channel->target_cpu != smp_processor_id())
		smp_call_function_single(channel->target_cpu,
					 hv_kvp_onchannelcallback,
					 channel, true);
	else
		hv_kvp_onchannelcallback(channel);
}
开发者ID:mantri,项目名称:lis-next,代码行数:9,代码来源:hv_kvp.c


示例2: hw_breakpoint_reset_notify

static int hw_breakpoint_reset_notify(struct notifier_block *self,
                                      unsigned long action,
                                      void *hcpu)
{
    int cpu = (long)hcpu;
    if (action == CPU_ONLINE)
        smp_call_function_single(cpu, reset_ctrl_regs, NULL, 1);
    return NOTIFY_OK;
}
开发者ID:shminer,项目名称:android_kernel_flounder,代码行数:9,代码来源:hw_breakpoint.c


示例3: tick_broadcast_on_off

/*
 * Powerstate information: The system enters/leaves a state, where
 * affected devices might stop.
 */
void tick_broadcast_on_off(unsigned long reason, int *oncpu)
{
	if (!cpu_isset(*oncpu, cpu_online_map))
		printk(KERN_ERR "tick-broadcast: ignoring broadcast for "
		       "offline CPU #%d\n", *oncpu);
	else
		smp_call_function_single(*oncpu, tick_do_broadcast_on_off,
					 &reason, 1);
}
开发者ID:kizukukoto,项目名称:WDN900_GPL,代码行数:13,代码来源:tick-broadcast.c


示例4: bts_trace_start

static void bts_trace_start(struct trace_array *tr)
{
	int cpu;

	tracing_reset_online_cpus(tr);

	for_each_cpu(cpu, cpu_possible_mask)
		smp_call_function_single(cpu, bts_trace_start_cpu, NULL, 1);
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:9,代码来源:trace_hw_branches.c


示例5: do_cpuid

static inline void do_cpuid(int cpu, u32 reg, u32 * data)
{
	struct cpuid_command cmd;

	cmd.reg = reg;
	cmd.data = data;

	smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1, 1);
}
开发者ID:AmesianX,项目名称:winkvm,代码行数:9,代码来源:cpuid.c


示例6: kvm_cpu_notify

static int __cpuinit kvm_cpu_notify(struct notifier_block *self,
				    unsigned long action, void *hcpu)
{
	int cpu = (unsigned long)hcpu;
	switch (action) {
	case CPU_ONLINE:
	case CPU_DOWN_FAILED:
	case CPU_ONLINE_FROZEN:
		smp_call_function_single(cpu, kvm_guest_cpu_online, NULL, 0);
		break;
	case CPU_DOWN_PREPARE:
	case CPU_DOWN_PREPARE_FROZEN:
		smp_call_function_single(cpu, kvm_guest_cpu_offline, NULL, 1);
		break;
	default:
		break;
	}
	return NOTIFY_OK;
}
开发者ID:seyko2,项目名称:openvz_rhel6_kernel_mirror,代码行数:19,代码来源:kvm.c


示例7: mtrr_save_state

/**
 * Save current fixed-range MTRR state of the BSP
 */
void mtrr_save_state(void)
{
	int cpu = get_cpu();

	if (cpu == 0)
		mtrr_save_fixed_ranges(NULL);
	else
		smp_call_function_single(0, mtrr_save_fixed_ranges, NULL, 1, 1);
	put_cpu();
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:13,代码来源:main.c


示例8: cpu_vsyscall_notifier

static int
cpu_vsyscall_notifier(struct notifier_block *n, unsigned long action, void *arg)
{
	long cpu = (long)arg;

	if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN)
		smp_call_function_single(cpu, cpu_vsyscall_init, NULL, 1);

	return NOTIFY_DONE;
}
开发者ID:24hours,项目名称:linux,代码行数:10,代码来源:vsyscall_64.c


示例9: set_pri_clk_src

/* Select a source on the primary MUX. */
static void set_pri_clk_src(struct scalable *sc, u32 pri_src_sel)
{
	int cpu = sc - drv.scalable;
	if (sc != &drv.scalable[L2] && cpu_online(cpu)) {
		struct set_clk_src_args args = {
			.sc = sc,
			.src_sel = pri_src_sel,
		};
		smp_call_function_single(cpu, __set_cpu_pri_clk_src, &args, 1);
	} else {
开发者ID:MH2033,项目名称:VIPER_KERNEL_KK_D802,代码行数:11,代码来源:acpuclock-krait.c


示例10: speedstep_target

/**
 * speedstep_target - set a new CPUFreq policy
 * @policy: new policy
 * @index: index of target frequency
 *
 * Sets a new CPUFreq policy.
 */
static int speedstep_target(struct cpufreq_policy *policy, unsigned int index)
{
	unsigned int policy_cpu;

	policy_cpu = cpumask_any_and(policy->cpus, cpu_online_mask);

	smp_call_function_single(policy_cpu, _speedstep_set_state, &index,
				 true);

	return 0;
}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:18,代码来源:speedstep-ich.c


示例11: cpu_notify

static int __cpuinit cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu)
{
	long cpu = (long) hcpu;

	switch (action)
	{
	case CPU_ONLINE:
	case CPU_ONLINE_FROZEN:
		set_cpu_irq_affinity(cpu);
		smp_call_function_single(cpu, start_pmu, &pmu_paused, 1);
		break;

	case CPU_DEAD:
	case CPU_DEAD_FROZEN:
		smp_call_function_single(cpu, stop_pmu, NULL, 1);

		break;
	}
	return NOTIFY_OK;
}
开发者ID:ashang,项目名称:xpenology-3.x,代码行数:20,代码来源:isr.c


示例12: speedstep_get

static unsigned int speedstep_get(unsigned int cpu)
{
	unsigned int speed;

	/* You're supposed to ensure CPU is online. */
	if (smp_call_function_single(cpu, get_freq_data, &speed, 1) != 0)
		BUG();

	pr_debug("detected %u kHz as current frequency\n", speed);
	return speed;
}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:11,代码来源:speedstep-ich.c


示例13: twd_cpufreq_transition

static int twd_cpufreq_transition(struct notifier_block *nb,
	unsigned long state, void *data)
{
	struct cpufreq_freqs *freqs = data;

	if (state == CPUFREQ_POSTCHANGE || state == CPUFREQ_RESUMECHANGE)
		smp_call_function_single(freqs->cpu, twd_update_frequency,
			NULL, 1);

	return NOTIFY_OK;
}
开发者ID:Blackburn29,项目名称:PsycoKernel,代码行数:11,代码来源:smp_twd.c


示例14: jtag_mm_etm_probe

static int jtag_mm_etm_probe(struct platform_device *pdev, uint32_t cpu)
{
	struct etm_ctx *etmdata;
	struct resource *res;
	struct device *dev = &pdev->dev;

	/* Allocate memory per cpu */
	etmdata = devm_kzalloc(dev, sizeof(struct etm_ctx), GFP_KERNEL);
	if (!etmdata)
		return -ENOMEM;

	etm[cpu] = etmdata;

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "etm-base");
	if (!res)
		return -ENODEV;

	etmdata->base = devm_ioremap(dev, res->start, resource_size(res));
	if (!etmdata->base)
		return -EINVAL;

	/* Allocate etm state save space per core */
	etmdata->state = devm_kzalloc(dev,
				      MAX_ETM_STATE_SIZE * sizeof(uint64_t),
				      GFP_KERNEL);
	if (!etmdata->state)
		return -ENOMEM;

	spin_lock_init(&etmdata->spinlock);
	mutex_init(&etmdata->mutex);

	if (cnt++ == 0)
		register_hotcpu_notifier(&jtag_mm_etm_notifier);

	if (!smp_call_function_single(cpu, etm_init_arch_data, etmdata,
				      1))
		etmdata->init = true;

	if (etmdata->init) {
		mutex_lock(&etmdata->mutex);
		if (etm_arch_supported(etmdata->arch)) {
			if (scm_get_feat_version(TZ_DBG_ETM_FEAT_ID) <
			    TZ_DBG_ETM_VER)
				etmdata->save_restore_enabled = true;
			else
				pr_info("etm save-restore supported by TZ\n");
		} else
			pr_info("etm arch %u not supported\n", etmdata->arch);
		etmdata->enable = true;
		mutex_unlock(&etmdata->mutex);
	}
	return 0;
}
开发者ID:AudioGod,项目名称:Gods_kernel_yu_msm8916,代码行数:53,代码来源:jtagv8-mm.c


示例15: show_pw20_state

static ssize_t show_pw20_state(struct device *dev,
				struct device_attribute *attr, char *buf)
{
	u32 value;
	unsigned int cpu = dev->id;

	smp_call_function_single(cpu, do_show_pwrmgtcr0, &value, 1);

	value &= PWRMGTCR0_PW20_WAIT;

	return sprintf(buf, "%u\n", value ? 1 : 0);
}
开发者ID:1800alex,项目名称:linux,代码行数:12,代码来源:sysfs.c


示例16: rdmsr_safe_on_cpu

int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
{
	int err;
	struct msr_info rv;

	rv.msr_no = msr_no;
	err = smp_call_function_single(cpu, __rdmsr_safe_on_cpu, &rv, 1);
	*l = rv.l;
	*h = rv.h;

	return err ? err : rv.err;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:12,代码来源:msr-on-cpu.c


示例17: wrmsr_safe_on_cpu

int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
{
	int err;
	struct msr_info rv;

	rv.msr_no = msr_no;
	rv.l = l;
	rv.h = h;
	err = smp_call_function_single(cpu, __wrmsr_safe_on_cpu, &rv, 1);

	return err ? err : rv.err;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:12,代码来源:msr-on-cpu.c


示例18: boot_secondary

static int boot_secondary(unsigned int cpu, struct task_struct *ts)
{
	unsigned long timeout = jiffies + msecs_to_jiffies(1000);
	unsigned long ccount;
	int i;

#ifdef CONFIG_HOTPLUG_CPU
	WRITE_ONCE(cpu_start_id, cpu);
	/* Pairs with the third memw in the cpu_restart */
	mb();
	system_flush_invalidate_dcache_range((unsigned long)&cpu_start_id,
					     sizeof(cpu_start_id));
#endif
	smp_call_function_single(0, mx_cpu_start, (void *)cpu, 1);

	for (i = 0; i < 2; ++i) {
		do
			ccount = get_ccount();
		while (!ccount);

		WRITE_ONCE(cpu_start_ccount, ccount);

		do {
			/*
			 * Pairs with the first two memws in the
			 * .Lboot_secondary.
			 */
			mb();
			ccount = READ_ONCE(cpu_start_ccount);
		} while (ccount && time_before(jiffies, timeout));

		if (ccount) {
			smp_call_function_single(0, mx_cpu_stop,
						 (void *)cpu, 1);
			WRITE_ONCE(cpu_start_ccount, 0);
			return -EIO;
		}
	}
	return 0;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:40,代码来源:smp.c


示例19: kfm_cache_status_on_cpu

/*
 * return:
 * 		0: enable
 *		1: disable
 *		-1: error
 */
int 
kfm_cache_status_on_cpu(int cpu)
{
	int ret = 0;
	
	g_cache_status = 0;
	if((ret = smp_call_function_single(cpu, __kfm_caches_status, NULL, 1)))
		return ret;

	KFM_DBG(6, "get cpu %d cache status", cpu);

	return g_cache_status;
}
开发者ID:kadoma,项目名称:fms,代码行数:19,代码来源:kfm_cache.c


示例20: cpuhp_report_idle_dead

void cpuhp_report_idle_dead(void)
{
	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);

	BUG_ON(st->state != CPUHP_AP_OFFLINE);
	rcu_report_dead(smp_processor_id());
	st->state = CPUHP_AP_IDLE_DEAD;
	/*
	 * We cannot call complete after rcu_report_dead() so we delegate it
	 * to an online cpu.
	 */
	smp_call_function_single(cpumask_first(cpu_online_mask),
				 cpuhp_complete_idle_dead, st, 0);
}
开发者ID:545191228,项目名称:linux,代码行数:14,代码来源:cpu.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ smp_mb函数代码示例发布时间:2022-05-30
下一篇:
C++ smooth函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap