hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/kernel/up.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Uniprocessor-only support functions. The counterpart to kernel/smp.c
34 */
....@@ -13,7 +14,8 @@
1314 {
1415 unsigned long flags;
1516
16
- WARN_ON(cpu != 0);
17
+ if (cpu != 0)
18
+ return -ENXIO;
1719
1820 local_irq_save(flags);
1921 func(info);
....@@ -34,14 +36,13 @@
3436 }
3537 EXPORT_SYMBOL(smp_call_function_single_async);
3638
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)
3840 {
3941 unsigned long flags;
4042
4143 local_irq_save(flags);
4244 func(info);
4345 local_irq_restore(flags);
44
- return 0;
4546 }
4647 EXPORT_SYMBOL(on_each_cpu);
4748
....@@ -68,9 +69,8 @@
6869 * Preemption is disabled here to make sure the cond_func is called under the
6970 * same condtions in UP and SMP.
7071 */
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)
7474 {
7575 unsigned long flags;
7676
....@@ -82,6 +82,13 @@
8282 }
8383 preempt_enable();
8484 }
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
+}
8592 EXPORT_SYMBOL(on_each_cpu_cond);
8693
8794 int smp_call_on_cpu(unsigned int cpu, int (*func)(void *), void *par, bool phys)