//! Logic for static keys. //! //! C header: [`include/linux/jump_label.h`](srctree/include/linux/jump_label.h).
/// Branch based on a static key. /// /// Takes three arguments: /// /// * `key` - the path to the static variable containing the `static_key`. /// * `keytyp` - the type of `key`. /// * `field` - the name of the field of `key` that contains the `static_key`. /// /// # Safety /// /// The macro must be used with a real static key defined by C. #[macro_export]
macro_rules! static_branch_unlikely {
($key:path, $keytyp:ty, $field:ident) => {{ let _key: *const $keytyp = ::core::ptr::addr_of!($key); let _key: *const $crate::bindings::static_key_false = ::core::ptr::addr_of!((*_key).$field); let _key: *const $crate::bindings::static_key = _key.cast();
/// Assert that the assembly block evaluates to a string literal. #[cfg(CONFIG_JUMP_LABEL)] const _: &str = include!(concat!(
env!("OBJTREE"), "/rust/kernel/generated_arch_static_branch_asm.rs"
));
/// A helper used by inline assembly to pass a boolean to as a `const` parameter. /// /// Using this function instead of a cast lets you assert that the input is a boolean, and not some /// other type that can also be cast to an integer. #[doc(hidden)] pubconstfn bool_to_int(b: bool) -> i32 {
b as i32
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.