hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/stop_machine.h
....@@ -28,14 +28,27 @@
2828 struct cpu_stop_done *done;
2929 };
3030
31
+/*
32
+ * Structure to determine completion condition and record errors. May
33
+ * be shared by works on different cpus.
34
+ */
35
+struct cpu_stop_done {
36
+ atomic_t nr_todo; /* nr left to execute */
37
+ int ret; /* collected return value */
38
+ struct completion completion; /* fired if nr_todo reaches 0 */
39
+};
40
+
3141 int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg);
3242 int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *arg);
3343 bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
3444 struct cpu_stop_work *work_buf);
35
-int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
36
-int try_stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
3745 void stop_machine_park(int cpu);
3846 void stop_machine_unpark(int cpu);
47
+void stop_machine_yield(const struct cpumask *cpumask);
48
+int stop_one_cpu_async(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
49
+ struct cpu_stop_work *work_buf,
50
+ struct cpu_stop_done *done);
51
+void cpu_stop_work_wait(struct cpu_stop_work *work_buf);
3952
4053 #else /* CONFIG_SMP */
4154
....@@ -79,20 +92,6 @@
7992 }
8093
8194 return false;
82
-}
83
-
84
-static inline int stop_cpus(const struct cpumask *cpumask,
85
- cpu_stop_fn_t fn, void *arg)
86
-{
87
- if (cpumask_test_cpu(raw_smp_processor_id(), cpumask))
88
- return stop_one_cpu(raw_smp_processor_id(), fn, arg);
89
- return -ENOENT;
90
-}
91
-
92
-static inline int try_stop_cpus(const struct cpumask *cpumask,
93
- cpu_stop_fn_t fn, void *arg)
94
-{
95
- return stop_cpus(cpumask, fn, arg);
9695 }
9796
9897 #endif /* CONFIG_SMP */