lib.rs (614724e780f587c8321f027ca539b39f32796406) lib.rs (47cb6bf7860ce33bdd000198f8b65cf9fb3324b4)
1// SPDX-License-Identifier: GPL-2.0
2
3//! The `kernel` crate.
4//!
5//! This crate contains the kernel APIs that have been ported or wrapped for
6//! usage by Rust code in the kernel and is shared by all of them.
7//!
8//! In other words, all the rest of the Rust code in the kernel (e.g. kernel
9//! modules written in Rust) depends on [`core`], [`alloc`] and this crate.
10//!
11//! If you need a kernel C API that is not ported or wrapped yet here, then
12//! do so first instead of bypassing this crate.
13
14#![no_std]
15#![feature(arbitrary_self_types)]
1// SPDX-License-Identifier: GPL-2.0
2
3//! The `kernel` crate.
4//!
5//! This crate contains the kernel APIs that have been ported or wrapped for
6//! usage by Rust code in the kernel and is shared by all of them.
7//!
8//! In other words, all the rest of the Rust code in the kernel (e.g. kernel
9//! modules written in Rust) depends on [`core`], [`alloc`] and this crate.
10//!
11//! If you need a kernel C API that is not ported or wrapped yet here, then
12//! do so first instead of bypassing this crate.
13
14#![no_std]
15#![feature(arbitrary_self_types)]
16#![feature(coerce_unsized)]
17#![feature(dispatch_from_dyn)]
16#![cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, feature(derive_coerce_pointee))]
17#![cfg_attr(not(CONFIG_RUSTC_HAS_COERCE_POINTEE), feature(coerce_unsized))]
18#![cfg_attr(not(CONFIG_RUSTC_HAS_COERCE_POINTEE), feature(dispatch_from_dyn))]
19#![cfg_attr(not(CONFIG_RUSTC_HAS_COERCE_POINTEE), feature(unsize))]
18#![feature(inline_const)]
19#![feature(lint_reasons)]
20#![feature(inline_const)]
21#![feature(lint_reasons)]
20#![feature(unsize)]
21
22// Ensure conditional compilation based on the kernel configuration works;
23// otherwise we may silently break things like initcall handling.
24#[cfg(not(CONFIG_RUST))]
25compile_error!("Missing kernel configuration for conditional compilation");
26
27// Allow proc-macros to refer to `::kernel` inside the `kernel` crate (this crate).
28extern crate self as kernel;

--- 188 unchanged lines hidden ---
22
23// Ensure conditional compilation based on the kernel configuration works;
24// otherwise we may silently break things like initcall handling.
25#[cfg(not(CONFIG_RUST))]
26compile_error!("Missing kernel configuration for conditional compilation");
27
28// Allow proc-macros to refer to `::kernel` inside the `kernel` crate (this crate).
29extern crate self as kernel;

--- 188 unchanged lines hidden ---