summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-01-22 19:00:26 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-01-22 19:00:26 -0800
commit672ab41e9381b6418cbdf17b39b51ffd64d07792 (patch)
tree72eb29bb865ca17f856c749dcb597deb7e4ae8f4 /include/linux
parent37b5d10afebe0d7c405543e925e7a010ddceb1f8 (diff)
[PATCH] Fix CPU hotplug in networking
The code directly accessed the "cpucontrol" semaphore used for CPU hotplug. That doesn't work all that well, since the semaphore doesn't even exist on UP.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpu.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 2f374d79f157..02579ec6b99c 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -37,7 +37,12 @@ extern int register_cpu_notifier(struct notifier_block *nb);
extern void unregister_cpu_notifier(struct notifier_block *nb);
int cpu_up(unsigned int cpu);
+
+#define lock_cpu_hotplug() down(&cpucontrol)
+#define unlock_cpu_hotplug() up(&cpucontrol)
+
#else
+
static inline int register_cpu_notifier(struct notifier_block *nb)
{
return 0;
@@ -45,6 +50,10 @@ static inline int register_cpu_notifier(struct notifier_block *nb)
static inline void unregister_cpu_notifier(struct notifier_block *nb)
{
}
+
+#define lock_cpu_hotplug() do { } while (0)
+#define unlock_cpu_hotplug() do { } while (0)
+
#endif /* CONFIG_SMP */
extern struct sysdev_class cpu_sysdev_class;