use std::string::String;
#[derive(Clone, Debug, Eq, PartialEq, thiserror::Error)]
pub enum AcpiBuildError {
#[error("ACPI object {object} has invalid alignment {alignment:#x}")]
InvalidAlignment {
object: String,
alignment: usize,
},
#[error("ACPI object {object} address range overflows")]
AddressOverflow {
object: String,
},
#[error(
"ACPI arena [{base:#x}, {limit:#x}) cannot fit {object} ({size:#x} bytes, align \
{alignment:#x})"
)]
ArenaExhausted {
base: u64,
limit: u64,
object: String,
size: usize,
alignment: usize,
},
#[error("ACPI object {object} write length {actual:#x} differs from reservation {expected:#x}")]
LengthMismatch {
object: String,
expected: usize,
actual: usize,
},
#[cfg(any(target_arch = "x86_64", test))]
#[error("ACPI table {signature:?} is registered more than once")]
DuplicateTable {
signature: [u8; 4],
},
#[error("ACPI value {value} is invalid for {field}")]
InvalidValue {
field: &'static str,
value: String,
},
#[error("ACPI loader file name '{name}' is empty or exceeds 55 bytes")]
InvalidLoaderFile {
name: String,
},
}