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 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§
Modules§
- Advanced Configuration and Power Interface abstractions.
- Implementation of the kernel’s memory allocation infrastructure.
- Abstractions for the auxiliary bus.
- Rust API for bitmap.
- Bit manipulation macros.
- Types for working with the block layer.
- Support for BUG and WARN functionality.
- Clock abstractions.
- configfs interface: Userspace-driven Kernel Object Configuration
- Generic CPU definitions.
- CPU frequency scaling.
- CPU Mask abstractions.
- Credentials management.
- DebugFS Abstraction
- Generic devices that are part of the kernel’s driver model.
- Generic implementation of device IDs.
- Devres abstraction
- Direct memory access (DMA).
- Generic support for drivers of different buses (e.g., PCI, Platform, Amba, etc.).
- DRM subsystem abstractions.
- Kernel errors.
- Abstractions for the faux bus.
- Firmware abstraction
- Formatting utilities.
- Kernel file systems.
- Rust API for an ID pool backed by a
BitmapVec. - Extensions to the
pin-initcrate. - Memory-mapped IO.
ioctl()number definitions.- IO vectors.
- IRQ abstractions.
- Logic for static keys.
- KUnit-based macros for Rust unit tests.
- A linked list implementation.
- Maple trees.
- Miscdevice support.
- Memory management.
- Networking.
- Device Tree / Open Firmware abstractions.
- Operating performance points.
- Kernel page allocation and management.
- Abstractions for the PCI bus.
- Pid namespaces.
- Abstractions for the platform bus.
- The
kernelprelude. - Printing facilities.
- Processor related primitives.
- Types and functions to work with pointers and addresses.
- Red-black trees.
- Regulator abstractions, providing a standard kernel interface to control voltage and current regulators.
- Revocable objects.
- Abstractions for scatter-gather lists.
- Linux Security Modules (LSM).
- Seq file bindings.
- Commonly used sizes.
- String representations.
- Synchronisation primitives.
- Tasks (threads and processes).
- Time related primitives.
- Logic for tracepoints.
- Traits for transmuting types.
- Kernel types.
- Slices to user space memory regions.
- Work queues.
- XArray abstraction.
Macros§
- Create an ACPI
IdTablewith an “alias” for modpost. - Wrapper around
asm!configured for use in the kernel. - Create a auxiliary
IdTablewith its alias for modpost. - Creates a new
BStrfrom a string literal. - Asserts that a boolean expression is
trueat compile time. - Fails the build if the code path calling
build_error!can possibly be executed. - Creates a new
CStrfrom a string literal. - Define a list of configfs attributes statically.
- Produces a pointer to an object from a pointer to one of its fields.
- Returns the currently running task.
- Declare the DRM ioctls for a driver.
- Declare the Rust entry point for a tracepoint.
- Defines getters for a
ListArcField. - Prints an alert-level message (level 1) prefixed with device information.
- Prints a critical-level message (level 2) prefixed with device information.
- Prints a debug-level message (level 7) prefixed with device information.
- Prints an emergency-level message (level 0) prefixed with device information.
- Prints an error-level message (level 3) prefixed with device information.
- Prints an info-level message (level 6) prefixed with device information.
- Prints a notice-level message (level 5) prefixed with device information.
- Prints a warning-level message (level 4) prefixed with device information.
- Reads a field of an item from an allocated region of structs.
- Writes to a field of an item from an allocated region of structs.
- Defines a global lock.
- Implement
core::ops::Dereftraits for allowedDeviceContextconversions of a (bus specific) device. - Used to safely implement the
HasDelayedWork<T, ID>trait. - Use to implement the
HasHrTimer<T>trait. - Implements the
HasListLinkstrait for the given type. - Implements the
HasListLinksandHasSelfPtrtraits for the given type. - Used to safely implement the
HasWork<T, ID>trait. - Declares that this type supports
ListArc. - Implements the
ListItemtrait for the given type. - Create a
KVeccontaining the arguments. - Declares a kernel module that exposes a single auxiliary driver.
- Create device table alias for modpost.
- Declares a kernel module that exposes a single driver.
- Create firmware .modinfo entries.
- Declares a kernel module that exposes a single PCI driver.
- Declares a kernel module for PHYs drivers.
- Declares a kernel module that exposes a single platform driver.
- Creates a
CondVarinitialiser with the given name and a newly-created lock class. - Creates a
DelayedWorkinitialiser with the given name and a newly-created lock class. - Creates a
Mutexinitialiser with the given name and a newly-created lock class. - Creates a
PollCondVarinitialiser with the given name and a newly-created lock class. - Creates a
SpinLockinitialiser with the given name and a newly-created lock class. - Creates a
Workinitialiser with the given name and a newly-created lock class. - Create an OF
IdTablewith an “alias” for modpost. - Create a PCI
IdTablewith its alias for modpost. - 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).
- Write to a
SeqFilewith the ordinary Rust formatting syntax. - Static assert (i.e. compile-time assert).
- Branch based on a static key.
- Construct an in-place fallible initializer for
structs. - Construct an in-place, fallible pinned initializer for
structs. - Report a warning if
condis true and return the condition’s evaluation result.
Structs§
- Equivalent to
THIS_MODULEin the C API.
Traits§
- A module that is pinned and initialised in-place.
- The top level entrypoint to implementing a kernel module.
- Metadata attached to a
ModuleorInPlaceModule.
Functions§
- Gets the C string file name of a
Location.