lkml.org 
[lkml]   [2022]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[patch 16/38] modules: Make struct module_layout unconditionally available
Date
To simplify the upcoming call thunk code it's desired to expose struct
module_layout even on !MDOULES builds. This spares conditionals and
#ifdeffery.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/module.h | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)

--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -67,6 +67,28 @@ struct module_version_attribute {
const char *version;
};

+struct mod_tree_node {
+ struct module *mod;
+ struct latch_tree_node node;
+};
+
+struct module_layout {
+ /* The actual code + data. */
+ void *base;
+ /* Total size. */
+ unsigned int size;
+ /* The size of the executable code. */
+ unsigned int text_size;
+ /* Size of RO section of the module (text+rodata) */
+ unsigned int ro_size;
+ /* Size of RO after init section */
+ unsigned int ro_after_init_size;
+
+#ifdef CONFIG_MODULES_TREE_LOOKUP
+ struct mod_tree_node mtn;
+#endif
+};
+
extern ssize_t __modver_version_show(struct module_attribute *,
struct module_kobject *, char *);

@@ -316,28 +338,6 @@ enum module_state {
MODULE_STATE_UNFORMED, /* Still setting it up. */
};

-struct mod_tree_node {
- struct module *mod;
- struct latch_tree_node node;
-};
-
-struct module_layout {
- /* The actual code + data. */
- void *base;
- /* Total size. */
- unsigned int size;
- /* The size of the executable code. */
- unsigned int text_size;
- /* Size of RO section of the module (text+rodata) */
- unsigned int ro_size;
- /* Size of RO after init section */
- unsigned int ro_after_init_size;
-
-#ifdef CONFIG_MODULES_TREE_LOOKUP
- struct mod_tree_node mtn;
-#endif
-};
-
#ifdef CONFIG_MODULES_TREE_LOOKUP
/* Only touch one cacheline for common rbtree-for-core-layout case. */
#define __module_layout_align ____cacheline_aligned
\
 
 \ /
  Last update: 2022-07-17 01:18    [W:0.704 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site