diff options
Diffstat (limited to 'include/linux/memory.h')
-rw-r--r-- | include/linux/memory.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/memory.h b/include/linux/memory.h index 37fa19b34ef5..1adfe779eb99 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -50,6 +50,19 @@ struct memory_notify { | |||
50 | int status_change_nid; | 50 | int status_change_nid; |
51 | }; | 51 | }; |
52 | 52 | ||
53 | /* | ||
54 | * During pageblock isolation, count the number of pages within the | ||
55 | * range [start_pfn, start_pfn + nr_pages) which are owned by code | ||
56 | * in the notifier chain. | ||
57 | */ | ||
58 | #define MEM_ISOLATE_COUNT (1<<0) | ||
59 | |||
60 | struct memory_isolate_notify { | ||
61 | unsigned long start_pfn; /* Start of range to check */ | ||
62 | unsigned int nr_pages; /* # pages in range to check */ | ||
63 | unsigned int pages_found; /* # pages owned found by callbacks */ | ||
64 | }; | ||
65 | |||
53 | struct notifier_block; | 66 | struct notifier_block; |
54 | struct mem_section; | 67 | struct mem_section; |
55 | 68 | ||
@@ -76,14 +89,28 @@ static inline int memory_notify(unsigned long val, void *v) | |||
76 | { | 89 | { |
77 | return 0; | 90 | return 0; |
78 | } | 91 | } |
92 | static inline int register_memory_isolate_notifier(struct notifier_block *nb) | ||
93 | { | ||
94 | return 0; | ||
95 | } | ||
96 | static inline void unregister_memory_isolate_notifier(struct notifier_block *nb) | ||
97 | { | ||
98 | } | ||
99 | static inline int memory_isolate_notify(unsigned long val, void *v) | ||
100 | { | ||
101 | return 0; | ||
102 | } | ||
79 | #else | 103 | #else |
80 | extern int register_memory_notifier(struct notifier_block *nb); | 104 | extern int register_memory_notifier(struct notifier_block *nb); |
81 | extern void unregister_memory_notifier(struct notifier_block *nb); | 105 | extern void unregister_memory_notifier(struct notifier_block *nb); |
106 | extern int register_memory_isolate_notifier(struct notifier_block *nb); | ||
107 | extern void unregister_memory_isolate_notifier(struct notifier_block *nb); | ||
82 | extern int register_new_memory(int, struct mem_section *); | 108 | extern int register_new_memory(int, struct mem_section *); |
83 | extern int unregister_memory_section(struct mem_section *); | 109 | extern int unregister_memory_section(struct mem_section *); |
84 | extern int memory_dev_init(void); | 110 | extern int memory_dev_init(void); |
85 | extern int remove_memory_block(unsigned long, struct mem_section *, int); | 111 | extern int remove_memory_block(unsigned long, struct mem_section *, int); |
86 | extern int memory_notify(unsigned long val, void *v); | 112 | extern int memory_notify(unsigned long val, void *v); |
113 | extern int memory_isolate_notify(unsigned long val, void *v); | ||
87 | extern struct memory_block *find_memory_block(struct mem_section *); | 114 | extern struct memory_block *find_memory_block(struct mem_section *); |
88 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) | 115 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) |
89 | enum mem_add_context { BOOT, HOTPLUG }; | 116 | enum mem_add_context { BOOT, HOTPLUG }; |