| .. | .. |
|---|
| 28 | 28 | struct cpu_stop_done *done; |
|---|
| 29 | 29 | }; |
|---|
| 30 | 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 */ |
|---|
| 39 | +}; |
|---|
| 40 | + |
|---|
| 31 | 41 | int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg); |
|---|
| 32 | 42 | int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *arg); |
|---|
| 33 | 43 | bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg, |
|---|
| 34 | 44 | 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); |
|---|
| 37 | 45 | void stop_machine_park(int cpu); |
|---|
| 38 | 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); |
|---|
| 39 | 52 | |
|---|
| 40 | 53 | #else /* CONFIG_SMP */ |
|---|
| 41 | 54 | |
|---|
| .. | .. |
|---|
| 79 | 92 | } |
|---|
| 80 | 93 | |
|---|
| 81 | 94 | 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); |
|---|
| 96 | 95 | } |
|---|
| 97 | 96 | |
|---|
| 98 | 97 | #endif /* CONFIG_SMP */ |
|---|