#x86 #system-programming #apic

lapic

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

2 releases

0.1.1 Oct 27, 2023
0.1.0 Oct 27, 2023

#69 in #x86

Custom license

13KB
299 lines

lapic

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

Refer to the generated cargo documentation.


lib.rs:

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.

Dependencies

~1.5MB
~38K SLoC