[−][src]Struct acpi::AcpiTables
Fields
revision: u8
The revision of ACPI that the system uses, as inferred from the revision of the RSDT/XSDT.
sdts: BTreeMap<Signature, Sdt>
dsdt: Option<AmlTable>
ssdts: Vec<AmlTable>
Implementations
impl<H> AcpiTables<H> where
H: AcpiHandler,
[src]
H: AcpiHandler,
pub unsafe fn from_rsdp(
handler: H,
rsdp_address: usize
) -> Result<AcpiTables<H>, AcpiError>
[src]
handler: H,
rsdp_address: usize
) -> Result<AcpiTables<H>, AcpiError>
Create an AcpiTables
if you have the physical address of the RSDP.
pub unsafe fn search_for_rsdp_bios(
handler: H
) -> Result<AcpiTables<H>, AcpiError>
[src]
handler: H
) -> Result<AcpiTables<H>, AcpiError>
Search for the RSDP on a BIOS platform. This accesses BIOS-specific memory locations and will probably not work on UEFI platforms. See Rsdp::search_for_rsdp_bios for details.
pub fn from_validated_rsdp(
handler: H,
rsdp_mapping: PhysicalMapping<H, Rsdp>
) -> Result<AcpiTables<H>, AcpiError>
[src]
handler: H,
rsdp_mapping: PhysicalMapping<H, Rsdp>
) -> Result<AcpiTables<H>, AcpiError>
Create an AcpiTables
if you have a PhysicalMapping
of the RSDP that you know is correct. This is called
from from_rsdp
after validation, but can also be used if you've searched for the RSDP manually on a BIOS
system.
pub unsafe fn from_rsdt(
handler: H,
revision: u8,
rsdt_address: usize
) -> Result<AcpiTables<H>, AcpiError>
[src]
handler: H,
revision: u8,
rsdt_address: usize
) -> Result<AcpiTables<H>, AcpiError>
Create an AcpiTables
if you have the physical address of the RSDT. This is useful, for example, if your chosen
bootloader reads the RSDP and passes you the address of the RSDT. You also need to supply the correct ACPI
revision - if 0
, a RSDT is expected, while a XSDT
is expected for greater revisions.
pub fn from_tables_direct(
handler: H,
revision: u8,
sdts: BTreeMap<Signature, Sdt>,
dsdt: Option<AmlTable>,
ssdts: Vec<AmlTable>
) -> AcpiTables<H>
[src]
handler: H,
revision: u8,
sdts: BTreeMap<Signature, Sdt>,
dsdt: Option<AmlTable>,
ssdts: Vec<AmlTable>
) -> AcpiTables<H>
Construct an AcpiTables
from a custom set of "discovered" tables. This is provided to allow the library
to be used from unconventional settings (e.g. in userspace), for example with a AcpiHandler
that detects
accesses to specific physical addresses, and provides the correct data.
pub unsafe fn get_sdt<T>(
&self,
signature: Signature
) -> Result<Option<PhysicalMapping<H, T>>, AcpiError> where
T: AcpiTable,
[src]
&self,
signature: Signature
) -> Result<Option<PhysicalMapping<H, T>>, AcpiError> where
T: AcpiTable,
Create a mapping to a SDT, given its signature. This validates the SDT if it has not already been validated.
Safety
The table's memory is naively interpreted as a T
, and so you must be careful in providing a type that
correctly represents the table's structure. Regardless of the provided type's size, the region mapped will
be the size specified in the SDT's header. Providing a T
that is larger than this, may lead to
page-faults, aliasing references, or derefencing uninitialized memory (the latter two of which are UB).
This isn't forbidden, however, because some tables rely on T
being larger than a provided SDT in some
versions of ACPI (the ExtendedField
type will be useful if you need to do
this. See our Fadt
type for an example of this).
pub fn platform_info(&self) -> Result<PlatformInfo, AcpiError>
[src]
Convenience method for contructing a PlatformInfo
. This is one of the
first things you should usually do with an AcpiTables
, and allows to collect helpful information about
the platform from the ACPI tables.
Auto Trait Implementations
impl<H> Send for AcpiTables<H> where
H: Send,
[src]
H: Send,
impl<H> Sync for AcpiTables<H> where
H: Sync,
[src]
H: Sync,
impl<H> Unpin for AcpiTables<H> where
H: Unpin,
[src]
H: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,