Lines Matching +full:fixed +full:- +full:length
1 // SPDX-License-Identifier: GPL-2.0
7 //! Reference: <https://www.kernel.org/doc/html/latest/core-api/printk-basics.html>
25 ) -> *mut c_char { in rust_fmt_argument()
40 /// The length we copy from the `KERN_*` kernel prefixes.
43 /// The length of the fixed format strings.
44 pub const LENGTH: usize = 10; constant
46 /// Generates a fixed format string for the kernel's [`_printk`].
52 const fn generate(is_cont: bool, prefix: &[u8; 3]) -> [u8; LENGTH] { in generate() argument
62 let suffix: &[u8; LENGTH - LENGTH_PREFIX] = if is_cont {
74 // Generate the format strings at compile-time.
80 pub static EMERG: [u8; LENGTH] = generate(false, bindings::KERN_EMERG);
81 pub static ALERT: [u8; LENGTH] = generate(false, bindings::KERN_ALERT);
82 pub static CRIT: [u8; LENGTH] = generate(false, bindings::KERN_CRIT);
83 pub static ERR: [u8; LENGTH] = generate(false, bindings::KERN_ERR);
84 pub static WARNING: [u8; LENGTH] = generate(false, bindings::KERN_WARNING);
85 pub static NOTICE: [u8; LENGTH] = generate(false, bindings::KERN_NOTICE);
86 pub static INFO: [u8; LENGTH] = generate(false, bindings::KERN_INFO);
87 pub static DEBUG: [u8; LENGTH] = generate(false, bindings::KERN_DEBUG);
88 pub static CONT: [u8; LENGTH] = generate(true, bindings::KERN_CONT);
98 /// the module name must be null-terminated.
104 format_string: &[u8; format_strings::LENGTH], in call_printk() argument
129 // SAFETY: The format string is fixed. in call_printk_cont()
147 // The non-continuation cases (most of them, e.g. `INFO`).
156 // printing macros which ensure the format string is one of the fixed
157 // ones. All `__LOG_PREFIX`s are null-terminated as they are generated
158 // by the `module!` proc macro or fixed values defined in a kernel
194 // [1]: https://github.com/rust-lang/rust/issues/52234
196 /// Prints an emergency-level message (level 0).
205 /// [`pr_emerg`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html#c.pr_emerg
206 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
220 /// Prints an alert-level message (level 1).
229 /// [`pr_alert`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html#c.pr_alert
230 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
244 /// Prints a critical-level message (level 2).
253 /// [`pr_crit`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html#c.pr_crit
254 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
268 /// Prints an error-level message (level 3).
277 /// [`pr_err`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html#c.pr_err
278 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
292 /// Prints a warning-level message (level 4).
301 /// [`pr_warn`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html#c.pr_warn
302 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
316 /// Prints a notice-level message (level 5).
325 /// [`pr_notice`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html#c.pr_notice
326 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
340 /// Prints an info-level message (level 6).
349 /// [`pr_info`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html#c.pr_info
350 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
365 /// Prints a debug-level message (level 7).
375 /// [`pr_debug`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html#c.pr_debug
376 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
403 /// [`pr_cont`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html#c.pr_cont
404 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html