TianoCore EDK2 master
|
#include <Library/AcpiLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Protocol/AcpiTable.h>
#include <AcpiTableGenerator.h>
#include <ConfigurationManagerObject.h>
#include <ConfigurationManagerHelper.h>
#include <Library/TableHelperLib.h>
#include <Protocol/ConfigurationManagerProtocol.h>
Go to the source code of this file.
Macros | |
#define | GTDT_GENERATOR_REVISION CREATE_REVISION (1, 0) |
Variables | |
STATIC CONST ACPI_TABLE_GENERATOR | GtdtGenerator |
GTDT Table Generator
Copyright (c) 2017 - 2021, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file GtdtGenerator.c.
#define GTDT_GENERATOR_REVISION CREATE_REVISION (1, 0) |
This macro defines the GTDT Table Generator revision.
Definition at line 709 of file GtdtGenerator.c.
EFI_STATUS EFIAPI AcpiGtdtLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Register the Generator with the ACPI Table Factory.
[in] | ImageHandle | The handle to the image. |
[in] | SystemTable | Pointer to the System Table. |
EFI_SUCCESS | The Generator is registered. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_ALREADY_STARTED | The Generator for the Table ID is already registered. |
Definition at line 753 of file GtdtGenerator.c.
EFI_STATUS EFIAPI AcpiGtdtLibDestructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Deregister the Generator from the ACPI Table Factory.
[in] | ImageHandle | The handle to the image. |
[in] | SystemTable | Pointer to the System Table. |
EFI_SUCCESS | The Generator is deregistered. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | The Generator is not registered. |
Definition at line 777 of file GtdtGenerator.c.
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.
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in] | Gtdt | Pointer to the GTDT Table. |
[in] | PlatformTimerCount | Platform timer count. |
[in] | AcpiTableRevision | Acpi Revision targeted by the platform. |
EFI_SUCCESS | Success. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | The required object was not found. |
EFI_BAD_BUFFER_SIZE | The size returned by the Configuration Manager is less than the Object size for the requested object. |
Definition at line 92 of file GtdtGenerator.c.
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.
[in] | Gtdt | Pointer to the GTDT Table. |
[in] | WatchdogOffset | Offset to the watchdog information in the GTDT Table. |
[in] | WatchdogInfoList | Pointer to the watchdog information list. |
[in] | WatchdogCount | Platform timer count. |
Definition at line 156 of file GtdtGenerator.c.
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.
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in] | Gtdt | Pointer to the GTDT Table. |
[in] | GTBlockOffset | Offset of the GT Block information in the GTDT Table. |
[in] | GTBlockInfo | Pointer to the GT Block Information List. |
[in] | BlockTimerCount | Number of GT Block Timers. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
Definition at line 331 of file GtdtGenerator.c.
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.
[in] | GtBlockFrame | Pointer to the GT Block Frames list to be updated. |
[in] | GTBlockTimerFrameList | Pointer to the GT Block Frame Information List. |
[in] | GTBlockFrameCount | Number of GT Block Frames. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
Definition at line 251 of file GtdtGenerator.c.
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 | ||
) |
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.
[in] | This | Pointer to the table generator. |
[in] | AcpiTableInfo | Pointer to the ACPI Table Info. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[out] | Table | Pointer to the constructed ACPI Table. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | The required object was not found. |
EFI_BAD_BUFFER_SIZE | The size returned by the Configuration Manager is less than the Object size for the requested object. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
Definition at line 452 of file GtdtGenerator.c.
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 | ||
) |
Free any resources allocated for constructing the GTDT.
[in] | This | Pointer to the table generator. |
[in] | AcpiTableInfo | Pointer to the ACPI Table Info. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in,out] | Table | Pointer to the ACPI Table. |
EFI_SUCCESS | The resources were freed successfully. |
EFI_INVALID_PARAMETER | The table pointer is NULL or invalid. |
Definition at line 683 of file GtdtGenerator.c.
GET_OBJECT_LIST | ( | EObjNameSpaceArm | , |
EArmObjGenericTimerInfo | , | ||
CM_ARM_GENERIC_TIMER_INFO | |||
) |
ARM standard GTDT Generator
Requirements: The following Configuration Manager Object(s) are required by this Generator:
GET_OBJECT_LIST | ( | EObjNameSpaceArm | , |
EArmObjGTBlockTimerFrameInfo | , | ||
CM_ARM_GTBLOCK_TIMER_FRAME_INFO | |||
) |
This macro expands to a function that retrieves the Generic Timer Block Timer Frame Information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArm | , |
EArmObjPlatformGenericWatchdogInfo | , | ||
CM_ARM_GENERIC_WATCHDOG_INFO | |||
) |
This macro expands to a function that retrieves the Arm Generic Watchdog Timer Information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArm | , |
EArmObjPlatformGTBlockInfo | , | ||
CM_ARM_GTBLOCK_INFO | |||
) |
This macro expands to a function that retrieves the Platform Generic Timer Block Information from the Configuration Manager.
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.
[in] | Frame1 | Pointer to the first GT Block Frame Info structure. |
[in] | Frame2 | Pointer to the second GT Block Frame Info structure. |
[in] | Index1 | Index of Frame1 in the shared GT Block Frame Information List. |
[in] | Index2 | Index of Frame2 in the shared GT Block Frame Information List. |
TRUE | Frame1 and Frame2 have the same frame number. |
Definition at line 208 of file GtdtGenerator.c.
STATIC CONST ACPI_TABLE_GENERATOR GtdtGenerator |
The interface for the GTDT Table Generator.
Definition at line 715 of file GtdtGenerator.c.