2022-02-11 19:25:34 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
//! The `kernel` prelude.
|
|
|
|
//!
|
|
|
|
//! These are the most common items used by Rust code in the kernel,
|
|
|
|
//! intended to be imported by all Rust code, for convenience.
|
|
|
|
//!
|
|
|
|
//! # Examples
|
|
|
|
//!
|
|
|
|
//! ```
|
|
|
|
//! use kernel::prelude::*;
|
|
|
|
//! ```
|
|
|
|
|
2022-12-14 09:34:51 +00:00
|
|
|
#[doc(no_inline)]
|
2022-02-11 19:25:34 +00:00
|
|
|
pub use core::pin::Pin;
|
2022-11-10 16:41:13 +00:00
|
|
|
|
2024-03-28 01:35:59 +00:00
|
|
|
pub use crate::alloc::{box_ext::BoxExt, flags::*, vec_ext::VecExt};
|
2024-03-28 01:35:55 +00:00
|
|
|
|
2022-12-14 09:34:51 +00:00
|
|
|
#[doc(no_inline)]
|
2022-11-10 16:41:13 +00:00
|
|
|
pub use alloc::{boxed::Box, vec::Vec};
|
|
|
|
|
2022-12-14 09:34:51 +00:00
|
|
|
#[doc(no_inline)]
|
2023-08-14 08:46:41 +00:00
|
|
|
pub use macros::{module, pin_data, pinned_drop, vtable, Zeroable};
|
2022-11-10 16:41:13 +00:00
|
|
|
|
2022-11-10 16:41:38 +00:00
|
|
|
pub use super::build_assert;
|
|
|
|
|
2022-12-14 09:34:51 +00:00
|
|
|
// `super::std_vendor` is hidden, which makes the macro inline for some reason.
|
|
|
|
#[doc(no_inline)]
|
|
|
|
pub use super::dbg;
|
|
|
|
pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn};
|
2022-11-10 16:41:13 +00:00
|
|
|
|
2023-04-08 12:26:17 +00:00
|
|
|
pub use super::{init, pin_init, try_init, try_pin_init};
|
|
|
|
|
2022-11-10 16:41:36 +00:00
|
|
|
pub use super::static_assert;
|
|
|
|
|
2022-11-10 16:41:23 +00:00
|
|
|
pub use super::error::{code::*, Error, Result};
|
2022-11-10 16:41:13 +00:00
|
|
|
|
2022-11-10 16:41:28 +00:00
|
|
|
pub use super::{str::CStr, ThisModule};
|
2023-04-08 12:26:17 +00:00
|
|
|
|
2024-08-19 11:24:39 +00:00
|
|
|
pub use super::init::{InPlaceInit, InPlaceWrite, Init, PinInit};
|
2023-04-11 05:45:40 +00:00
|
|
|
|
|
|
|
pub use super::current;
|