Struct acpi_table::AcpiTables

source ·
pub struct AcpiTables { /* private fields */ }
Expand description

The struct holding all ACPI tables and records of where they exist in memory. All ACPI tables are covered by a single large MappedPages object, which is necessary because they may span multiple pages/frames, and generally should not be multiply aliased/accessed due to potential race conditions. As more ACPI tables are discovered, the single MappedPages object is extended to cover them.

Implementations§

source§

impl AcpiTables

source

pub const fn empty() -> AcpiTables

Returns a new empty AcpiTables object.

source

pub fn map_new_table( &mut self, sdt_phys_addr: PhysicalAddress, page_table: &mut PageTable ) -> Result<(AcpiSignature, usize), &'static str>

Map the ACPI table that exists at the given PhysicalAddress, where an SDT header must exist. Ensures that the entire ACPI table is mapped, including extra length that may be specified within the SDT.

Returns a tuple describing the SDT discovered at the given sdt_phys_addr: the AcpiSignature and the total length of the table.

source

pub fn add_table_location( &mut self, signature: AcpiSignature, phys_addr: PhysicalAddress, slice_phys_addr_and_length: Option<(PhysicalAddress, usize)> ) -> Result<(), &'static str>

Add the location and size details of a discovered ACPI table, which allows others to query for and access the table in the future.

Arguments
  • signature: the signature of the ACPI table that is being added, e.g., b"RSDT".
  • phys_addr: the PhysicalAddress of the table in memory, which is used to calculate its offset.
  • slice_phys_addr_and_length: a tuple of the PhysicalAddress where the dynamic part of this table begins, and the number of elements in that dynamic table part. If this table does not have a dynamic part, this is None.
source

pub fn table_location( &self, signature: &AcpiSignature ) -> Option<&TableLocation>

Returns the location of the ACPI table based on the given table signature.

source

pub fn table<T: FromBytes>( &self, signature: &AcpiSignature ) -> Result<&T, &'static str>

Returns a reference to the table that matches the specified ACPI signature.

source

pub fn table_mut<T: FromBytes>( &mut self, signature: &AcpiSignature ) -> Result<&mut T, &'static str>

Returns a mutable reference to the table that matches the specified ACPI signature.

source

pub fn table_slice<S: FromBytes>( &self, signature: &AcpiSignature ) -> Result<&[S], &'static str>

Returns a reference to the dynamically-sized part at the end of the table that matches the specified ACPI signature, if it exists. For example, this returns the array of SDT physical addresses at the end of the RSDT table.

source

pub fn table_slice_mut<S: FromBytes>( &mut self, signature: &AcpiSignature ) -> Result<&mut [S], &'static str>

Returns a mutable reference to the dynamically-sized part at the end of the table that matches the specified ACPI signature, if it exists. For example, this returns the array of SDT physical addresses at the end of the RSDT table.

source

pub fn mapping(&self) -> &MappedPages

Returns an immutable reference to the underlying MappedPages that covers the ACPI tables. To access the ACPI tables, use the table’s get() function, e.g., Fadt::get(...) instead of this function.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.