diff options
Diffstat (limited to 'include/linux/cpu.h')
-rw-r--r-- | include/linux/cpu.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 08d50c53aab..3fef7d67aed 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -31,18 +31,23 @@ struct cpu { | |||
31 | struct sys_device sysdev; | 31 | struct sys_device sysdev; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | extern int register_cpu(struct cpu *, int, struct node *); | 34 | extern int register_cpu(struct cpu *cpu, int num); |
35 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); | 35 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); |
36 | #ifdef CONFIG_HOTPLUG_CPU | 36 | #ifdef CONFIG_HOTPLUG_CPU |
37 | extern void unregister_cpu(struct cpu *, struct node *); | 37 | extern void unregister_cpu(struct cpu *cpu); |
38 | #endif | 38 | #endif |
39 | struct notifier_block; | 39 | struct notifier_block; |
40 | 40 | ||
41 | #ifdef CONFIG_SMP | 41 | #ifdef CONFIG_SMP |
42 | /* Need to know about CPUs going up/down? */ | 42 | /* Need to know about CPUs going up/down? */ |
43 | extern int register_cpu_notifier(struct notifier_block *nb); | 43 | extern int register_cpu_notifier(struct notifier_block *nb); |
44 | #ifdef CONFIG_HOTPLUG_CPU | ||
44 | extern void unregister_cpu_notifier(struct notifier_block *nb); | 45 | extern void unregister_cpu_notifier(struct notifier_block *nb); |
45 | extern int current_in_cpu_hotplug(void); | 46 | #else |
47 | static inline void unregister_cpu_notifier(struct notifier_block *nb) | ||
48 | { | ||
49 | } | ||
50 | #endif | ||
46 | 51 | ||
47 | int cpu_up(unsigned int cpu); | 52 | int cpu_up(unsigned int cpu); |
48 | 53 | ||
@@ -55,10 +60,6 @@ static inline int register_cpu_notifier(struct notifier_block *nb) | |||
55 | static inline void unregister_cpu_notifier(struct notifier_block *nb) | 60 | static inline void unregister_cpu_notifier(struct notifier_block *nb) |
56 | { | 61 | { |
57 | } | 62 | } |
58 | static inline int current_in_cpu_hotplug(void) | ||
59 | { | ||
60 | return 0; | ||
61 | } | ||
62 | 63 | ||
63 | #endif /* CONFIG_SMP */ | 64 | #endif /* CONFIG_SMP */ |
64 | extern struct sysdev_class cpu_sysdev_class; | 65 | extern struct sysdev_class cpu_sysdev_class; |
@@ -67,22 +68,33 @@ extern struct sysdev_class cpu_sysdev_class; | |||
67 | /* Stop CPUs going up and down. */ | 68 | /* Stop CPUs going up and down. */ |
68 | extern void lock_cpu_hotplug(void); | 69 | extern void lock_cpu_hotplug(void); |
69 | extern void unlock_cpu_hotplug(void); | 70 | extern void unlock_cpu_hotplug(void); |
70 | extern int lock_cpu_hotplug_interruptible(void); | ||
71 | #define hotcpu_notifier(fn, pri) { \ | 71 | #define hotcpu_notifier(fn, pri) { \ |
72 | static struct notifier_block fn##_nb = \ | 72 | static struct notifier_block fn##_nb = \ |
73 | { .notifier_call = fn, .priority = pri }; \ | 73 | { .notifier_call = fn, .priority = pri }; \ |
74 | register_cpu_notifier(&fn##_nb); \ | 74 | register_cpu_notifier(&fn##_nb); \ |
75 | } | 75 | } |
76 | #define register_hotcpu_notifier(nb) register_cpu_notifier(nb) | ||
77 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) | ||
76 | int cpu_down(unsigned int cpu); | 78 | int cpu_down(unsigned int cpu); |
77 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | 79 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) |
78 | #else | 80 | #else |
79 | #define lock_cpu_hotplug() do { } while (0) | 81 | #define lock_cpu_hotplug() do { } while (0) |
80 | #define unlock_cpu_hotplug() do { } while (0) | 82 | #define unlock_cpu_hotplug() do { } while (0) |
81 | #define lock_cpu_hotplug_interruptible() 0 | 83 | #define lock_cpu_hotplug_interruptible() 0 |
82 | #define hotcpu_notifier(fn, pri) | 84 | #define hotcpu_notifier(fn, pri) do { } while (0) |
85 | #define register_hotcpu_notifier(nb) do { } while (0) | ||
86 | #define unregister_hotcpu_notifier(nb) do { } while (0) | ||
83 | 87 | ||
84 | /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ | 88 | /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ |
85 | static inline int cpu_is_offline(int cpu) { return 0; } | 89 | static inline int cpu_is_offline(int cpu) { return 0; } |
86 | #endif | 90 | #endif |
87 | 91 | ||
92 | #ifdef CONFIG_SUSPEND_SMP | ||
93 | extern int disable_nonboot_cpus(void); | ||
94 | extern void enable_nonboot_cpus(void); | ||
95 | #else | ||
96 | static inline int disable_nonboot_cpus(void) { return 0; } | ||
97 | static inline void enable_nonboot_cpus(void) {} | ||
98 | #endif | ||
99 | |||
88 | #endif /* _LINUX_CPU_H_ */ | 100 | #endif /* _LINUX_CPU_H_ */ |