From 79cb6d9057642be31623677458a93aa88145864f Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Tue, 2 Jun 2026 15:38:05 +0200 Subject: [PATCH] Add AcpiVerb --- src/flag.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/flag.rs b/src/flag.rs index 1a21d54b20..455ec36b55 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -301,6 +301,26 @@ impl FileTableVerb { } } +// NOT ABI-STABLE! +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[repr(u64)] +pub enum AcpiVerb { + // copies the rsdt/xsdt to the payload buffer (the number of bytes that fit), and returns the + // rsdt/xsdt length regardless + ReadRxsdt = 1, + // no payload, just returns 0 or 1 + CheckShutdown = 2, +} +impl AcpiVerb { + pub const fn try_from_raw(value: u64) -> Option { + Some(match value { + 1 => Self::ReadRxsdt, + 2 => Self::CheckShutdown, + _ => return None, + }) + } +} + #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[repr(usize)] pub enum SchemeSocketCall {