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>
23 ) -> *mut c_char { in rust_fmt_argument()
37 /// The length we copy from the `KERN_*` kernel prefixes.
40 /// The length of the fixed format strings.
41 pub const LENGTH: usize = 10; constant
43 /// Generates a fixed format string for the kernel's [`_printk`].
49 const fn generate(is_cont: bool, prefix: &[u8; 3]) -> [u8; LENGTH] { in generate() argument
59 let suffix: &[u8; LENGTH - LENGTH_PREFIX] = if is_cont {
71 // Generate the format strings at compile-time.
77 pub static EMERG: [u8; LENGTH] = generate(false, bindings::KERN_EMERG);
78 pub static ALERT: [u8; LENGTH] = generate(false, bindings::KERN_ALERT);
79 pub static CRIT: [u8; LENGTH] = generate(false, bindings::KERN_CRIT);
80 pub static ERR: [u8; LENGTH] = generate(false, bindings::KERN_ERR);
81 pub static WARNING: [u8; LENGTH] = generate(false, bindings::KERN_WARNING);
82 pub static NOTICE: [u8; LENGTH] = generate(false, bindings::KERN_NOTICE);
83 pub static INFO: [u8; LENGTH] = generate(false, bindings::KERN_INFO);
84 pub static DEBUG: [u8; LENGTH] = generate(false, bindings::KERN_DEBUG);
85 pub static CONT: [u8; LENGTH] = generate(true, bindings::KERN_CONT);
95 /// the module name must be null-terminated.
101 format_string: &[u8; format_strings::LENGTH], in call_printk() argument
127 // SAFETY: The format string is fixed. in call_printk_cont()
145 // The non-continuation cases (most of them, e.g. `INFO`).
154 // printing macros which ensure the format string is one of the fixed
155 // ones. All `__LOG_PREFIX`s are null-terminated as they are generated
156 // by the `module!` proc macro or fixed values defined in a kernel
192 // [1]: https://github.com/rust-lang/rust/issues/52234
194 /// Prints an emergency-level message (level 0).
203 /// [`pr_emerg`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_emerg
204 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
218 /// Prints an alert-level message (level 1).
227 /// [`pr_alert`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_alert
228 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
242 /// Prints a critical-level message (level 2).
251 /// [`pr_crit`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_crit
252 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
266 /// Prints an error-level message (level 3).
275 /// [`pr_err`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_err
276 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
290 /// Prints a warning-level message (level 4).
299 /// [`pr_warn`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_warn
300 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
314 /// Prints a notice-level message (level 5).
323 /// [`pr_notice`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_notice
324 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
338 /// Prints an info-level message (level 6).
347 /// [`pr_info`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_info
348 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
363 /// Prints a debug-level message (level 7).
373 /// [`pr_debug`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_debug
374 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
401 /// [`pr_cont`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_cont
402 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html