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


C++ smp_call_function_single函数代码示例

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


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


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