diff options
| author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
|---|---|---|
| committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
| commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
| tree | 644b88f8a71896307d71438e9b3af49126ffb22b /include/linux/memory.h | |
| parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
| parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (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.h | 29 |
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 | ||
| 39 | int 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 | |||
| 62 | struct 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 | |||
| 53 | struct notifier_block; | 68 | struct notifier_block; |
| 54 | struct mem_section; | 69 | struct 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 | } |
| 94 | static inline int register_memory_isolate_notifier(struct notifier_block *nb) | ||
| 95 | { | ||
| 96 | return 0; | ||
| 97 | } | ||
| 98 | static inline void unregister_memory_isolate_notifier(struct notifier_block *nb) | ||
| 99 | { | ||
| 100 | } | ||
| 101 | static inline int memory_isolate_notify(unsigned long val, void *v) | ||
| 102 | { | ||
| 103 | return 0; | ||
| 104 | } | ||
| 79 | #else | 105 | #else |
| 80 | extern int register_memory_notifier(struct notifier_block *nb); | 106 | extern int register_memory_notifier(struct notifier_block *nb); |
| 81 | extern void unregister_memory_notifier(struct notifier_block *nb); | 107 | extern void unregister_memory_notifier(struct notifier_block *nb); |
| 108 | extern int register_memory_isolate_notifier(struct notifier_block *nb); | ||
| 109 | extern void unregister_memory_isolate_notifier(struct notifier_block *nb); | ||
| 82 | extern int register_new_memory(int, struct mem_section *); | 110 | extern int register_new_memory(int, struct mem_section *); |
| 83 | extern int unregister_memory_section(struct mem_section *); | 111 | extern int unregister_memory_section(struct mem_section *); |
| 84 | extern int memory_dev_init(void); | 112 | extern int memory_dev_init(void); |
| 85 | extern int remove_memory_block(unsigned long, struct mem_section *, int); | 113 | extern int remove_memory_block(unsigned long, struct mem_section *, int); |
| 86 | extern int memory_notify(unsigned long val, void *v); | 114 | extern int memory_notify(unsigned long val, void *v); |
| 115 | extern int memory_isolate_notify(unsigned long val, void *v); | ||
| 87 | extern struct memory_block *find_memory_block(struct mem_section *); | 116 | extern 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) |
| 89 | enum mem_add_context { BOOT, HOTPLUG }; | 118 | enum mem_add_context { BOOT, HOTPLUG }; |
