// SPDX-License-Identifier: GPL-2.012//! Bindings.3//!4//! Imports the generated bindings by `bindgen`.5//!6//! This crate may not be directly used. If you need a kernel C API that is7//! not ported or wrapped in the `kernel` crate, then do so first instead of8//! using this crate.910#![no_std]11// See <https://github.com/rust-lang/rust-bindgen/issues/1651>.12#![cfg_attr(test, allow(deref_nullptr))]13#![cfg_attr(test, allow(unaligned_references))]14#![cfg_attr(test, allow(unsafe_op_in_unsafe_fn))]15#![allow(16clippy::all,17missing_docs,18non_camel_case_types,19non_upper_case_globals,20non_snake_case,21improper_ctypes,22unreachable_pub,23unsafe_op_in_unsafe_fn24)]2526#[allow(dead_code)]27#[allow(clippy::cast_lossless)]28#[allow(clippy::ptr_as_ptr)]29#[allow(clippy::ref_as_ptr)]30#[allow(clippy::undocumented_unsafe_blocks)]31#[cfg_attr(CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES, allow(unnecessary_transmutes))]32mod bindings_raw {33use pin_init::{MaybeZeroable, Zeroable};3435// Manual definition for blocklisted types.36type __kernel_size_t = usize;37type __kernel_ssize_t = isize;38type __kernel_ptrdiff_t = isize;3940// `bindgen` doesn't automatically do this, see41// <https://github.com/rust-lang/rust-bindgen/issues/3196>42//43// SAFETY: `__BindgenBitfieldUnit<Storage>` is a newtype around `Storage`.44unsafe impl<Storage> Zeroable for __BindgenBitfieldUnit<Storage> where Storage: Zeroable {}4546// Use glob import here to expose all helpers.47// Symbols defined within the module will take precedence to the glob import.48pub use super::bindings_helper::*;49include!(concat!(50env!("OBJTREE"),51"/rust/bindings/bindings_generated.rs"52));53}5455// When both a directly exposed symbol and a helper exists for the same function,56// the directly exposed symbol is preferred and the helper becomes dead code, so57// ignore the warning here.58#[allow(dead_code)]59mod bindings_helper {60// Import the generated bindings for types.61use super::bindings_raw::*;62include!(concat!(63env!("OBJTREE"),64"/rust/bindings/bindings_helpers_generated.rs"65));66}6768pub use bindings_raw::*;697071