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
impl AcpiTables
sourcepub const fn empty() -> AcpiTables
pub const fn empty() -> AcpiTables
Returns a new empty AcpiTables
object.
sourcepub fn map_new_table(
&mut self,
sdt_phys_addr: PhysicalAddress,
page_table: &mut PageTable
) -> Result<(AcpiSignature, usize), &'static str>
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.
sourcepub fn add_table_location(
&mut self,
signature: AcpiSignature,
phys_addr: PhysicalAddress,
slice_phys_addr_and_length: Option<(PhysicalAddress, usize)>
) -> Result<(), &'static str>
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
: thePhysicalAddress
of the table in memory, which is used to calculate its offset.slice_phys_addr_and_length
: a tuple of thePhysicalAddress
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 isNone
.
sourcepub fn table_location(
&self,
signature: &AcpiSignature
) -> Option<&TableLocation>
pub fn table_location( &self, signature: &AcpiSignature ) -> Option<&TableLocation>
Returns the location of the ACPI table based on the given table signature
.
sourcepub fn table<T: FromBytes>(
&self,
signature: &AcpiSignature
) -> Result<&T, &'static str>
pub fn table<T: FromBytes>( &self, signature: &AcpiSignature ) -> Result<&T, &'static str>
Returns a reference to the table that matches the specified ACPI signature
.
sourcepub fn table_mut<T: FromBytes>(
&mut self,
signature: &AcpiSignature
) -> Result<&mut T, &'static str>
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
.
sourcepub fn table_slice<S: FromBytes>(
&self,
signature: &AcpiSignature
) -> Result<&[S], &'static str>
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.
sourcepub fn table_slice_mut<S: FromBytes>(
&mut self,
signature: &AcpiSignature
) -> Result<&mut [S], &'static str>
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.