2022-02-11 20:25:34 +01: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 10:34:51 +01:00
|
|
|
#[doc(no_inline)]
|
2022-02-11 20:25:34 +01:00
|
|
|
pub use core::pin::Pin;
|
2022-11-10 17:41:13 +01:00
|
|
|
|
2025-04-13 02:56:50 +02: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 17:41:25 +02:00
|
|
|
pub use crate::alloc::{flags::*, Box, KBox, KVBox, KVVec, KVec, VBox, VVec, Vec};
|
2022-11-10 17:41:13 +01:00
|
|
|
|
2022-12-14 10:34:51 +01:00
|
|
|
#[doc(no_inline)]
|
2025-05-02 23:51:28 +02: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 17:41:13 +01:00
|
|
|
|
2024-11-23 23:28:49 +01:00
|
|
|
pub use super::{build_assert, build_error};
|
2022-11-10 17:41:38 +01:00
|
|
|
|
2022-12-14 10:34:51 +01:00
|
|
|
// `super::std_vendor` is hidden, which makes the macro inline for some reason.
|
|
|
|
#[doc(no_inline)]
|
|
|
|
pub use super::dbg;
|
2024-10-22 23:31:45 +02:00
|
|
|
pub use super::{dev_alert, dev_crit, dev_dbg, dev_emerg, dev_err, dev_info, dev_notice, dev_warn};
|
2022-12-14 10:34:51 +01:00
|
|
|
pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn};
|
2025-07-04 16:14:52 -04:00
|
|
|
pub use core::format_args as fmt;
|
2022-11-10 17:41:13 +01: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 17:41:36 +01:00
|
|
|
pub use super::static_assert;
|
|
|
|
|
2022-11-10 17:41:23 +01:00
|
|
|
pub use super::error::{code::*, Error, Result};
|
2022-11-10 17:41:13 +01:00
|
|
|
|
2022-11-10 17:41:28 +01: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 02:45:40 -03:00
|
|
|
|
|
|
|
pub use super::current;
|
2025-06-16 13:45:57 +00:00
|
|
|
|
|
|
|
pub use super::uaccess::UserPtr;
|