TianoCore EDK2 master
Loading...
Searching...
No Matches
MadtGenerator.c File Reference

Go to the source code of this file.

Macros

#define MADT_GENERATOR_REVISION   CREATE_REVISION (1, 0)
 

Functions

 GET_OBJECT_LIST (EObjNameSpaceArm, EArmObjGicCInfo, CM_ARM_GICC_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArm, EArmObjGicDInfo, CM_ARM_GICD_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArm, EArmObjGicMsiFrameInfo, CM_ARM_GIC_MSI_FRAME_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArm, EArmObjGicRedistributorInfo, CM_ARM_GIC_REDIST_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArm, EArmObjGicItsInfo, CM_ARM_GIC_ITS_INFO)
 
STATIC VOID AddGICC (IN EFI_ACPI_6_5_GIC_STRUCTURE *CONST Gicc, IN CONST CM_ARM_GICC_INFO *CONST GicCInfo, IN CONST UINT8 MadtRev)
 
BOOLEAN EFIAPI IsAcpiUidEqual (IN CONST VOID *GicCInfo1, IN CONST VOID *GicCInfo2, IN UINTN Index1, IN UINTN Index2)
 
STATIC EFI_STATUS AddGICCList (IN EFI_ACPI_6_5_GIC_STRUCTURE *Gicc, IN CONST CM_ARM_GICC_INFO *GicCInfo, IN UINT32 GicCCount, IN CONST UINT8 MadtRev)
 
STATIC VOID AddGICD (EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE *CONST Gicd, CONST CM_ARM_GICD_INFO *CONST GicDInfo)
 
STATIC VOID AddGICMsiFrame (IN EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE *CONST GicMsiFrame, IN CONST CM_ARM_GIC_MSI_FRAME_INFO *CONST GicMsiFrameInfo)
 
STATIC VOID AddGICMsiFrameInfoList (IN EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE *GicMsiFrame, IN CONST CM_ARM_GIC_MSI_FRAME_INFO *GicMsiFrameInfo, IN UINT32 GicMsiFrameCount)
 
STATIC VOID AddGICRedistributor (IN EFI_ACPI_6_5_GICR_STRUCTURE *CONST Gicr, IN CONST CM_ARM_GIC_REDIST_INFO *CONST GicRedistributorInfo)
 
STATIC VOID AddGICRedistributorList (IN EFI_ACPI_6_5_GICR_STRUCTURE *Gicr, IN CONST CM_ARM_GIC_REDIST_INFO *GicRInfo, IN UINT32 GicRCount)
 
STATIC VOID AddGICInterruptTranslationService (IN EFI_ACPI_6_5_GIC_ITS_STRUCTURE *CONST GicIts, IN CONST CM_ARM_GIC_ITS_INFO *CONST GicItsInfo)
 
STATIC VOID AddGICItsList (IN EFI_ACPI_6_5_GIC_ITS_STRUCTURE *GicIts, IN CONST CM_ARM_GIC_ITS_INFO *GicItsInfo, IN UINT32 GicItsCount)
 
STATIC EFI_STATUS EFIAPI BuildMadtTable (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
 
STATIC EFI_STATUS FreeMadtTableResources (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
 
EFI_STATUS EFIAPI AcpiMadtLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI AcpiMadtLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC CONST ACPI_TABLE_GENERATOR MadtGenerator
 

Detailed Description

MADT Table Generator

Copyright (c) 2017 - 2023, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Reference(s):
  • ACPI 6.5 Specification - Aug 29, 2022

Definition in file MadtGenerator.c.

Macro Definition Documentation

◆ MADT_GENERATOR_REVISION

#define MADT_GENERATOR_REVISION   CREATE_REVISION (1, 0)

The MADT Table Generator revision.

Definition at line 760 of file MadtGenerator.c.

Function Documentation

◆ AcpiMadtLibConstructor()

EFI_STATUS EFIAPI AcpiMadtLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Register the Generator with the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is registered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_ALREADY_STARTEDThe Generator for the Table ID is already registered.

Definition at line 804 of file MadtGenerator.c.

◆ AcpiMadtLibDestructor()

EFI_STATUS EFIAPI AcpiMadtLibDestructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Deregister the Generator from the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is deregistered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe Generator is not registered.

Definition at line 828 of file MadtGenerator.c.

◆ AddGICC()

STATIC VOID AddGICC ( IN EFI_ACPI_6_5_GIC_STRUCTURE *CONST  Gicc,
IN CONST CM_ARM_GICC_INFO *CONST  GicCInfo,
IN CONST UINT8  MadtRev 
)

This function updates the GIC CPU Interface Information in the EFI_ACPI_6_5_GIC_STRUCTURE structure.

Parameters
[in]GiccPointer to GIC CPU Interface structure.
[in]GicCInfoPointer to the GIC CPU Interface Information.
[in]MadtRevMADT table revision.

Definition at line 93 of file MadtGenerator.c.

◆ AddGICCList()

STATIC EFI_STATUS AddGICCList ( IN EFI_ACPI_6_5_GIC_STRUCTURE Gicc,
IN CONST CM_ARM_GICC_INFO GicCInfo,
IN UINT32  GicCCount,
IN CONST UINT8  MadtRev 
)

Add the GIC CPU Interface Information to the MADT Table.

This function also checks for duplicate ACPI Processor UIDs.

Parameters
[in]GiccPointer to GIC CPU Interface structure list.
[in]GicCInfoPointer to the GIC CPU Information list.
[in]GicCCountCount of GIC CPU Interfaces.
[in]MadtRevMADT table revision.
Return values
EFI_SUCCESSGIC CPU Interface Information was added successfully.
EFI_INVALID_PARAMETEROne or more invalid GIC CPU Info values were provided and the generator failed to add the information to the table.

Definition at line 221 of file MadtGenerator.c.

◆ AddGICD()

Update the GIC Distributor Information in the MADT Table.

Parameters
[in]GicdPointer to GIC Distributor structure.
[in]GicDInfoPointer to the GIC Distributor Information.

Definition at line 259 of file MadtGenerator.c.

◆ AddGICInterruptTranslationService()

STATIC VOID AddGICInterruptTranslationService ( IN EFI_ACPI_6_5_GIC_ITS_STRUCTURE *CONST  GicIts,
IN CONST CM_ARM_GIC_ITS_INFO *CONST  GicItsInfo 
)

Update the GIC Interrupt Translation Service Information

Parameters
[in]GicItsPointer to GIC ITS structure.
[in]GicItsInfoPointer to the GIC ITS Information.

Definition at line 389 of file MadtGenerator.c.

◆ AddGICItsList()

STATIC VOID AddGICItsList ( IN EFI_ACPI_6_5_GIC_ITS_STRUCTURE GicIts,
IN CONST CM_ARM_GIC_ITS_INFO GicItsInfo,
IN UINT32  GicItsCount 
)

Add the GIC Interrupt Translation Service Information to the MADT Table.

Parameters
[in]GicItsPointer to GIC ITS structure list.
[in]GicItsInfoPointer to the GIC ITS list.
[in]GicItsCountCount of GIC ITS.

Definition at line 414 of file MadtGenerator.c.

◆ AddGICMsiFrame()

STATIC VOID AddGICMsiFrame ( IN EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE *CONST  GicMsiFrame,
IN CONST CM_ARM_GIC_MSI_FRAME_INFO *CONST  GicMsiFrameInfo 
)

Update the GIC MSI Frame Information.

Parameters
[in]GicMsiFramePointer to GIC MSI Frame structure.
[in]GicMsiFrameInfoPointer to the GIC MSI Frame Information.

Definition at line 296 of file MadtGenerator.c.

◆ AddGICMsiFrameInfoList()

STATIC VOID AddGICMsiFrameInfoList ( IN EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE GicMsiFrame,
IN CONST CM_ARM_GIC_MSI_FRAME_INFO GicMsiFrameInfo,
IN UINT32  GicMsiFrameCount 
)

Add the GIC MSI Frame Information to the MADT Table.

Parameters
[in]GicMsiFramePointer to GIC MSI Frame structure list.
[in]GicMsiFrameInfoPointer to the GIC MSI Frame info list.
[in]GicMsiFrameCountCount of GIC MSI Frames.

Definition at line 323 of file MadtGenerator.c.

◆ AddGICRedistributor()

STATIC VOID AddGICRedistributor ( IN EFI_ACPI_6_5_GICR_STRUCTURE *CONST  Gicr,
IN CONST CM_ARM_GIC_REDIST_INFO *CONST  GicRedistributorInfo 
)

Update the GIC Redistributor Information.

Parameters
[in]GicrPointer to GIC Redistributor structure.
[in]GicRedistributorInfoPointer to the GIC Redistributor Info.

Definition at line 344 of file MadtGenerator.c.

◆ AddGICRedistributorList()

STATIC VOID AddGICRedistributorList ( IN EFI_ACPI_6_5_GICR_STRUCTURE Gicr,
IN CONST CM_ARM_GIC_REDIST_INFO GicRInfo,
IN UINT32  GicRCount 
)

Add the GIC Redistributor Information to the MADT Table.

Parameters
[in]GicrPointer to GIC Redistributor structure list.
[in]GicRInfoPointer to the GIC Distributor info list.
[in]GicRCountCount of GIC Distributors.

Definition at line 368 of file MadtGenerator.c.

◆ BuildMadtTable()

Construct the MADT ACPI table.

This function invokes the Configuration Manager protocol interface to get the required hardware information for generating the ACPI table.

If this function allocates any resources then they must be freed in the FreeXXXXTableResources function.

Parameters
[in]ThisPointer to the table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[out]TablePointer to the constructed ACPI Table.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe required object was not found.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.

Definition at line 453 of file MadtGenerator.c.

◆ FreeMadtTableResources()

Free any resources allocated for constructing the MADT

Parameters
[in]ThisPointer to the table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in,out]TablePointer to the ACPI Table.
Return values
EFI_SUCCESSThe resources were freed successfully.
EFI_INVALID_PARAMETERThe table pointer is NULL or invalid.

Definition at line 734 of file MadtGenerator.c.

◆ GET_OBJECT_LIST() [1/5]

GET_OBJECT_LIST ( EObjNameSpaceArm  ,
EArmObjGicCInfo  ,
CM_ARM_GICC_INFO   
)

ARM standard MADT Generator

Requirements: The following Configuration Manager Object(s) are required by this Generator:

  • EArmObjGicCInfo
  • EArmObjGicDInfo
  • EArmObjGicMsiFrameInfo (OPTIONAL)
  • EArmObjGicRedistributorInfo (OPTIONAL)
  • EArmObjGicItsInfo (OPTIONAL) This macro expands to a function that retrieves the GIC CPU interface Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [2/5]

GET_OBJECT_LIST ( EObjNameSpaceArm  ,
EArmObjGicDInfo  ,
CM_ARM_GICD_INFO   
)

This macro expands to a function that retrieves the GIC Distributor Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [3/5]

GET_OBJECT_LIST ( EObjNameSpaceArm  ,
EArmObjGicItsInfo  ,
CM_ARM_GIC_ITS_INFO   
)

This macro expands to a function that retrieves the GIC Interrupt Translation Service Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [4/5]

This macro expands to a function that retrieves the GIC MSI Frame Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [5/5]

This macro expands to a function that retrieves the GIC Redistributor Information from the Configuration Manager.

◆ IsAcpiUidEqual()

BOOLEAN EFIAPI IsAcpiUidEqual ( IN CONST VOID *  GicCInfo1,
IN CONST VOID *  GicCInfo2,
IN UINTN  Index1,
IN UINTN  Index2 
)

Function to test if two GIC CPU Interface information structures have the same ACPI Processor UID.

Parameters
[in]GicCInfo1Pointer to the first GICC info structure.
[in]GicCInfo2Pointer to the second GICC info structure.
[in]Index1Index of GicCInfo1 in the shared list of GIC CPU Interface Info structures.
[in]Index2Index of GicCInfo2 in the shared list of GIC CPU Interface Info structures.
Return values
TRUEGicCInfo1 and GicCInfo2 have the same UID.
FALSEGicCInfo1 and GicCInfo2 have different UIDs.

Definition at line 174 of file MadtGenerator.c.

Variable Documentation

◆ MadtGenerator

Initial value:
= {
L"ACPI.STD.MADT.GENERATOR",
}
#define EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION
Definition: Acpi62.h:397
#define EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE
Definition: Acpi65.h:3027
#define EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION
Definition: Acpi65.h:307
#define TABLE_GENERATOR_CREATOR_ID_ARM
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
@ EStdAcpiTableIdMadt
MADT Generator.
STATIC EFI_STATUS EFIAPI BuildMadtTable(IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
STATIC EFI_STATUS FreeMadtTableResources(IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
#define MADT_GENERATOR_REVISION
#define NULL
Definition: Base.h:319

The interface for the MADT Table Generator.

Definition at line 766 of file MadtGenerator.c.