diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2006-06-27 05:54:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-27 20:32:41 -0400 |
commit | 39f4885c56073ecafd482d7e10dd7b17900fa312 (patch) | |
tree | 81a90a4b7bc4dae71613cce3e27da361b08ecb0a /include/linux/cpu.h | |
parent | 26c2143b63b8078d08d562733716de142927e17a (diff) |
[PATCH] cpu hotplug: add hotplug versions of cpu_notifier
Define new macros register_hotcpu_notifier() and unregister_hotcpu_notifier()
that redefines register_cpu_notifier() and unregister_cpu_notifier() for use
only when HOTPLUG_CPU is defined.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/cpu.h')
-rw-r--r-- | include/linux/cpu.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index cdfe471a70a1..a3caf6866bae 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -79,6 +79,8 @@ extern int lock_cpu_hotplug_interruptible(void); | |||
79 | { .notifier_call = fn, .priority = pri }; \ | 79 | { .notifier_call = fn, .priority = pri }; \ |
80 | register_cpu_notifier(&fn##_nb); \ | 80 | register_cpu_notifier(&fn##_nb); \ |
81 | } | 81 | } |
82 | #define register_hotcpu_notifier(nb) register_cpu_notifier(nb) | ||
83 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) | ||
82 | int cpu_down(unsigned int cpu); | 84 | int cpu_down(unsigned int cpu); |
83 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | 85 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) |
84 | #else | 86 | #else |
@@ -86,6 +88,8 @@ int cpu_down(unsigned int cpu); | |||
86 | #define unlock_cpu_hotplug() do { } while (0) | 88 | #define unlock_cpu_hotplug() do { } while (0) |
87 | #define lock_cpu_hotplug_interruptible() 0 | 89 | #define lock_cpu_hotplug_interruptible() 0 |
88 | #define hotcpu_notifier(fn, pri) | 90 | #define hotcpu_notifier(fn, pri) |
91 | #define register_hotcpu_notifier(nb) | ||
92 | #define unregister_hotcpu_notifier(nb) | ||
89 | 93 | ||
90 | /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ | 94 | /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ |
91 | static inline int cpu_is_offline(int cpu) { return 0; } | 95 | static inline int cpu_is_offline(int cpu) { return 0; } |