Expand description
axklib — small kernel-helper abstractions used across the microkernel
This crate exposes a tiny, no_std-compatible trait (Klib) that the
platform/board layer must implement. The trait provides a handful of
common kernel helpers such as memory mapping helpers, timing utilities,
and IRQ registration. The implementation is supplied by the platform
(see modules/axklib-impl) and consumed by drivers and other modules.
The crate also provides small convenience modules (mem, time, irq)
that re-export the trait methods with shorter names to make call sites
more ergonomic.
Example usage:
ⓘ
// map 4K of device MMIO at physical address `paddr`
let vaddr = axklib::mem::iomap(paddr, 0x1000)?;
// busy-wait for 100 microseconds
axklib::time::busy_wait(core::time::Duration::from_micros(100));
// register an IRQ handler
axklib::irq::register(32, my_irq_handler);Modules§
- irq
- Convenience re-exports for IRQ operations.
- klib
- Module generated by
trait-ffi. - mem
- Convenience re-export for memory IO mapping.
- time
- Convenience re-export for busy-wait timing.
Macros§
- impl_
trait - Implement the extern trait for a type.
Structs§
Traits§
- Klib
- The kernel helper trait that platform implementations must provide.
Type Aliases§
- AxResult
- A specialized
Resulttype withAxErroras the error type. - IrqHandler
- A simple IRQ handler function pointer type.
Attribute Macros§
- impl_
extern_ trait - Helper macro to implement the extern trait for a type. Implements an extern trait for a type and generates corresponding C function exports.