| .. | .. |
|---|
| 25 | 25 | |
|---|
| 26 | 26 | struct memory_block { |
|---|
| 27 | 27 | unsigned long start_section_nr; |
|---|
| 28 | | - unsigned long end_section_nr; |
|---|
| 29 | 28 | unsigned long state; /* serialized by the dev->lock */ |
|---|
| 30 | | - int section_count; /* serialized by mem_sysfs_mutex */ |
|---|
| 31 | 29 | int online_type; /* for passing data to online routine */ |
|---|
| 32 | | - int phys_device; /* to which fru does this belong? */ |
|---|
| 33 | | - void *hw; /* optional pointer to fw/hw data */ |
|---|
| 34 | | - int (*phys_callback)(struct memory_block *); |
|---|
| 35 | | - struct device dev; |
|---|
| 36 | 30 | int nid; /* NID for this memory block */ |
|---|
| 31 | + struct device dev; |
|---|
| 37 | 32 | }; |
|---|
| 38 | 33 | |
|---|
| 39 | 34 | int arch_get_memory_phys_device(unsigned long start_pfn); |
|---|
| .. | .. |
|---|
| 56 | 51 | int status_change_nid; |
|---|
| 57 | 52 | }; |
|---|
| 58 | 53 | |
|---|
| 59 | | -/* |
|---|
| 60 | | - * During pageblock isolation, count the number of pages within the |
|---|
| 61 | | - * range [start_pfn, start_pfn + nr_pages) which are owned by code |
|---|
| 62 | | - * in the notifier chain. |
|---|
| 63 | | - */ |
|---|
| 64 | | -#define MEM_ISOLATE_COUNT (1<<0) |
|---|
| 65 | | - |
|---|
| 66 | | -struct memory_isolate_notify { |
|---|
| 67 | | - unsigned long start_pfn; /* Start of range to check */ |
|---|
| 68 | | - unsigned int nr_pages; /* # pages in range to check */ |
|---|
| 69 | | - unsigned int pages_found; /* # pages owned found by callbacks */ |
|---|
| 70 | | -}; |
|---|
| 71 | | - |
|---|
| 72 | 54 | struct notifier_block; |
|---|
| 73 | 55 | struct mem_section; |
|---|
| 74 | 56 | |
|---|
| .. | .. |
|---|
| 80 | 62 | #define IPC_CALLBACK_PRI 10 |
|---|
| 81 | 63 | |
|---|
| 82 | 64 | #ifndef CONFIG_MEMORY_HOTPLUG_SPARSE |
|---|
| 83 | | -static inline int memory_dev_init(void) |
|---|
| 65 | +static inline void memory_dev_init(void) |
|---|
| 84 | 66 | { |
|---|
| 85 | | - return 0; |
|---|
| 67 | + return; |
|---|
| 86 | 68 | } |
|---|
| 87 | 69 | static inline int register_memory_notifier(struct notifier_block *nb) |
|---|
| 88 | 70 | { |
|---|
| .. | .. |
|---|
| 95 | 77 | { |
|---|
| 96 | 78 | return 0; |
|---|
| 97 | 79 | } |
|---|
| 98 | | -static inline int register_memory_isolate_notifier(struct notifier_block *nb) |
|---|
| 99 | | -{ |
|---|
| 100 | | - return 0; |
|---|
| 101 | | -} |
|---|
| 102 | | -static inline void unregister_memory_isolate_notifier(struct notifier_block *nb) |
|---|
| 103 | | -{ |
|---|
| 104 | | -} |
|---|
| 105 | | -static inline int memory_isolate_notify(unsigned long val, void *v) |
|---|
| 106 | | -{ |
|---|
| 107 | | - return 0; |
|---|
| 108 | | -} |
|---|
| 109 | 80 | #else |
|---|
| 110 | 81 | extern int register_memory_notifier(struct notifier_block *nb); |
|---|
| 111 | 82 | extern void unregister_memory_notifier(struct notifier_block *nb); |
|---|
| 112 | | -extern int register_memory_isolate_notifier(struct notifier_block *nb); |
|---|
| 113 | | -extern void unregister_memory_isolate_notifier(struct notifier_block *nb); |
|---|
| 114 | 83 | int create_memory_block_devices(unsigned long start, unsigned long size); |
|---|
| 115 | 84 | void remove_memory_block_devices(unsigned long start, unsigned long size); |
|---|
| 116 | | -extern int memory_dev_init(void); |
|---|
| 85 | +extern void memory_dev_init(void); |
|---|
| 117 | 86 | extern int memory_notify(unsigned long val, void *v); |
|---|
| 118 | | -extern int memory_isolate_notify(unsigned long val, void *v); |
|---|
| 119 | | -extern struct memory_block *find_memory_block_hinted(struct mem_section *, |
|---|
| 120 | | - struct memory_block *); |
|---|
| 121 | 87 | extern struct memory_block *find_memory_block(struct mem_section *); |
|---|
| 122 | 88 | typedef int (*walk_memory_blocks_func_t)(struct memory_block *, void *); |
|---|
| 89 | +extern int walk_memory_blocks(unsigned long start, unsigned long size, |
|---|
| 90 | + void *arg, walk_memory_blocks_func_t func); |
|---|
| 123 | 91 | extern int for_each_memory_block(void *arg, walk_memory_blocks_func_t func); |
|---|
| 124 | 92 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) |
|---|
| 125 | 93 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ |
|---|