diff options
Diffstat (limited to 'include/linux/stop_machine.h')
-rw-r--r-- | include/linux/stop_machine.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 092dc9b1ce7..2d04ea91676 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
@@ -94,7 +94,7 @@ static inline int try_stop_cpus(const struct cpumask *cpumask, | |||
94 | * stop_machine "Bogolock": stop the entire machine, disable | 94 | * stop_machine "Bogolock": stop the entire machine, disable |
95 | * interrupts. This is a very heavy lock, which is equivalent to | 95 | * interrupts. This is a very heavy lock, which is equivalent to |
96 | * grabbing every spinlock (and more). So the "read" side to such a | 96 | * grabbing every spinlock (and more). So the "read" side to such a |
97 | * lock is anything which disables preeempt. | 97 | * lock is anything which disables preemption. |
98 | */ | 98 | */ |
99 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) | 99 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) |
100 | 100 | ||
@@ -124,15 +124,19 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); | |||
124 | */ | 124 | */ |
125 | int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); | 125 | int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); |
126 | 126 | ||
127 | int 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 | ||
129 | static inline int __stop_machine(int (*fn)(void *), void *data, | 132 | static 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 | ||
149 | static 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 */ |