Struct acpi::rsdp::Rsdp

source ·
#[repr(C, packed)]
pub struct Rsdp { /* private fields */ }
Expand description

The first structure found in ACPI. It just tells us where the RSDT is.

On BIOS systems, it is either found in the first 1KiB of the Extended Bios Data Area, or between 0x000e0000 and 0x000fffff. The signature is always on a 16 byte boundary. On (U)EFI, it may not be located in these locations, and so an address should be found in the EFI configuration table instead.

The recommended way of locating the RSDP is to let the bootloader do it - Multiboot2 can pass a tag with the physical address of it. If this is not possible, a manual scan can be done.

If revision > 0, (the hardware ACPI version is Version 2.0 or greater), the RSDP contains some new fields. For ACPI Version 1.0, these fields are not valid and should not be accessed. For ACPI Version 2.0+, xsdt_address should be used (truncated to u32 on x86) instead of rsdt_address.

Implementations§

source§

impl Rsdp

source

pub unsafe fn search_for_on_bios<H>( handler: H ) -> AcpiResult<PhysicalMapping<H, Rsdp>>where H: AcpiHandler,

This searches for a RSDP on BIOS systems.

Safety

This function probes memory in three locations:

  • It reads a word from 40:0e to locate the EBDA.
  • The first 1KiB of the EBDA (Extended BIOS Data Area).
  • The BIOS memory area at 0xe0000..=0xfffff.

This should be fine on all BIOS systems. However, UEFI platforms are free to put the RSDP wherever they please, so this won’t always find the RSDP. Further, prodding these memory locations may have unintended side-effects. On UEFI systems, the RSDP should be found in the Configuration Table, using two GUIDs: - ACPI v1.0 structures use eb9d2d30-2d88-11d3-9a16-0090273fc14d. - ACPI v2.0 or later structures use 8868e871-e4f1-11d3-bc22-0080c73c8881. You should search the entire table for the v2.0 GUID before searching for the v1.0 one.

source

pub fn validate(&self) -> AcpiResult<()>

Checks that: 1) The signature is correct 2) The checksum is correct 3) For Version 2.0+, that the extension checksum is correct

source

pub fn signature(&self) -> [u8; 8]

source

pub fn checksum(&self) -> u8

source

pub fn oem_id(&self) -> &str

source

pub fn revision(&self) -> u8

source

pub fn rsdt_address(&self) -> u32

source

pub fn length(&self) -> u32

source

pub fn xsdt_address(&self) -> u64

source

pub fn ext_checksum(&self) -> u8

Trait Implementations§

source§

impl Clone for Rsdp

source§

fn clone(&self) -> Rsdp

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Rsdp

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Rsdp

Auto Trait Implementations§

§

impl RefUnwindSafe for Rsdp

§

impl Send for Rsdp

§

impl Sync for Rsdp

§

impl Unpin for Rsdp

§

impl UnwindSafe for Rsdp

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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.