.. | .. |
---|
26 | 26 | cpu_stop_fn_t fn; |
---|
27 | 27 | void *arg; |
---|
28 | 28 | struct cpu_stop_done *done; |
---|
29 | | - /* Did not run due to disabled stopper; for nowait debug checks */ |
---|
30 | | - bool disabled; |
---|
| 29 | +}; |
---|
| 30 | + |
---|
| 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 */ |
---|
31 | 39 | }; |
---|
32 | 40 | |
---|
33 | 41 | int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg); |
---|
34 | 42 | int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *arg); |
---|
35 | 43 | bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg, |
---|
36 | 44 | struct cpu_stop_work *work_buf); |
---|
37 | | -int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg); |
---|
38 | | -int try_stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg); |
---|
39 | 45 | void stop_machine_park(int cpu); |
---|
40 | 46 | 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); |
---|
41 | 52 | |
---|
42 | 53 | #else /* CONFIG_SMP */ |
---|
43 | 54 | |
---|
.. | .. |
---|
81 | 92 | } |
---|
82 | 93 | |
---|
83 | 94 | return false; |
---|
84 | | -} |
---|
85 | | - |
---|
86 | | -static inline int stop_cpus(const struct cpumask *cpumask, |
---|
87 | | - cpu_stop_fn_t fn, void *arg) |
---|
88 | | -{ |
---|
89 | | - if (cpumask_test_cpu(raw_smp_processor_id(), cpumask)) |
---|
90 | | - return stop_one_cpu(raw_smp_processor_id(), fn, arg); |
---|
91 | | - return -ENOENT; |
---|
92 | | -} |
---|
93 | | - |
---|
94 | | -static inline int try_stop_cpus(const struct cpumask *cpumask, |
---|
95 | | - cpu_stop_fn_t fn, void *arg) |
---|
96 | | -{ |
---|
97 | | - return stop_cpus(cpumask, fn, arg); |
---|
98 | 95 | } |
---|
99 | 96 | |
---|
100 | 97 | #endif /* CONFIG_SMP */ |
---|