In order to separate text and data, we need to setup two rb trees. This means that struct mod_tree_root is required even without MODULES_TREE_LOOKUP.
Showing the changes to kernel/module (2 of 2 files). Show all
Unified · Split
| @@ -143,15 +143,17 @@ static inline void module_decompress_cleanup(struct load_info *info) · 142 unmodified lines | |||
| 143 | } | 143 | } |
| 144 | #endif | 144 | #endif |
| 145 | 145 | ||
| 146 | #ifdef CONFIG_MODULES_TREE_LOOKUP | ||
| 147 | struct mod_tree_root { | 146 | struct mod_tree_root { |
| 147 | #ifdef CONFIG_MODULES_TREE_LOOKUP | ||
| 148 | struct latch_tree_root root; | 148 | struct latch_tree_root root; |
| 149 | #endif | ||
| 149 | unsigned long addr_min; | 150 | unsigned long addr_min; |
| 150 | unsigned long addr_max; | 151 | unsigned long addr_max; |
| 151 | }; | 152 | }; |
| 152 | 153 | ||
| 153 | extern struct mod_tree_root mod_tree; | 154 | extern struct mod_tree_root mod_tree; |
| 154 | 155 | ||
| 156 | #ifdef CONFIG_MODULES_TREE_LOOKUP | ||
| 155 | void mod_tree_insert(struct module *mod); | 157 | void mod_tree_insert(struct module *mod); |
| 156 | void mod_tree_remove_init(struct module *mod); | 158 | void mod_tree_remove_init(struct module *mod); |
| 157 | void mod_tree_remove(struct module *mod); | 159 | void mod_tree_remove(struct module *mod); |
| @@ -74,7 +74,6 @@ static void do_free_init(struct work_struct *w); · 73 unmodified lines | |||
| 74 | static DECLARE_WORK(init_free_wq, do_free_init); | 74 | static DECLARE_WORK(init_free_wq, do_free_init); |
| 75 | static LLIST_HEAD(init_free_list); | 75 | static LLIST_HEAD(init_free_list); |
| 76 | 76 | ||
| 77 | #ifdef CONFIG_MODULES_TREE_LOOKUP | ||
| 78 | struct mod_tree_root mod_tree __cacheline_aligned = { | 77 | struct mod_tree_root mod_tree __cacheline_aligned = { |
| 79 | .addr_min = -1UL, | 78 | .addr_min = -1UL, |
| 80 | }; | 79 | }; |
| @@ -82,10 +81,6 @@ struct mod_tree_root mod_tree __cacheline_aligned = { · 1 unmodified line | |||
| 82 | #define module_addr_min mod_tree.addr_min | 81 | #define module_addr_min mod_tree.addr_min |
| 83 | #define module_addr_max mod_tree.addr_max | 82 | #define module_addr_max mod_tree.addr_max |
| 84 | 83 | ||
| 85 | #else /* !CONFIG_MODULES_TREE_LOOKUP */ | ||
| 86 | static unsigned long module_addr_min = -1UL, module_addr_max; | ||
| 87 | #endif /* CONFIG_MODULES_TREE_LOOKUP */ | ||
| 88 | |||
| 89 | struct symsearch { | 84 | struct symsearch { |
| 90 | const struct kernel_symbol *start, *stop; | 85 | const struct kernel_symbol *start, *stop; |
| 91 | const s32 *crcs; | 86 | const s32 *crcs; |