History

module: Always have struct mod_tree_root

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.

Christophe Leroy committed 4 years ago

Commit 80b8bf41 parent 7337f922 files · +3 −6Browse files

Showing the changes to kernel/module (2 of 2 files). Show all

Unified · Split

2 files
  1. kernel/module/internal.h +3 −1
  2. kernel/module/main.c +0 −5
kernel/module/internal.h+3−1
@@ -143,15 +143,17 @@ static inline void module_decompress_cleanup(struct load_info *info) · 142 unmodified lines
143143 }
144144 #endif
145145
146−#ifdef CONFIG_MODULES_TREE_LOOKUP
147146 struct mod_tree_root {
147+#ifdef CONFIG_MODULES_TREE_LOOKUP
148148 struct latch_tree_root root;
149+#endif
149150 unsigned long addr_min;
150151 unsigned long addr_max;
151152 };
152153
153154 extern struct mod_tree_root mod_tree;
154155
156+#ifdef CONFIG_MODULES_TREE_LOOKUP
155157 void mod_tree_insert(struct module *mod);
156158 void mod_tree_remove_init(struct module *mod);
157159 void mod_tree_remove(struct module *mod);
kernel/module/main.c+0−5
@@ -74,7 +74,6 @@ static void do_free_init(struct work_struct *w); · 73 unmodified lines
7474 static DECLARE_WORK(init_free_wq, do_free_init);
7575 static LLIST_HEAD(init_free_list);
7676
77−#ifdef CONFIG_MODULES_TREE_LOOKUP
7877 struct mod_tree_root mod_tree __cacheline_aligned = {
7978 .addr_min = -1UL,
8079 };
@@ -82,10 +81,6 @@ struct mod_tree_root mod_tree __cacheline_aligned = { · 1 unmodified line
8281 #define module_addr_min mod_tree.addr_min
8382 #define module_addr_max mod_tree.addr_max
8483
85−#else /* !CONFIG_MODULES_TREE_LOOKUP */
86−static unsigned long module_addr_min = -1UL, module_addr_max;
87−#endif /* CONFIG_MODULES_TREE_LOOKUP */
88−
8984 struct symsearch {
9085 const struct kernel_symbol *start, *stop;
9186 const s32 *crcs;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t