4 Copyright (c) 2017 - 2021, ARM Limited. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
8 - ACPI 6.4 Specification - January 2021
12 #include <Library/AcpiLib.h>
13 #include <Library/DebugLib.h>
14 #include <Library/MemoryAllocationLib.h>
15 #include <Protocol/AcpiTable.h>
17 // Module specific include files.
18 #include <AcpiTableGenerator.h>
19 #include <ConfigurationManagerObject.h>
20 #include <ConfigurationManagerHelper.h>
21 #include <Library/TableHelperLib.h>
22 #include <Protocol/ConfigurationManagerProtocol.h>
24 /** ARM standard GTDT Generator
27 The following Configuration Manager Object(s) are required by
29 - EArmObjGenericTimerInfo
30 - EArmObjPlatformGenericWatchdogInfo (OPTIONAL)
31 - EArmObjPlatformGTBlockInfo (OPTIONAL)
32 - EArmObjGTBlockTimerFrameInfo (OPTIONAL)
35 /** This macro expands to a function that retrieves the Generic
36 Timer Information from the Configuration Manager.
40 EArmObjGenericTimerInfo
,
41 CM_ARM_GENERIC_TIMER_INFO
44 /** This macro expands to a function that retrieves the Arm Generic
45 Watchdog Timer Information from the Configuration Manager.
49 EArmObjPlatformGenericWatchdogInfo
,
50 CM_ARM_GENERIC_WATCHDOG_INFO
53 /** This macro expands to a function that retrieves the Platform Generic
54 Timer Block Information from the Configuration Manager.
58 EArmObjPlatformGTBlockInfo
,
62 /** This macro expands to a function that retrieves the Generic
63 Timer Block Timer Frame Information from the Configuration Manager.
67 EArmObjGTBlockTimerFrameInfo
,
68 CM_ARM_GTBLOCK_TIMER_FRAME_INFO
71 /** Add the Generic Timer Information to the GTDT table.
73 Also update the Platform Timer offset information if the platform
74 implements platform timers.
76 @param [in] CfgMgrProtocol Pointer to the Configuration Manager
78 @param [in] Gtdt Pointer to the GTDT Table.
79 @param [in] PlatformTimerCount Platform timer count.
80 @param [in] AcpiTableRevision Acpi Revision targeted by the platform.
82 @retval EFI_SUCCESS Success.
83 @retval EFI_INVALID_PARAMETER A parameter is invalid.
84 @retval EFI_NOT_FOUND The required object was not found.
85 @retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration
86 Manager is less than the Object size for the
93 IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL
*CONST CfgMgrProtocol
,
94 IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE
*CONST Gtdt
,
95 IN CONST UINT32 PlatformTimerCount
,
96 IN CONST UINT32 AcpiTableRevision
100 CM_ARM_GENERIC_TIMER_INFO
*GenericTimerInfo
;
102 ASSERT (CfgMgrProtocol
!= NULL
);
103 ASSERT (Gtdt
!= NULL
);
105 Status
= GetEArmObjGenericTimerInfo (
112 if (EFI_ERROR (Status
)) {
115 "ERROR: GTDT: Failed to get GenericTimerInfo. Status = %r\n",
121 Gtdt
->CntControlBasePhysicalAddress
=
122 GenericTimerInfo
->CounterControlBaseAddress
;
123 Gtdt
->Reserved
= EFI_ACPI_RESERVED_DWORD
;
124 Gtdt
->SecurePL1TimerGSIV
= GenericTimerInfo
->SecurePL1TimerGSIV
;
125 Gtdt
->SecurePL1TimerFlags
= GenericTimerInfo
->SecurePL1TimerFlags
;
126 Gtdt
->NonSecurePL1TimerGSIV
= GenericTimerInfo
->NonSecurePL1TimerGSIV
;
127 Gtdt
->NonSecurePL1TimerFlags
= GenericTimerInfo
->NonSecurePL1TimerFlags
;
128 Gtdt
->VirtualTimerGSIV
= GenericTimerInfo
->VirtualTimerGSIV
;
129 Gtdt
->VirtualTimerFlags
= GenericTimerInfo
->VirtualTimerFlags
;
130 Gtdt
->NonSecurePL2TimerGSIV
= GenericTimerInfo
->NonSecurePL2TimerGSIV
;
131 Gtdt
->NonSecurePL2TimerFlags
= GenericTimerInfo
->NonSecurePL2TimerFlags
;
132 Gtdt
->CntReadBasePhysicalAddress
=
133 GenericTimerInfo
->CounterReadBaseAddress
;
134 Gtdt
->PlatformTimerCount
= PlatformTimerCount
;
135 Gtdt
->PlatformTimerOffset
= (PlatformTimerCount
== 0) ? 0 :
136 sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE
);
138 if (AcpiTableRevision
> EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION
) {
139 Gtdt
->VirtualPL2TimerGSIV
= GenericTimerInfo
->VirtualPL2TimerGSIV
;
140 Gtdt
->VirtualPL2TimerFlags
= GenericTimerInfo
->VirtualPL2TimerFlags
;
146 /** Add the Arm Generic Watchdog Timers to the GTDT table.
148 @param [in] Gtdt Pointer to the GTDT Table.
149 @param [in] WatchdogOffset Offset to the watchdog information in the
151 @param [in] WatchdogInfoList Pointer to the watchdog information list.
152 @param [in] WatchdogCount Platform timer count.
156 AddGenericWatchdogList (
157 IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE
*CONST Gtdt
,
158 IN CONST UINT32 WatchdogOffset
,
159 IN CONST CM_ARM_GENERIC_WATCHDOG_INFO
*WatchdogInfoList
,
160 IN UINT32 WatchdogCount
163 EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE
*Watchdog
;
165 ASSERT (Gtdt
!= NULL
);
166 ASSERT (WatchdogInfoList
!= NULL
);
168 Watchdog
= (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE
*)
169 ((UINT8
*)Gtdt
+ WatchdogOffset
);
171 while (WatchdogCount
-- != 0) {
172 // Add watchdog entry
173 DEBUG ((DEBUG_INFO
, "GTDT: Watchdog = 0x%p\n", Watchdog
));
174 Watchdog
->Type
= EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG
;
176 sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE
);
177 Watchdog
->Reserved
= EFI_ACPI_RESERVED_BYTE
;
178 Watchdog
->RefreshFramePhysicalAddress
=
179 WatchdogInfoList
->RefreshFrameAddress
;
180 Watchdog
->WatchdogControlFramePhysicalAddress
=
181 WatchdogInfoList
->ControlFrameAddress
;
182 Watchdog
->WatchdogTimerGSIV
= WatchdogInfoList
->TimerGSIV
;
183 Watchdog
->WatchdogTimerFlags
= WatchdogInfoList
->Flags
;
190 Function to test if two Generic Timer Block Frame Info structures have the
193 @param [in] Frame1 Pointer to the first GT Block Frame Info
195 @param [in] Frame2 Pointer to the second GT Block Frame Info
197 @param [in] Index1 Index of Frame1 in the shared GT Block Frame
199 @param [in] Index2 Index of Frame2 in the shared GT Block Frame
202 @retval TRUE Frame1 and Frame2 have the same frame number.
203 @return FALSE Frame1 and Frame2 have different frame numbers.
208 IsGtFrameNumberEqual (
209 IN CONST VOID
*Frame1
,
210 IN CONST VOID
*Frame2
,
218 ASSERT ((Frame1
!= NULL
) && (Frame2
!= NULL
));
220 FrameNumber1
= ((CM_ARM_GTBLOCK_TIMER_FRAME_INFO
*)Frame1
)->FrameNumber
;
221 FrameNumber2
= ((CM_ARM_GTBLOCK_TIMER_FRAME_INFO
*)Frame2
)->FrameNumber
;
223 if (FrameNumber1
== FrameNumber2
) {
226 "ERROR: GTDT: GT Block Frame Info Structures %d and %d have the same " \
227 "frame number: 0x%x.\n",
238 /** Update the GT Block Timer Frame lists in the GTDT Table.
240 @param [in] GtBlockFrame Pointer to the GT Block Frames
242 @param [in] GTBlockTimerFrameList Pointer to the GT Block Frame
244 @param [in] GTBlockFrameCount Number of GT Block Frames.
246 @retval EFI_SUCCESS Table generated successfully.
247 @retval EFI_INVALID_PARAMETER A parameter is invalid.
251 AddGTBlockTimerFrames (
252 IN EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE
*GtBlockFrame
,
253 IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO
*GTBlockTimerFrameList
,
254 IN UINT32 GTBlockFrameCount
257 BOOLEAN IsFrameNumberDuplicated
;
259 ASSERT (GtBlockFrame
!= NULL
);
260 ASSERT (GTBlockTimerFrameList
!= NULL
);
262 IsFrameNumberDuplicated
= FindDuplicateValue (
263 GTBlockTimerFrameList
,
265 sizeof (CM_ARM_GTBLOCK_TIMER_FRAME_INFO
),
268 // Duplicate entry was found so timer frame numbers provided are invalid
269 if (IsFrameNumberDuplicated
) {
270 return EFI_INVALID_PARAMETER
;
273 while (GTBlockFrameCount
-- != 0) {
276 "GTDT: GtBlockFrame = 0x%p\n",
280 if (GTBlockTimerFrameList
->FrameNumber
>= 8) {
283 "ERROR: GTDT: Frame number %d is not in the range 0-7\n",
284 GTBlockTimerFrameList
->FrameNumber
286 return EFI_INVALID_PARAMETER
;
289 GtBlockFrame
->GTFrameNumber
= GTBlockTimerFrameList
->FrameNumber
;
290 GtBlockFrame
->Reserved
[0] = EFI_ACPI_RESERVED_BYTE
;
291 GtBlockFrame
->Reserved
[1] = EFI_ACPI_RESERVED_BYTE
;
292 GtBlockFrame
->Reserved
[2] = EFI_ACPI_RESERVED_BYTE
;
294 GtBlockFrame
->CntBaseX
= GTBlockTimerFrameList
->PhysicalAddressCntBase
;
295 GtBlockFrame
->CntEL0BaseX
=
296 GTBlockTimerFrameList
->PhysicalAddressCntEL0Base
;
298 GtBlockFrame
->GTxPhysicalTimerGSIV
=
299 GTBlockTimerFrameList
->PhysicalTimerGSIV
;
300 GtBlockFrame
->GTxPhysicalTimerFlags
=
301 GTBlockTimerFrameList
->PhysicalTimerFlags
;
303 GtBlockFrame
->GTxVirtualTimerGSIV
= GTBlockTimerFrameList
->VirtualTimerGSIV
;
304 GtBlockFrame
->GTxVirtualTimerFlags
=
305 GTBlockTimerFrameList
->VirtualTimerFlags
;
307 GtBlockFrame
->GTxCommonFlags
= GTBlockTimerFrameList
->CommonFlags
;
309 GTBlockTimerFrameList
++;
315 /** Add the GT Block Timers in the GTDT Table.
317 @param [in] CfgMgrProtocol Pointer to the Configuration Manager
319 @param [in] Gtdt Pointer to the GTDT Table.
320 @param [in] GTBlockOffset Offset of the GT Block
321 information in the GTDT Table.
322 @param [in] GTBlockInfo Pointer to the GT Block
324 @param [in] BlockTimerCount Number of GT Block Timers.
326 @retval EFI_SUCCESS Table generated successfully.
327 @retval EFI_INVALID_PARAMETER A parameter is invalid.
332 IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL
*CONST CfgMgrProtocol
,
333 IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE
*CONST Gtdt
,
334 IN CONST UINT32 GTBlockOffset
,
335 IN CONST CM_ARM_GTBLOCK_INFO
*GTBlockInfo
,
336 IN UINT32 BlockTimerCount
340 EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE
*GTBlock
;
341 EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE
*GtBlockFrame
;
342 CM_ARM_GTBLOCK_TIMER_FRAME_INFO
*GTBlockTimerFrameList
;
343 UINT32 GTBlockTimerFrameCount
;
346 ASSERT (Gtdt
!= NULL
);
347 ASSERT (GTBlockInfo
!= NULL
);
349 GTBlock
= (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE
*)((UINT8
*)Gtdt
+
352 while (BlockTimerCount
-- != 0) {
353 DEBUG ((DEBUG_INFO
, "GTDT: GTBlock = 0x%p\n", GTBlock
));
355 Status
= GetEArmObjGTBlockTimerFrameInfo (
357 GTBlockInfo
->GTBlockTimerFrameToken
,
358 >BlockTimerFrameList
,
359 >BlockTimerFrameCount
361 if (EFI_ERROR (Status
) ||
362 (GTBlockTimerFrameCount
!= GTBlockInfo
->GTBlockTimerFrameCount
))
366 "ERROR: GTDT: Failed to get Generic Timer Frames. Status = %r\n",
372 Length
= sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE
) +
373 (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE
) *
374 GTBlockInfo
->GTBlockTimerFrameCount
);
376 // Check that the length of the GT block does not
378 if (Length
> MAX_UINT16
) {
379 Status
= EFI_INVALID_PARAMETER
;
382 "ERROR: GTDT: Too many GT Frames. Count = %d. " \
383 "Maximum supported GT Block size exceeded. " \
385 GTBlockInfo
->GTBlockTimerFrameCount
,
391 GTBlock
->Type
= EFI_ACPI_6_4_GTDT_GT_BLOCK
;
392 GTBlock
->Length
= (UINT16
)Length
;
393 GTBlock
->Reserved
= EFI_ACPI_RESERVED_BYTE
;
394 GTBlock
->CntCtlBase
= GTBlockInfo
->GTBlockPhysicalAddress
;
395 GTBlock
->GTBlockTimerCount
= GTBlockInfo
->GTBlockTimerFrameCount
;
396 GTBlock
->GTBlockTimerOffset
=
397 sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE
);
399 GtBlockFrame
= (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE
*)
400 ((UINT8
*)GTBlock
+ GTBlock
->GTBlockTimerOffset
);
402 // Add GT Block Timer frames
403 Status
= AddGTBlockTimerFrames (
405 GTBlockTimerFrameList
,
406 GTBlockTimerFrameCount
408 if (EFI_ERROR (Status
)) {
411 "ERROR: GTDT: Failed to add Generic Timer Frames. Status = %r\n",
418 GTBlock
= (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE
*)((UINT8
*)GTBlock
+
426 /** Construct the GTDT ACPI table.
428 Called by the Dynamic Table Manager, this function invokes the
429 Configuration Manager protocol interface to get the required hardware
430 information for generating the ACPI table.
432 If this function allocates any resources then they must be freed
433 in the FreeXXXXTableResources function.
435 @param [in] This Pointer to the table generator.
436 @param [in] AcpiTableInfo Pointer to the ACPI Table Info.
437 @param [in] CfgMgrProtocol Pointer to the Configuration Manager
439 @param [out] Table Pointer to the constructed ACPI Table.
441 @retval EFI_SUCCESS Table generated successfully.
442 @retval EFI_INVALID_PARAMETER A parameter is invalid.
443 @retval EFI_NOT_FOUND The required object was not found.
444 @retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration
445 Manager is less than the Object size for the
447 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
453 IN CONST ACPI_TABLE_GENERATOR
*CONST This
,
454 IN CONST CM_STD_OBJ_ACPI_TABLE_INFO
*CONST AcpiTableInfo
,
455 IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL
*CONST CfgMgrProtocol
,
456 OUT EFI_ACPI_DESCRIPTION_HEADER
**CONST Table
461 UINT32 PlatformTimerCount
;
462 UINT32 WatchdogCount
;
463 UINT32 BlockTimerCount
;
464 CM_ARM_GENERIC_WATCHDOG_INFO
*WatchdogInfoList
;
465 CM_ARM_GTBLOCK_INFO
*GTBlockInfo
;
466 EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE
*Gtdt
;
468 UINT32 GTBlockOffset
;
469 UINT32 WatchdogOffset
;
471 ASSERT (This
!= NULL
);
472 ASSERT (AcpiTableInfo
!= NULL
);
473 ASSERT (CfgMgrProtocol
!= NULL
);
474 ASSERT (Table
!= NULL
);
475 ASSERT (AcpiTableInfo
->TableGeneratorId
== This
->GeneratorID
);
476 ASSERT (AcpiTableInfo
->AcpiTableSignature
== This
->AcpiTableSignature
);
478 if ((AcpiTableInfo
->AcpiTableRevision
< This
->MinAcpiTableRevision
) ||
479 (AcpiTableInfo
->AcpiTableRevision
> This
->AcpiTableRevision
))
483 "ERROR: GTDT: Requested table revision = %d, is not supported."
484 "Supported table revision: Minimum = %d, Maximum = %d\n",
485 AcpiTableInfo
->AcpiTableRevision
,
486 This
->MinAcpiTableRevision
,
487 This
->AcpiTableRevision
489 return EFI_INVALID_PARAMETER
;
493 Status
= GetEArmObjPlatformGTBlockInfo (
499 if (EFI_ERROR (Status
) && (Status
!= EFI_NOT_FOUND
)) {
502 "ERROR: GTDT: Failed to Get Platform GT Block Information." \
509 Status
= GetEArmObjPlatformGenericWatchdogInfo (
515 if (EFI_ERROR (Status
) && (Status
!= EFI_NOT_FOUND
)) {
518 "ERROR: GTDT: Failed to Get Platform Generic Watchdog Information." \
527 "GTDT: BlockTimerCount = %d, WatchdogCount = %d\n",
532 // Calculate the GTDT Table Size
533 PlatformTimerCount
= 0;
534 TableSize
= sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE
);
535 if (BlockTimerCount
!= 0) {
536 GTBlockOffset
= TableSize
;
537 PlatformTimerCount
+= BlockTimerCount
;
538 TableSize
+= (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE
) *
541 for (Idx
= 0; Idx
< BlockTimerCount
; Idx
++) {
542 if (GTBlockInfo
[Idx
].GTBlockTimerFrameCount
> 8) {
543 Status
= EFI_INVALID_PARAMETER
;
546 "GTDT: GTBockFrameCount cannot be more than 8." \
547 " GTBockFrameCount = %d, Status = %r\n",
548 GTBlockInfo
[Idx
].GTBlockTimerFrameCount
,
554 TableSize
+= (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE
) *
555 GTBlockInfo
[Idx
].GTBlockTimerFrameCount
);
560 "GTDT: GTBockOffset = 0x%x, PLATFORM_TIMER_COUNT = %d\n",
567 if (WatchdogCount
!= 0) {
568 WatchdogOffset
= TableSize
;
569 PlatformTimerCount
+= WatchdogCount
;
570 TableSize
+= (sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE
) *
574 "GTDT: WatchdogOffset = 0x%x, PLATFORM_TIMER_COUNT = %d\n",
580 *Table
= (EFI_ACPI_DESCRIPTION_HEADER
*)AllocateZeroPool (TableSize
);
581 if (*Table
== NULL
) {
582 Status
= EFI_OUT_OF_RESOURCES
;
585 "ERROR: GTDT: Failed to allocate memory for GTDT Table, Size = %d," \
593 Gtdt
= (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE
*)*Table
;
596 "GTDT: Gtdt = 0x%p TableSize = 0x%x\n",
601 Status
= AddAcpiHeader (
608 if (EFI_ERROR (Status
)) {
611 "ERROR: GTDT: Failed to add ACPI header. Status = %r\n",
617 Status
= AddGenericTimerInfo (
621 AcpiTableInfo
->AcpiTableRevision
623 if (EFI_ERROR (Status
)) {
626 "ERROR: GTDT: Failed to add Generic Timer Info. Status = %r\n",
632 if (BlockTimerCount
!= 0) {
633 Status
= AddGTBlockList (
640 if (EFI_ERROR (Status
)) {
643 "ERROR: GTDT: Failed to add GT Block timers. Status = %r\n",
650 if (WatchdogCount
!= 0) {
651 AddGenericWatchdogList (
662 if (*Table
!= NULL
) {
670 /** Free any resources allocated for constructing the GTDT.
672 @param [in] This Pointer to the table generator.
673 @param [in] AcpiTableInfo Pointer to the ACPI Table Info.
674 @param [in] CfgMgrProtocol Pointer to the Configuration Manager
676 @param [in, out] Table Pointer to the ACPI Table.
678 @retval EFI_SUCCESS The resources were freed successfully.
679 @retval EFI_INVALID_PARAMETER The table pointer is NULL or invalid.
683 FreeGtdtTableResources (
684 IN CONST ACPI_TABLE_GENERATOR
*CONST This
,
685 IN CONST CM_STD_OBJ_ACPI_TABLE_INFO
*CONST AcpiTableInfo
,
686 IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL
*CONST CfgMgrProtocol
,
687 IN OUT EFI_ACPI_DESCRIPTION_HEADER
**CONST Table
690 ASSERT (This
!= NULL
);
691 ASSERT (AcpiTableInfo
!= NULL
);
692 ASSERT (CfgMgrProtocol
!= NULL
);
693 ASSERT (AcpiTableInfo
->TableGeneratorId
== This
->GeneratorID
);
694 ASSERT (AcpiTableInfo
->AcpiTableSignature
== This
->AcpiTableSignature
);
696 if ((Table
== NULL
) || (*Table
== NULL
)) {
697 DEBUG ((DEBUG_ERROR
, "ERROR: GTDT: Invalid Table Pointer\n"));
698 ASSERT ((Table
!= NULL
) && (*Table
!= NULL
));
699 return EFI_INVALID_PARAMETER
;
707 /** This macro defines the GTDT Table Generator revision.
709 #define GTDT_GENERATOR_REVISION CREATE_REVISION (1, 0)
711 /** The interface for the GTDT Table Generator.
715 ACPI_TABLE_GENERATOR GtdtGenerator
= {
717 CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdGtdt
),
718 // Generator Description
719 L
"ACPI.STD.GTDT.GENERATOR",
720 // ACPI Table Signature
721 EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE
,
722 // ACPI Table Revision supported by this Generator
723 EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION
,
724 // Minimum ACPI Table Revision supported by this Generator
725 EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION
,
727 TABLE_GENERATOR_CREATOR_ID_ARM
,
729 GTDT_GENERATOR_REVISION
,
730 // Build Table function
732 // Free Resource function
733 FreeGtdtTableResources
,
734 // Extended build function not needed
736 // Extended build function not implemented by the generator.
737 // Hence extended free resource function is not required.
741 /** Register the Generator with the ACPI Table Factory.
743 @param [in] ImageHandle The handle to the image.
744 @param [in] SystemTable Pointer to the System Table.
746 @retval EFI_SUCCESS The Generator is registered.
747 @retval EFI_INVALID_PARAMETER A parameter is invalid.
748 @retval EFI_ALREADY_STARTED The Generator for the Table ID
749 is already registered.
753 AcpiGtdtLibConstructor (
754 IN EFI_HANDLE ImageHandle
,
755 IN EFI_SYSTEM_TABLE
*SystemTable
760 Status
= RegisterAcpiTableGenerator (&GtdtGenerator
);
761 DEBUG ((DEBUG_INFO
, "GTDT: Register Generator. Status = %r\n", Status
));
762 ASSERT_EFI_ERROR (Status
);
766 /** Deregister the Generator from the ACPI Table Factory.
768 @param [in] ImageHandle The handle to the image.
769 @param [in] SystemTable Pointer to the System Table.
771 @retval EFI_SUCCESS The Generator is deregistered.
772 @retval EFI_INVALID_PARAMETER A parameter is invalid.
773 @retval EFI_NOT_FOUND The Generator is not registered.
777 AcpiGtdtLibDestructor (
778 IN EFI_HANDLE ImageHandle
,
779 IN EFI_SYSTEM_TABLE
*SystemTable
784 Status
= DeregisterAcpiTableGenerator (&GtdtGenerator
);
785 DEBUG ((DEBUG_INFO
, "GTDT: Deregister Generator. Status = %r\n", Status
));
786 ASSERT_EFI_ERROR (Status
);