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§
- Implementation of the kernel’s memory allocation infrastructure.
- Types for working with the block layer.
- Credentials management.
- Generic devices that are part of the kernel’s driver model.
- Kernel errors.
- Firmware abstraction
- Kernel file systems.
- API to safely and fallibly initialize pinnedstructs using in-place constructors.
- ioctl()number definitions.
- Logic for static keys.
- A linked list implementation.
- Miscdevice support.
- Networking.
- Kernel page allocation and management.
- Pid namespaces.
- Thekernelprelude.
- Printing facilities.
- Red-black trees.
- 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.
Macros§
- Wrapper aroundasm!configured for use in the kernel.
- Asserts that a field on a struct using#[pin_data]is marked with#[pin]ie. that it is structurally pinned.
- Creates a newBStrfrom a string literal.
- Asserts that a boolean expression istrueat compile time.
- Fails the build if the code path callingbuild_error!can possibly be executed.
- Creates a newCStrfrom a string literal.
- Produces a pointer to an object from a pointer to one of its fields.
- Returns the currently running task.
- Returns the currently running task’s pid namespace.
- Declare the Rust entry point for a tracepoint.
- Defines getters for aListArcField.
- 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.
- A convenience alias forcore::format_args.
- Defines a global lock.
- Implements theHasListLinkstrait for the given type.
- Implements theHasListLinksandHasSelfPtrtraits for the given type.
- Used to safely implement theHasWork<T, ID>trait.
- Declares that this type supportsListArc.
- Implements theListItemtrait for the given type.
- Construct an in-place initializer forstructs.
- Create aKVeccontaining the arguments.
- Creates aCondVarinitialiser with the given name and a newly-created lock class.
- Creates aMutexinitialiser with the given name and a newly-created lock class.
- Creates aPollCondVarinitialiser with the given name and a newly-created lock class.
- Creates aSpinLockinitialiser with the given name and a newly-created lock class.
- Creates aWorkinitialiser with the given name and a newly-created lock class.
- Construct an in-place, pinned initializer forstructs.
- 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 aSeqFilewith the ordinary Rust formatting syntax.
- 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).
- Branch based on a static key.
- Construct an in-place fallible initializer forstructs.
- Construct an in-place, fallible pinned initializer forstructs.
Structs§
- Equivalent toTHIS_MODULEin the C API.
Traits§
- A module that is pinned and initialised in-place.
- The top level entrypoint to implementing a kernel module.