8/22/2024

ACPI Library

 Introduction

ACPI related library is added.

AcpiLib.py

AcpiTableDb.py

According to Overview of the System Description Table Architecture, it provides these APIs.

def ScanAcpiRsdp ():

def BuildAcpiHub ():

def GetAcpiVersion (AcpiEntries):

def RetrieveAcpiType (SignatureByte = None, SignatureInt = None, AcpiEntries = {}):

ScanAcpiRsdp ()

It returns (Rsdp, Rsdt, Xsdt, TableAddresses).

RsdpEFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER's object from gST's configuration table.

Rsdt, ACPI Rsdt object

Xsdt, ACPI Xsdt object

TableAddresses, each ACPI table address in ctypes array type.

BuildAcpiHub ()

It returns (DsdtAddress, SsdtAddress, AcpiEntries).

DsdtAddress, Dsdt physical address recorded in gST configuration table.

SsdtAddress, Ssdt physical addresses recorded in gST configuration table. python list type.

AcpiEntries, remaining ACPI tables in Python dict type. {Signature: AcpiAddress}

GetAcpiVersion (AcpiEntries)

Return ACPI version information from FADT, return type is (Major, Minor, Errata).

RetrieveAcpiType (SignatureByte, SignatureInt, AcpiEntries)

It checks if AcpiEntries have ACPI table with its signature matching SignatureByte or SignatureInt. It returns (AcpiType, AcpiAddr) if above condition is true.

AcpiType, due to each ACPI table has its own revision, this function returns the type with most approaching ACPI table revision.

AcpiAddr, ACPI table's physical address.

Example

Here it is.

There will be another post to list ACPI samples.



No comments:

Post a Comment