rust: macros: document emit_base in ModInfoBuilder
Subsystems (2)
PATCH 1/1 rust: macros: document emit_base in ModInfoBuilder
Add documentation for the emit_base method within the ModInfoBuilder struct. Explain its role in formatting metadata strings, handling the differentiation between built-in and loadable modules, and managing linker sections and conditional compilation.
--- rust/macros/module.rs | 10 ++++++++++ 1 file changed, 10 insertions(+)
rust/macros/module.rs +10 -0
@@ -49,6 +49,16 @@ fn new(module: &'a str) -> Self { } } +/// Emits a single metadata entry into the module information table. +/// +/// This method formats a `field=content\0` byte string and places it into the +/// `.modinfo` linker section. For built-in modules (`builtin == true`), the string +/// is prefixed with the module name (`module.field=content\0`) to avoid naming +/// collisions in the final monolithic kernel binary. +/// +/// It automatically generates a unique static identifier using an internal counter +/// and applies appropriate conditional compilation attributes (`#[cfg(MODULE)]` or +/// `#[cfg(not(MODULE))]`) based on the target type. fn emit_base (&mut self, field: &str , content: &str , builtin:bool , param:bool ) {let string =if builtin {// Built-in modules prefix their modinfo strings by `module.`.
Signature · 1 line
2.56.0
ср, 28 окт. 2026 г. в 21:57, MBKCHEL <[email protected]>:
Quoted 44 lines
Hi,
Please note that I made a typo in my last name in the "From" and "Signed-off-by" lines. My correct name is "Ivan Tverdokhleb". If the patch is accepted, could you please apply it with the corrected name?
Thanks,
Ivanср, 28 окт. 2026 г. в 17:50, Ivan Tverdohleb <[email protected]>:
Quoted 35 lines
Add documentation for the
emit_basemethod within the ModInfoBuilder struct. Explain its role in formatting metadata strings, handling the differentiation between built-in and loadable modules, and managing linker sections and conditional compilation.Signed-off-by Ivan Tverdohleb <[email protected]>--- rust/macros/module.rs | 10 ++++++++++ 1 file changed, 10 insertions(+)rust/macros/module.rs +10
-1@@ -49,6 +49,16 @@ fn new(module: &'a str) -> Self { } } +/// Emits a single metadata entry into the module information table. +/// +/// This method formats a `field=content\0` byte string and places it into the +/// `.modinfo` linker section. For built-in modules (`builtin == true`), the string +/// is prefixed with the module name (`module.field=content\0`) to avoid naming +/// collisions in the final monolithic kernel binary. +/// +/// It automatically generates a unique static identifier using an internal counter +/// and applies appropriate conditional compilation attributes (`#[cfg(MODULE)]` or +/// `#[cfg(not(MODULE))]`) based on the target type. fn emit_base (&mut self, field: &str , content: &str , builtin:bool , param:bool ) {let string =if builtin {// Built-in modules prefix their modinfo strings by `module.`. --2.56.0
Hi,
Please note that I made a typo in my last name in the "From" and "Signed-off-by" lines. My correct name is "Ivan Tverdokhleb".
If the patch is accepted, could you please apply it with the corrected name?
Thanks,
Ivan
ср, 28 окт. 2026 г. в 21:57, MBKCHEL <[email protected]>:
Quoted 44 lines
Hi,
Please note that I made a typo in my last name in the "From" and "Signed-off-by" lines. My correct name is "Ivan Tverdokhleb". If the patch is accepted, could you please apply it with the corrected name?
Thanks,
Ivanср, 28 окт. 2026 г. в 17:50, Ivan Tverdohleb <[email protected]>:
Quoted 35 lines
Add documentation for the
emit_basemethod within the ModInfoBuilder struct. Explain its role in formatting metadata strings, handling the differentiation between built-in and loadable modules, and managing linker sections and conditional compilation.Signed-off-by Ivan Tverdohleb <[email protected]>--- rust/macros/module.rs | 10 ++++++++++ 1 file changed, 10 insertions(+)rust/macros/module.rs +10
-1@@ -49,6 +49,16 @@ fn new(module: &'a str) -> Self { } } +/// Emits a single metadata entry into the module information table. +/// +/// This method formats a `field=content\0` byte string and places it into the +/// `.modinfo` linker section. For built-in modules (`builtin == true`), the string +/// is prefixed with the module name (`module.field=content\0`) to avoid naming +/// collisions in the final monolithic kernel binary. +/// +/// It automatically generates a unique static identifier using an internal counter +/// and applies appropriate conditional compilation attributes (`#[cfg(MODULE)]` or +/// `#[cfg(not(MODULE))]`) based on the target type. fn emit_base (&mut self, field: &str , content: &str , builtin:bool , param:bool ) {let string =if builtin {// Built-in modules prefix their modinfo strings by `module.`. --2.56.0
Hi,
Please note that I made a typo in my last name in the "From" and "Signed-off-by" lines. My correct name is "Ivan Tverdokhleb".
If the patch is accepted, could you please apply it with the corrected name?
Thanks,
Ivan
ср, 28 окт. 2026 г. в 17:50, Ivan Tverdohleb <[email protected]>:
Quoted 35 lines
Add documentation for the
emit_basemethod within the ModInfoBuilder struct. Explain its role in formatting metadata strings, handling the differentiation between built-in and loadable modules, and managing linker sections and conditional compilation.Signed-off-by Ivan Tverdohleb <[email protected]>--- rust/macros/module.rs | 10 ++++++++++ 1 file changed, 10 insertions(+)rust/macros/module.rs +10
-1@@ -49,6 +49,16 @@ fn new(module: &'a str) -> Self { } } +/// Emits a single metadata entry into the module information table. +/// +/// This method formats a `field=content\0` byte string and places it into the +/// `.modinfo` linker section. For built-in modules (`builtin == true`), the string +/// is prefixed with the module name (`module.field=content\0`) to avoid naming +/// collisions in the final monolithic kernel binary. +/// +/// It automatically generates a unique static identifier using an internal counter +/// and applies appropriate conditional compilation attributes (`#[cfg(MODULE)]` or +/// `#[cfg(not(MODULE))]`) based on the target type. fn emit_base (&mut self, field: &str , content: &str , builtin:bool , param:bool ) {let string =if builtin {// Built-in modules prefix their modinfo strings by `module.`. --2.56.0
Hi,
Please note that I made a typo in my last name in the "From" and "Signed-off-by" lines. My correct name is "Ivan Tverdokhleb".
If the patch is accepted, could you please apply it with the corrected name?
Thanks,
Ivan
ср, 28 окт. 2026 г. в 17:50, Ivan Tverdohleb <[email protected]>:
Quoted 35 lines
Add documentation for the
emit_basemethod within the ModInfoBuilder struct. Explain its role in formatting metadata strings, handling the differentiation between built-in and loadable modules, and managing linker sections and conditional compilation.Signed-off-by Ivan Tverdohleb <[email protected]>--- rust/macros/module.rs | 10 ++++++++++ 1 file changed, 10 insertions(+)rust/macros/module.rs +10
-1@@ -49,6 +49,16 @@ fn new(module: &'a str) -> Self { } } +/// Emits a single metadata entry into the module information table. +/// +/// This method formats a `field=content\0` byte string and places it into the +/// `.modinfo` linker section. For built-in modules (`builtin == true`), the string +/// is prefixed with the module name (`module.field=content\0`) to avoid naming +/// collisions in the final monolithic kernel binary. +/// +/// It automatically generates a unique static identifier using an internal counter +/// and applies appropriate conditional compilation attributes (`#[cfg(MODULE)]` or +/// `#[cfg(not(MODULE))]`) based on the target type. fn emit_base (&mut self, field: &str , content: &str , builtin:bool , param:bool ) {let string =if builtin {// Built-in modules prefix their modinfo strings by `module.`. --2.56.0
Hi,
Friendly ping on this patch.
Thanks,
Ivan
чт, 29 окт. 2026 г. в 15:33, MBKCHEL <[email protected]>:
Quoted 47 lines
Hi,
Please note that I made a typo in my last name in the "From" and "Signed-off-by" lines. My correct name is "Ivan Tverdokhleb".
If the patch is accepted, could you please apply it with the corrected name?
Thanks,
Ivanср, 28 окт. 2026 г. в 17:50, Ivan Tverdohleb <[email protected]>:
Quoted 35 lines
Add documentation for the
emit_basemethod within the ModInfoBuilder struct. Explain its role in formatting metadata strings, handling the differentiation between built-in and loadable modules, and managing linker sections and conditional compilation.Signed-off-by Ivan Tverdohleb <[email protected]>--- rust/macros/module.rs | 10 ++++++++++ 1 file changed, 10 insertions(+)rust/macros/module.rs +10
-1@@ -49,6 +49,16 @@ fn new(module: &'a str) -> Self { } } +/// Emits a single metadata entry into the module information table. +/// +/// This method formats a `field=content\0` byte string and places it into the +/// `.modinfo` linker section. For built-in modules (`builtin == true`), the string +/// is prefixed with the module name (`module.field=content\0`) to avoid naming +/// collisions in the final monolithic kernel binary. +/// +/// It automatically generates a unique static identifier using an internal counter +/// and applies appropriate conditional compilation attributes (`#[cfg(MODULE)]` or +/// `#[cfg(not(MODULE))]`) based on the target type. fn emit_base (&mut self, field: &str , content: &str , builtin:bool , param:bool ) {let string =if builtin {// Built-in modules prefix their modinfo strings by `module.`. --2.56.0