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

Go to the source code of this file.

Macros

#define GTDT_GENERATOR_REVISION   CREATE_REVISION (1, 0)
 

Functions

 GET_OBJECT_LIST (EObjNameSpaceArm, EArmObjGenericTimerInfo, CM_ARM_GENERIC_TIMER_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArm, EArmObjPlatformGenericWatchdogInfo, CM_ARM_GENERIC_WATCHDOG_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArm, EArmObjPlatformGTBlockInfo, CM_ARM_GTBLOCK_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArm, EArmObjGTBlockTimerFrameInfo, CM_ARM_GTBLOCK_TIMER_FRAME_INFO)
 
STATIC EFI_STATUS EFIAPI AddGenericTimerInfo (IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *CONST Gtdt, IN CONST UINT32 PlatformTimerCount, IN CONST UINT32 AcpiTableRevision)
 
STATIC VOID AddGenericWatchdogList (IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *CONST Gtdt, IN CONST UINT32 WatchdogOffset, IN CONST CM_ARM_GENERIC_WATCHDOG_INFO *WatchdogInfoList, IN UINT32 WatchdogCount)
 
BOOLEAN EFIAPI IsGtFrameNumberEqual (IN CONST VOID *Frame1, IN CONST VOID *Frame2, IN UINTN Index1, IN UINTN Index2)
 
STATIC EFI_STATUS AddGTBlockTimerFrames (IN EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE *GtBlockFrame, IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO *GTBlockTimerFrameList, IN UINT32 GTBlockFrameCount)
 
STATIC EFI_STATUS AddGTBlockList (IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *CONST Gtdt, IN CONST UINT32 GTBlockOffset, IN CONST CM_ARM_GTBLOCK_INFO *GTBlockInfo, IN UINT32 BlockTimerCount)
 
STATIC EFI_STATUS EFIAPI BuildGtdtTable (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 FreeGtdtTableResources (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 AcpiGtdtLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI AcpiGtdtLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC CONST ACPI_TABLE_GENERATOR GtdtGenerator
 

Detailed Description

GTDT Table Generator

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

Reference(s):
  • ACPI 6.4 Specification - January 2021

Definition in file GtdtGenerator.c.

Macro Definition Documentation

◆ GTDT_GENERATOR_REVISION

#define GTDT_GENERATOR_REVISION   CREATE_REVISION (1, 0)

This macro defines the GTDT Table Generator revision.

Definition at line 709 of file GtdtGenerator.c.

Function Documentation

◆ AcpiGtdtLibConstructor()

EFI_STATUS EFIAPI AcpiGtdtLibConstructor ( 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 753 of file GtdtGenerator.c.

◆ AcpiGtdtLibDestructor()

EFI_STATUS EFIAPI AcpiGtdtLibDestructor ( 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 777 of file GtdtGenerator.c.

◆ AddGenericTimerInfo()

STATIC EFI_STATUS EFIAPI AddGenericTimerInfo ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *CONST  Gtdt,
IN CONST UINT32  PlatformTimerCount,
IN CONST UINT32  AcpiTableRevision 
)

Add the Generic Timer Information to the GTDT table.

Also update the Platform Timer offset information if the platform implements platform timers.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in]GtdtPointer to the GTDT Table.
[in]PlatformTimerCountPlatform timer count.
[in]AcpiTableRevisionAcpi Revision targeted by the platform.
Return values
EFI_SUCCESSSuccess.
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 92 of file GtdtGenerator.c.

◆ AddGenericWatchdogList()

STATIC VOID AddGenericWatchdogList ( IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *CONST  Gtdt,
IN CONST UINT32  WatchdogOffset,
IN CONST CM_ARM_GENERIC_WATCHDOG_INFO WatchdogInfoList,
IN UINT32  WatchdogCount 
)

Add the Arm Generic Watchdog Timers to the GTDT table.

Parameters
[in]GtdtPointer to the GTDT Table.
[in]WatchdogOffsetOffset to the watchdog information in the GTDT Table.
[in]WatchdogInfoListPointer to the watchdog information list.
[in]WatchdogCountPlatform timer count.

Definition at line 156 of file GtdtGenerator.c.

◆ AddGTBlockList()

STATIC EFI_STATUS AddGTBlockList ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *CONST  Gtdt,
IN CONST UINT32  GTBlockOffset,
IN CONST CM_ARM_GTBLOCK_INFO GTBlockInfo,
IN UINT32  BlockTimerCount 
)

Add the GT Block Timers in the GTDT Table.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in]GtdtPointer to the GTDT Table.
[in]GTBlockOffsetOffset of the GT Block information in the GTDT Table.
[in]GTBlockInfoPointer to the GT Block Information List.
[in]BlockTimerCountNumber of GT Block Timers.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.

Definition at line 331 of file GtdtGenerator.c.

◆ AddGTBlockTimerFrames()

STATIC EFI_STATUS AddGTBlockTimerFrames ( IN EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE GtBlockFrame,
IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO GTBlockTimerFrameList,
IN UINT32  GTBlockFrameCount 
)

Update the GT Block Timer Frame lists in the GTDT Table.

Parameters
[in]GtBlockFramePointer to the GT Block Frames list to be updated.
[in]GTBlockTimerFrameListPointer to the GT Block Frame Information List.
[in]GTBlockFrameCountNumber of GT Block Frames.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.

Definition at line 251 of file GtdtGenerator.c.

◆ BuildGtdtTable()

Construct the GTDT ACPI table.

Called by the Dynamic Table Manager, 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.
EFI_OUT_OF_RESOURCESMemory allocation failed.

Definition at line 452 of file GtdtGenerator.c.

◆ FreeGtdtTableResources()

Free any resources allocated for constructing the GTDT.

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 683 of file GtdtGenerator.c.

◆ GET_OBJECT_LIST() [1/4]

ARM standard GTDT Generator

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

  • EArmObjGenericTimerInfo
  • EArmObjPlatformGenericWatchdogInfo (OPTIONAL)
  • EArmObjPlatformGTBlockInfo (OPTIONAL)
  • EArmObjGTBlockTimerFrameInfo (OPTIONAL) This macro expands to a function that retrieves the Generic Timer Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [2/4]

This macro expands to a function that retrieves the Generic Timer Block Timer Frame Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [3/4]

This macro expands to a function that retrieves the Arm Generic Watchdog Timer Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [4/4]

This macro expands to a function that retrieves the Platform Generic Timer Block Information from the Configuration Manager.

◆ IsGtFrameNumberEqual()

BOOLEAN EFIAPI IsGtFrameNumberEqual ( IN CONST VOID *  Frame1,
IN CONST VOID *  Frame2,
IN UINTN  Index1,
IN UINTN  Index2 
)

Function to test if two Generic Timer Block Frame Info structures have the same frame number.

Parameters
[in]Frame1Pointer to the first GT Block Frame Info structure.
[in]Frame2Pointer to the second GT Block Frame Info structure.
[in]Index1Index of Frame1 in the shared GT Block Frame Information List.
[in]Index2Index of Frame2 in the shared GT Block Frame Information List.
Return values
TRUEFrame1 and Frame2 have the same frame number.
Returns
FALSE Frame1 and Frame2 have different frame numbers.

Definition at line 208 of file GtdtGenerator.c.

Variable Documentation

◆ GtdtGenerator

Initial value:
= {
L"ACPI.STD.GTDT.GENERATOR",
}
#define EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION
Definition: Acpi62.h:1402
#define EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE
Definition: Acpi64.h:2930
#define EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION
Definition: Acpi64.h:1409
#define TABLE_GENERATOR_CREATOR_ID_ARM
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
@ EStdAcpiTableIdGtdt
GTDT Generator.
STATIC EFI_STATUS EFIAPI BuildGtdtTable(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)
#define GTDT_GENERATOR_REVISION
STATIC EFI_STATUS FreeGtdtTableResources(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 NULL
Definition: Base.h:319

The interface for the GTDT Table Generator.

Definition at line 715 of file GtdtGenerator.c.