Lines Matching +full:fixed +full:- +full:length
1 // SPDX-License-Identifier: GPL-2.0
7 //! Reference: <https://docs.kernel.org/core-api/printk-basics.html>
22 ) -> *mut c_char { in rust_fmt_argument()
36 /// The length we copy from the `KERN_*` kernel prefixes.
39 /// The length of the fixed format strings.
40 pub const LENGTH: usize = 10; constant
42 /// Generates a fixed format string for the kernel's [`_printk`].
48 const fn generate(is_cont: bool, prefix: &[u8; 3]) -> [u8; LENGTH] { in generate() argument
58 let suffix: &[u8; LENGTH - LENGTH_PREFIX] = if is_cont {
70 // Generate the format strings at compile-time.
76 pub static EMERG: [u8; LENGTH] = generate(false, bindings::KERN_EMERG);
77 pub static ALERT: [u8; LENGTH] = generate(false, bindings::KERN_ALERT);
78 pub static CRIT: [u8; LENGTH] = generate(false, bindings::KERN_CRIT);
79 pub static ERR: [u8; LENGTH] = generate(false, bindings::KERN_ERR);
80 pub static WARNING: [u8; LENGTH] = generate(false, bindings::KERN_WARNING);
81 pub static NOTICE: [u8; LENGTH] = generate(false, bindings::KERN_NOTICE);
82 pub static INFO: [u8; LENGTH] = generate(false, bindings::KERN_INFO);
83 pub static DEBUG: [u8; LENGTH] = generate(false, bindings::KERN_DEBUG);
84 pub static CONT: [u8; LENGTH] = generate(true, bindings::KERN_CONT);
94 /// the module name must be null-terminated.
100 format_string: &[u8; format_strings::LENGTH], in call_printk() argument
126 // SAFETY: The format string is fixed. in call_printk_cont()
144 // The non-continuation cases (most of them, e.g. `INFO`).
153 // printing macros which ensure the format string is one of the fixed
154 // ones. All `__LOG_PREFIX`s are null-terminated as they are generated
155 // by the `module!` proc macro or fixed values defined in a kernel
191 // [1]: https://github.com/rust-lang/rust/issues/52234
193 /// Prints an emergency-level message (level 0).
202 /// [`pr_emerg`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_emerg
203 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
217 /// Prints an alert-level message (level 1).
226 /// [`pr_alert`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_alert
227 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
241 /// Prints a critical-level message (level 2).
250 /// [`pr_crit`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_crit
251 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
265 /// Prints an error-level message (level 3).
274 /// [`pr_err`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_err
275 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
289 /// Prints a warning-level message (level 4).
298 /// [`pr_warn`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_warn
299 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
313 /// Prints a notice-level message (level 5).
322 /// [`pr_notice`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_notice
323 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
337 /// Prints an info-level message (level 6).
346 /// [`pr_info`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_info
347 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
362 /// Prints a debug-level message (level 7).
372 /// [`pr_debug`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_debug
373 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
400 /// [`pr_cont`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_cont
401 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html