aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memory.h
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /include/linux/memory.h
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'include/linux/memory.h')
-rw-r--r--include/linux/memory.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 37fa19b34ef5..85582e1bcee9 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -36,6 +36,8 @@ struct memory_block {
36 struct sys_device sysdev; 36 struct sys_device sysdev;
37}; 37};
38 38
39int arch_get_memory_phys_device(unsigned long start_pfn);
40
39/* These states are exposed to userspace as text strings in sysfs */ 41/* These states are exposed to userspace as text strings in sysfs */
40#define MEM_ONLINE (1<<0) /* exposed to userspace */ 42#define MEM_ONLINE (1<<0) /* exposed to userspace */
41#define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */ 43#define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */
@@ -50,6 +52,19 @@ struct memory_notify {
50 int status_change_nid; 52 int status_change_nid;
51}; 53};
52 54
55/*
56 * During pageblock isolation, count the number of pages within the
57 * range [start_pfn, start_pfn + nr_pages) which are owned by code
58 * in the notifier chain.
59 */
60#define MEM_ISOLATE_COUNT (1<<0)
61
62struct memory_isolate_notify {
63 unsigned long start_pfn; /* Start of range to check */
64 unsigned int nr_pages; /* # pages in range to check */
65 unsigned int pages_found; /* # pages owned found by callbacks */
66};
67
53struct notifier_block; 68struct notifier_block;
54struct mem_section; 69struct mem_section;
55 70
@@ -76,14 +91,28 @@ static inline int memory_notify(unsigned long val, void *v)
76{ 91{
77 return 0; 92 return 0;
78} 93}
94static inline int register_memory_isolate_notifier(struct notifier_block *nb)
95{
96 return 0;
97}
98static inline void unregister_memory_isolate_notifier(struct notifier_block *nb)
99{
100}
101static inline int memory_isolate_notify(unsigned long val, void *v)
102{
103 return 0;
104}
79#else 105#else
80extern int register_memory_notifier(struct notifier_block *nb); 106extern int register_memory_notifier(struct notifier_block *nb);
81extern void unregister_memory_notifier(struct notifier_block *nb); 107extern void unregister_memory_notifier(struct notifier_block *nb);
108extern int register_memory_isolate_notifier(struct notifier_block *nb);
109extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
82extern int register_new_memory(int, struct mem_section *); 110extern int register_new_memory(int, struct mem_section *);
83extern int unregister_memory_section(struct mem_section *); 111extern int unregister_memory_section(struct mem_section *);
84extern int memory_dev_init(void); 112extern int memory_dev_init(void);
85extern int remove_memory_block(unsigned long, struct mem_section *, int); 113extern int remove_memory_block(unsigned long, struct mem_section *, int);
86extern int memory_notify(unsigned long val, void *v); 114extern int memory_notify(unsigned long val, void *v);
115extern int memory_isolate_notify(unsigned long val, void *v);
87extern struct memory_block *find_memory_block(struct mem_section *); 116extern struct memory_block *find_memory_block(struct mem_section *);
88#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) 117#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
89enum mem_add_context { BOOT, HOTPLUG }; 118enum mem_add_context { BOOT, HOTPLUG };