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 (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
143}143}
144#endif144#endif
145 145
146#ifdef CONFIG_MODULES_TREE_LOOKUP
147struct mod_tree_root {146struct 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
153extern struct mod_tree_root mod_tree;154extern struct mod_tree_root mod_tree;
154 155
156#ifdef CONFIG_MODULES_TREE_LOOKUP
155void mod_tree_insert(struct module *mod);157void mod_tree_insert(struct module *mod);
156void mod_tree_remove_init(struct module *mod);158void mod_tree_remove_init(struct module *mod);
157void mod_tree_remove(struct module *mod);159void 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
74static DECLARE_WORK(init_free_wq, do_free_init);74static DECLARE_WORK(init_free_wq, do_free_init);
75static LLIST_HEAD(init_free_list);75static LLIST_HEAD(init_free_list);
76 76
77#ifdef CONFIG_MODULES_TREE_LOOKUP
78struct mod_tree_root mod_tree __cacheline_aligned = {77struct 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_min81#define module_addr_min mod_tree.addr_min
83#define module_addr_max mod_tree.addr_max82#define module_addr_max mod_tree.addr_max
84 83
85#else /* !CONFIG_MODULES_TREE_LOOKUP */
86static unsigned long module_addr_min = -1UL, module_addr_max;
87#endif /* CONFIG_MODULES_TREE_LOOKUP */
88
89struct symsearch {84struct symsearch {
90 const struct kernel_symbol *start, *stop;85 const struct kernel_symbol *start, *stop;
91 const s32 *crcs;86 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