Crate lapic

source ·
Expand description

A self-contained crate implementing safe types for the local APIC registers on x86_64 systems.

More information on the local APIC standard can be obtained on chapter 16: Local APIC from the AMD Architecture Programmer’s Manual Vol. 2: System Programming.

This crate does not depend on the standard Rust library and uses #![forbid(unsafe_code)].

Usage

The main type of this crate is the LocalApic structure. It has no invalid representations, and has every APIC register laid out as needed so it can be safely laid over mapped memory, provided the region has the right alignment.

All the registers in the structure provide safe setters and getters to access the bitfields in those registers, as well as methods to convert the registers to and from raw bytes, thanks to the modular_bitfield crate.

Structs