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
|
|
|
|
2025-04-13 00:56:50 +00:00
|
|
|
pub use ::ffi::{
|
|
|
|
c_char, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint, c_ulong, c_ulonglong,
|
|
|
|
c_ushort, c_void,
|
|
|
|
};
|
|
|
|
|
2024-10-04 15:41:25 +00:00
|
|
|
pub use crate::alloc::{flags::*, Box, KBox, KVBox, KVVec, KVec, VBox, VVec, Vec};
|
2022-11-10 16:41:13 +00:00
|
|
|
|
2022-12-14 09:34:51 +00:00
|
|
|
#[doc(no_inline)]
|
2025-05-02 21:51:28 +00:00
|
|
|
pub use macros::{export, kunit_tests, module, vtable};
|
2025-03-08 11:05:09 +00:00
|
|
|
|
|
|
|
pub use pin_init::{init, pin_data, pin_init, pinned_drop, InPlaceWrite, Init, PinInit, Zeroable};
|
2022-11-10 16:41:13 +00:00
|
|
|
|
2024-11-23 22:28:49 +00:00
|
|
|
pub use super::{build_assert, build_error};
|
2022-11-10 16:41:38 +00:00
|
|
|
|
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;
|
2024-10-22 21:31:45 +00:00
|
|
|
pub use super::{dev_alert, dev_crit, dev_dbg, dev_emerg, dev_err, dev_info, dev_notice, dev_warn};
|
2022-12-14 09:34:51 +00:00
|
|
|
pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn};
|
2025-07-04 20:14:52 +00:00
|
|
|
pub use core::format_args as fmt;
|
2022-11-10 16:41:13 +00:00
|
|
|
|
2025-03-08 11:05:09 +00:00
|
|
|
pub use super::{try_init, try_pin_init};
|
2023-04-08 12:26:17 +00:00
|
|
|
|
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
|
|
|
|
2025-03-08 11:05:09 +00:00
|
|
|
pub use super::init::InPlaceInit;
|
2023-04-11 05:45:40 +00:00
|
|
|
|
|
|
|
pub use super::current;
|
2025-06-16 13:45:57 +00:00
|
|
|
|
|
|
|
pub use super::uaccess::UserPtr;
|