squib_arch/lib.rs
1//! aarch64 architecture support for squib.
2//!
3//! `squib-arch` is the single source of truth for every architecture-specific constant
4//! and protocol the boot path depends on. It is consumed by the HVF backend
5//! (`squib-hv`), the FDT builder (`squib-fdt`), the kernel loader (`squib-loader`), and
6//! the VMM boot orchestrator (`squib-vmm`). If a constant is in this crate, no other
7//! crate is allowed to invent it.
8//!
9//! See [13-arch-and-boot.md](../../../specs/13-arch-and-boot.md) for the full design.
10//!
11//! # Modules
12//!
13//! - [`layout`] — fixed memory layout (D22) with const overlap-checks and the page geometry.
14//! - [`gic`] — [`IntId`] newtype that pins the FDT-cell ↔ raw-INTID mapping.
15//! - [`esr`] — ESR_EL2 decoder; never panics on a malformed input.
16//! - [`psci`] — PSCI 1.1 dispatch table; unknown IDs return `NOT_SUPPORTED`.
17//! - [`regs`] — the `Reg` enum (X0..X30, SP, PC, PSTATE) and `set_boot_regs` helper.
18//! - [`sysregs`] — curated sysreg subset (~100 regs we touch).
19
20#![forbid(unsafe_code)]
21#![warn(missing_docs)]
22// aarch64 sysreg / PSCI / GIC / FDT identifiers are upper-case by convention; surrounding
23// every one with backticks bloats the docs without adding clarity.
24#![allow(clippy::doc_markdown)]
25
26pub mod esr;
27pub mod gic;
28pub mod layout;
29pub mod psci;
30pub mod regs;
31pub mod sysregs;
32
33pub use esr::{EsrDecoded, decode as decode_esr};
34pub use gic::{IntId, IntIdError, Trigger};
35pub use layout::{LayoutOverlap, MEMORY_LAYOUT, MemoryLayout, PageGeometry};
36pub use psci::{PsciFunction, PsciOutcome, PsciReturn, dispatch as dispatch_psci};
37pub use regs::{BOOT_PSTATE, BootRegs, Reg};
38pub use sysregs::SysReg;