aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/stop_machine.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/stop_machine.h')
-rw-r--r--include/linux/stop_machine.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 092dc9b1ce7d..4a9d0c7edc65 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -124,15 +124,19 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
124 */ 124 */
125int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); 125int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
126 126
127int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
128 const struct cpumask *cpus);
129
127#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 130#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */
128 131
129static inline int __stop_machine(int (*fn)(void *), void *data, 132static inline int __stop_machine(int (*fn)(void *), void *data,
130 const struct cpumask *cpus) 133 const struct cpumask *cpus)
131{ 134{
135 unsigned long flags;
132 int ret; 136 int ret;
133 local_irq_disable(); 137 local_irq_save(flags);
134 ret = fn(data); 138 ret = fn(data);
135 local_irq_enable(); 139 local_irq_restore(flags);
136 return ret; 140 return ret;
137} 141}
138 142
@@ -142,5 +146,11 @@ static inline int stop_machine(int (*fn)(void *), void *data,
142 return __stop_machine(fn, data, cpus); 146 return __stop_machine(fn, data, cpus);
143} 147}
144 148
149static inline int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
150 const struct cpumask *cpus)
151{
152 return __stop_machine(fn, data, cpus);
153}
154
145#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 155#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */
146#endif /* _LINUX_STOP_MACHINE */ 156#endif /* _LINUX_STOP_MACHINE */