本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}
示例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 {
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}