diff options
Diffstat (limited to 'include/linux/memory.h')
-rw-r--r-- | include/linux/memory.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/linux/memory.h b/include/linux/memory.h index 45e93b468878..73817af8b480 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/node.h> | 18 | #include <linux/node.h> |
19 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
20 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
21 | #include <linux/notifier.h> | ||
21 | 22 | ||
22 | #define MIN_MEMORY_BLOCK_SIZE (1UL << SECTION_SIZE_BITS) | 23 | #define MIN_MEMORY_BLOCK_SIZE (1UL << SECTION_SIZE_BITS) |
23 | 24 | ||
@@ -114,9 +115,10 @@ extern void unregister_memory_notifier(struct notifier_block *nb); | |||
114 | extern int register_memory_isolate_notifier(struct notifier_block *nb); | 115 | extern int register_memory_isolate_notifier(struct notifier_block *nb); |
115 | extern void unregister_memory_isolate_notifier(struct notifier_block *nb); | 116 | extern void unregister_memory_isolate_notifier(struct notifier_block *nb); |
116 | extern int register_new_memory(int, struct mem_section *); | 117 | extern int register_new_memory(int, struct mem_section *); |
118 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
117 | extern int unregister_memory_section(struct mem_section *); | 119 | extern int unregister_memory_section(struct mem_section *); |
120 | #endif | ||
118 | extern int memory_dev_init(void); | 121 | extern int memory_dev_init(void); |
119 | extern int remove_memory_block(unsigned long, struct mem_section *, int); | ||
120 | extern int memory_notify(unsigned long val, void *v); | 122 | extern int memory_notify(unsigned long val, void *v); |
121 | extern int memory_isolate_notify(unsigned long val, void *v); | 123 | extern int memory_isolate_notify(unsigned long val, void *v); |
122 | extern struct memory_block *find_memory_block_hinted(struct mem_section *, | 124 | extern struct memory_block *find_memory_block_hinted(struct mem_section *, |
@@ -127,13 +129,18 @@ enum mem_add_context { BOOT, HOTPLUG }; | |||
127 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ | 129 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ |
128 | 130 | ||
129 | #ifdef CONFIG_MEMORY_HOTPLUG | 131 | #ifdef CONFIG_MEMORY_HOTPLUG |
130 | #define hotplug_memory_notifier(fn, pri) { \ | 132 | #define hotplug_memory_notifier(fn, pri) ({ \ |
131 | static __meminitdata struct notifier_block fn##_mem_nb =\ | 133 | static __meminitdata struct notifier_block fn##_mem_nb =\ |
132 | { .notifier_call = fn, .priority = pri }; \ | 134 | { .notifier_call = fn, .priority = pri };\ |
133 | register_memory_notifier(&fn##_mem_nb); \ | 135 | register_memory_notifier(&fn##_mem_nb); \ |
134 | } | 136 | }) |
137 | #define register_hotmemory_notifier(nb) register_memory_notifier(nb) | ||
138 | #define unregister_hotmemory_notifier(nb) unregister_memory_notifier(nb) | ||
135 | #else | 139 | #else |
136 | #define hotplug_memory_notifier(fn, pri) do { } while (0) | 140 | #define hotplug_memory_notifier(fn, pri) (0) |
141 | /* These aren't inline functions due to a GCC bug. */ | ||
142 | #define register_hotmemory_notifier(nb) ({ (void)(nb); 0; }) | ||
143 | #define unregister_hotmemory_notifier(nb) ({ (void)(nb); }) | ||
137 | #endif | 144 | #endif |
138 | 145 | ||
139 | /* | 146 | /* |