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§

ApicId
Local APIC register.
ApicVersion
ACIC Version Register.
BitfieldRegister
Bitfield structure for the ISR, TMR or IRR.
DestinationFormat
Destination Format Register.
EndOfInterrupt
End of Interrupt Register (EOI).
ErrorLVT
Error Vector Table Entry.
ErrorStatus
Error Status Register (ESR).
InterruptCmdHigh
Interrupt Command Register High (bits 63:32).
InterruptCmdLow
Interrupt Command Register Low (bits 31:0).
LIntLVT
Structure for Local Interrupt 0 and 1 Vector Table Entries.
LocalApic
Local APIC registers.
LogicalDestination
Logical Destination Register.
PerfLVT
Performance Counter Local Vector Table Entry.
PriorityRegister
Priority structure for the TPR, APR or PPR.
SpuriousInterruptVector
Spurious Interrupt Vector Register.
ThermalLVT
Thermal Local Vector Table Entry.
TimerCount
Structure for Initial and Current Timer Count Registers.
TimerDivConf
Timer Divide Configuration Register.
TimerLVT
Timer Local Vector Table Entry.