Expand description

The kernel crate.

This crate contains the kernel APIs that have been ported or wrapped for usage by Rust code in the kernel and is shared by all of them.

In other words, all the rest of the Rust code in the kernel (e.g. kernel modules written in Rust) depends on core, alloc and this crate.

If you need a kernel C API that is not ported or wrapped yet here, then do so first instead of bypassing this crate.

Re-exports

pub use macros;

Modules

Kernel errors.

API to safely and fallibly initialize pinned structs using in-place constructors.

The kernel prelude.

Printing facilities.

String representations.

Synchronisation primitives.

Kernel types.

Macros

Creates a new BStr from a string literal.

Asserts that a boolean expression is true at compile time.

Fails the build if the code path calling build_error! can possibly be executed.

Creates a new CStr from a string literal.

std::dbg, but using pr_info instead of eprintln.

A convenience alias for core::format_args.

Construct an in-place initializer for structs.

Construct an in-place, pinned initializer for structs.

Prints an alert-level message (level 1).

Continues a previous log message in the same line.

Prints a critical-level message (level 2).

Prints a debug-level message (level 7).

Prints an emergency-level message (level 0).

Prints an error-level message (level 3).

Prints an info-level message (level 6).

Prints a notice-level message (level 5).

Prints a warning-level message (level 4).

Initialize and pin a type directly on the stack.

Initialize and pin a type directly on the stack.

Static assert (i.e. compile-time assert).

Construct an in-place fallible initializer for structs.

Construct an in-place, fallible pinned initializer for structs.

Structs

Equivalent to THIS_MODULE in the C API.

Traits

The top level entrypoint to implementing a kernel module.

This documentation is an old archive. Please see https://rust.docs.kernel.org instead.