TianoCore EDK2 master
Loading...
Searching...
No Matches
AcpiLib.h File Reference

Go to the source code of this file.

Macros

#define NULL_GAS   { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_UNDEFINED, 0L }
 
#define ARM_GAS8(Address)   { EFI_ACPI_5_0_SYSTEM_MEMORY, 8, 0, EFI_ACPI_5_0_BYTE, Address }
 
#define ARM_GAS16(Address)   { EFI_ACPI_5_0_SYSTEM_MEMORY, 16, 0, EFI_ACPI_5_0_WORD, Address }
 
#define ARM_GAS32(Address)   { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_0_DWORD, Address }
 
#define ARM_GASN(Address)   { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_DWORD, Address }
 
#define EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, GicDistVector)
 
#define EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, GicDistVector, GicVersion)
 
#define EFI_ACPI_5_0_GIC_STRUCTURE_INIT(GicId, AcpiCpuId, Flags, PmuIrq, GicBase)
 
#define EFI_ACPI_5_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, GicBase, GicVBase, GicHBase, GsivId, GicRBase)
 
#define EFI_ACPI_6_0_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency)
 
#define EFI_ACPI_6_3_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency, SpeOvflIrq)
 
#define EFI_ACPI_6_0_GIC_MSI_FRAME_INIT(GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase)
 
#define EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(RefreshFramePhysicalAddress, ControlFramePhysicalAddress, WatchdogTimerGSIV, WatchdogTimerFlags)
 

Typedefs

typedef BOOLEAN(EFIAPI * EFI_LOCATE_ACPI_CHECK) (IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader)
 

Functions

EFI_STATUS LocateAndInstallAcpiFromFvConditional (IN CONST EFI_GUID *AcpiFile, IN EFI_LOCATE_ACPI_CHECK CheckAcpiTableFunction)
 
EFI_STATUS LocateAndInstallAcpiFromFv (IN CONST EFI_GUID *AcpiFile)
 
EFI_STATUS EFIAPI AcpiUpdateChecksum (IN OUT UINT8 *Buffer, IN UINTN Size)
 
EFI_STATUS EFIAPI AcpiLocateTableBySignature (IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol, IN UINT32 TableSignature, IN OUT UINTN *Index, OUT EFI_ACPI_DESCRIPTION_HEADER **Table, OUT UINTN *TableKey)
 
EFI_STATUS EFIAPI AcpiAmlObjectUpdateInteger (IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol, IN EFI_ACPI_HANDLE TableHandle, IN CHAR8 *AsciiObjectPath, IN UINTN Value)
 

Detailed Description

Helper Library for ACPI

Copyright (c) 2014-2016, ARM Ltd. All rights reserved. Copyright (c) 2021, Ampere Computing LLC. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file AcpiLib.h.

Macro Definition Documentation

◆ ARM_GAS16

#define ARM_GAS16 (   Address)    { EFI_ACPI_5_0_SYSTEM_MEMORY, 16, 0, EFI_ACPI_5_0_WORD, Address }

Definition at line 24 of file AcpiLib.h.

◆ ARM_GAS32

#define ARM_GAS32 (   Address)    { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_0_DWORD, Address }

Definition at line 25 of file AcpiLib.h.

◆ ARM_GAS8

#define ARM_GAS8 (   Address)    { EFI_ACPI_5_0_SYSTEM_MEMORY, 8, 0, EFI_ACPI_5_0_BYTE, Address }

Definition at line 23 of file AcpiLib.h.

◆ ARM_GASN

#define ARM_GASN (   Address)    { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_DWORD, Address }

Definition at line 26 of file AcpiLib.h.

◆ EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT

#define EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT (   GicDistHwId,
  GicDistBase,
  GicDistVector 
)
Value:
{ \
EFI_ACPI_5_0_GICD, sizeof (EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
GicDistHwId, GicDistBase, GicDistVector, EFI_ACPI_RESERVED_DWORD \
}

Definition at line 31 of file AcpiLib.h.

◆ EFI_ACPI_5_0_GIC_STRUCTURE_INIT

#define EFI_ACPI_5_0_GIC_STRUCTURE_INIT (   GicId,
  AcpiCpuId,
  Flags,
  PmuIrq,
  GicBase 
)
Value:
{ \
EFI_ACPI_5_0_GIC, sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
GicId, AcpiCpuId, Flags, 0, PmuIrq, 0, GicBase \
}

Definition at line 45 of file AcpiLib.h.

◆ EFI_ACPI_5_1_GICC_STRUCTURE_INIT

#define EFI_ACPI_5_1_GICC_STRUCTURE_INIT (   GicId,
  AcpiCpuUid,
  Mpidr,
  Flags,
  PmuIrq,
  GicBase,
  GicVBase,
  GicHBase,
  GsivId,
  GicRBase 
)
Value:
{ \
EFI_ACPI_5_1_GIC, sizeof (EFI_ACPI_5_1_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \
GsivId, GicRBase, Mpidr \
}

Definition at line 52 of file AcpiLib.h.

◆ EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT

#define EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT (   RefreshFramePhysicalAddress,
  ControlFramePhysicalAddress,
  WatchdogTimerGSIV,
  WatchdogTimerFlags 
)
Value:
{ \
EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG, sizeof(EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE), \
EFI_ACPI_RESERVED_BYTE, RefreshFramePhysicalAddress, ControlFramePhysicalAddress, \
WatchdogTimerGSIV, WatchdogTimerFlags \
}

Definition at line 86 of file AcpiLib.h.

◆ EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT

#define EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT (   GicDistHwId,
  GicDistBase,
  GicDistVector,
  GicVersion 
)
Value:
{ \
EFI_ACPI_6_0_GICD, sizeof (EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
GicDistHwId, GicDistBase, GicDistVector, GicVersion, \
{EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE} \
}

Definition at line 37 of file AcpiLib.h.

◆ EFI_ACPI_6_0_GIC_MSI_FRAME_INIT

#define EFI_ACPI_6_0_GIC_MSI_FRAME_INIT (   GicMsiFrameId,
  PhysicalBaseAddress,
  Flags,
  SPICount,
  SPIBase 
)
Value:
{ \
EFI_ACPI_6_0_GIC_MSI_FRAME, sizeof (EFI_ACPI_6_0_GIC_MSI_FRAME_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase \
}

Definition at line 77 of file AcpiLib.h.

◆ EFI_ACPI_6_0_GICC_STRUCTURE_INIT

#define EFI_ACPI_6_0_GICC_STRUCTURE_INIT (   GicId,
  AcpiCpuUid,
  Mpidr,
  Flags,
  PmuIrq,
  GicBase,
  GicVBase,
  GicHBase,
  GsivId,
  GicRBase,
  Efficiency 
)
Value:
{ \
EFI_ACPI_6_0_GIC, sizeof (EFI_ACPI_6_0_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \
GsivId, GicRBase, Mpidr, Efficiency, \
{EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE} \
}

Definition at line 60 of file AcpiLib.h.

◆ EFI_ACPI_6_3_GICC_STRUCTURE_INIT

#define EFI_ACPI_6_3_GICC_STRUCTURE_INIT (   GicId,
  AcpiCpuUid,
  Mpidr,
  Flags,
  PmuIrq,
  GicBase,
  GicVBase,
  GicHBase,
  GsivId,
  GicRBase,
  Efficiency,
  SpeOvflIrq 
)
Value:
{ \
EFI_ACPI_6_0_GIC, sizeof (EFI_ACPI_6_3_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \
GsivId, GicRBase, Mpidr, Efficiency, EFI_ACPI_RESERVED_BYTE, SpeOvflIrq \
}

Definition at line 69 of file AcpiLib.h.

◆ NULL_GAS

#define NULL_GAS   { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_UNDEFINED, 0L }

Definition at line 22 of file AcpiLib.h.

Typedef Documentation

◆ EFI_LOCATE_ACPI_CHECK

typedef BOOLEAN(EFIAPI * EFI_LOCATE_ACPI_CHECK) (IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader)

Definition at line 95 of file AcpiLib.h.

Function Documentation

◆ AcpiAmlObjectUpdateInteger()

EFI_STATUS EFIAPI AcpiAmlObjectUpdateInteger ( IN EFI_ACPI_SDT_PROTOCOL AcpiSdtProtocol,
IN EFI_ACPI_HANDLE  TableHandle,
IN CHAR8 *  AsciiObjectPath,
IN UINTN  Value 
)

This function updates the integer value of an AML Object.

Parameters
AcpiTableSdtProtocolPointer to ACPI SDT protocol.
TableHandlePoints to the table representing the starting point for the object path search.
AsciiObjectPathPointer to the ACPI path of the object being updated.
ValueNew value to write to the object.
Returns
EFI_SUCCESS The function completed successfully.
EFI_INVALID_PARAMETER At least one of parameters is invalid or the data type of the ACPI object is not an integer value.
Return values
EFI_NOT_FOUNDThe object is not found with the given path.

Definition at line 308 of file AcpiLib.c.

◆ AcpiLocateTableBySignature()

EFI_STATUS EFIAPI AcpiLocateTableBySignature ( IN EFI_ACPI_SDT_PROTOCOL AcpiSdtProtocol,
IN UINT32  TableSignature,
IN OUT UINTN Index,
OUT EFI_ACPI_DESCRIPTION_HEADER **  Table,
OUT UINTN TableKey 
)

This function uses the ACPI SDT protocol to search an ACPI table with a given signature.

Parameters
AcpiTableSdtProtocolPointer to ACPI SDT protocol.
TableSignatureACPI table signature.
IndexThe zero-based index of the table where to search the table. The index will be updated to the next instance if the table is found with the matched TableSignature.
TablePointer to the table.
TableKeyPointer to the table key.
Returns
EFI_SUCCESS The function completed successfully.
EFI_INVALID_PARAMETER At least one of parameters is invalid.
Return values
EFI_NOT_FOUNDThe requested index is too large and a table was not found.

Definition at line 243 of file AcpiLib.c.

◆ AcpiUpdateChecksum()

EFI_STATUS EFIAPI AcpiUpdateChecksum ( IN OUT UINT8 *  Buffer,
IN UINTN  Size 
)

This function calculates and updates a UINT8 checksum in an ACPI description table header.

Parameters
BufferPointer to buffer to checksum
SizeNumber of bytes to checksum
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 198 of file AcpiLib.c.

◆ LocateAndInstallAcpiFromFv()

EFI_STATUS LocateAndInstallAcpiFromFv ( IN CONST EFI_GUID AcpiFile)

Locate and Install the ACPI tables from the Firmware Volume

Parameters
AcpiFileGuid of the ACPI file into the Firmware Volume
Returns
EFI_SUCCESS The function completed successfully.
EFI_NOT_FOUND The protocol could not be located.
EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol.

Definition at line 178 of file AcpiLib.c.

◆ LocateAndInstallAcpiFromFvConditional()

EFI_STATUS LocateAndInstallAcpiFromFvConditional ( IN CONST EFI_GUID AcpiFile,
IN EFI_LOCATE_ACPI_CHECK  CheckAcpiTableFunction 
)

Locate and Install the ACPI tables from the Firmware Volume if it verifies the function condition.

Parameters
AcpiFileGuid of the ACPI file into the Firmware Volume
CheckAcpiTableFunctionFunction that checks if the ACPI table should be installed
Returns
EFI_SUCCESS The function completed successfully.
EFI_NOT_FOUND The protocol could not be located.
EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol.

Definition at line 37 of file AcpiLib.c.