.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Uniprocessor-only support functions. The counterpart to kernel/smp.c |
---|
3 | 4 | */ |
---|
.. | .. |
---|
13 | 14 | { |
---|
14 | 15 | unsigned long flags; |
---|
15 | 16 | |
---|
16 | | - WARN_ON(cpu != 0); |
---|
| 17 | + if (cpu != 0) |
---|
| 18 | + return -ENXIO; |
---|
17 | 19 | |
---|
18 | 20 | local_irq_save(flags); |
---|
19 | 21 | func(info); |
---|
.. | .. |
---|
34 | 36 | } |
---|
35 | 37 | EXPORT_SYMBOL(smp_call_function_single_async); |
---|
36 | 38 | |
---|
37 | | -int on_each_cpu(smp_call_func_t func, void *info, int wait) |
---|
| 39 | +void on_each_cpu(smp_call_func_t func, void *info, int wait) |
---|
38 | 40 | { |
---|
39 | 41 | unsigned long flags; |
---|
40 | 42 | |
---|
41 | 43 | local_irq_save(flags); |
---|
42 | 44 | func(info); |
---|
43 | 45 | local_irq_restore(flags); |
---|
44 | | - return 0; |
---|
45 | 46 | } |
---|
46 | 47 | EXPORT_SYMBOL(on_each_cpu); |
---|
47 | 48 | |
---|
.. | .. |
---|
68 | 69 | * Preemption is disabled here to make sure the cond_func is called under the |
---|
69 | 70 | * same condtions in UP and SMP. |
---|
70 | 71 | */ |
---|
71 | | -void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info), |
---|
72 | | - smp_call_func_t func, void *info, bool wait, |
---|
73 | | - gfp_t gfp_flags) |
---|
| 72 | +void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func, |
---|
| 73 | + void *info, bool wait, const struct cpumask *mask) |
---|
74 | 74 | { |
---|
75 | 75 | unsigned long flags; |
---|
76 | 76 | |
---|
.. | .. |
---|
82 | 82 | } |
---|
83 | 83 | preempt_enable(); |
---|
84 | 84 | } |
---|
| 85 | +EXPORT_SYMBOL(on_each_cpu_cond_mask); |
---|
| 86 | + |
---|
| 87 | +void on_each_cpu_cond(smp_cond_func_t cond_func, smp_call_func_t func, |
---|
| 88 | + void *info, bool wait) |
---|
| 89 | +{ |
---|
| 90 | + on_each_cpu_cond_mask(cond_func, func, info, wait, NULL); |
---|
| 91 | +} |
---|
85 | 92 | EXPORT_SYMBOL(on_each_cpu_cond); |
---|
86 | 93 | |
---|
87 | 94 | int smp_call_on_cpu(unsigned int cpu, int (*func)(void *), void *par, bool phys) |
---|