4 Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
8 - ACPI 6.3 Specification - January 2019
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 SBSA 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_3_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_3_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 SBSA 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_3_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_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE
* Watchdog
;
165 ASSERT (Gtdt
!= NULL
);
166 ASSERT (WatchdogInfoList
!= NULL
);
168 Watchdog
= (EFI_ACPI_6_3_GTDT_SBSA_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_3_GTDT_SBSA_GENERIC_WATCHDOG
;
176 sizeof (EFI_ACPI_6_3_GTDT_SBSA_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_3_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
++;
314 /** Add the GT Block Timers in the GTDT Table.
316 @param [in] CfgMgrProtocol Pointer to the Configuration Manager
318 @param [in] Gtdt Pointer to the GTDT Table.
319 @param [in] GTBlockOffset Offset of the GT Block
320 information in the GTDT Table.
321 @param [in] GTBlockInfo Pointer to the GT Block
323 @param [in] BlockTimerCount Number of GT Block Timers.
325 @retval EFI_SUCCESS Table generated successfully.
326 @retval EFI_INVALID_PARAMETER A parameter is invalid.
331 IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL
* CONST CfgMgrProtocol
,
332 IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE
* CONST Gtdt
,
333 IN CONST UINT32 GTBlockOffset
,
334 IN CONST CM_ARM_GTBLOCK_INFO
* GTBlockInfo
,
335 IN UINT32 BlockTimerCount
339 EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE
* GTBlock
;
340 EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE
* GtBlockFrame
;
341 CM_ARM_GTBLOCK_TIMER_FRAME_INFO
* GTBlockTimerFrameList
;
342 UINT32 GTBlockTimerFrameCount
;
345 ASSERT (Gtdt
!= NULL
);
346 ASSERT (GTBlockInfo
!= NULL
);
348 GTBlock
= (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE
*)((UINT8
*)Gtdt
+
351 while (BlockTimerCount
-- != 0) {
352 DEBUG ((DEBUG_INFO
, "GTDT: GTBlock = 0x%p\n", GTBlock
));
354 Status
= GetEArmObjGTBlockTimerFrameInfo (
356 GTBlockInfo
->GTBlockTimerFrameToken
,
357 >BlockTimerFrameList
,
358 >BlockTimerFrameCount
360 if (EFI_ERROR (Status
) ||
361 (GTBlockTimerFrameCount
!= GTBlockInfo
->GTBlockTimerFrameCount
)) {
364 "ERROR: GTDT: Failed to get Generic Timer Frames. Status = %r\n",
370 Length
= sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE
) +
371 (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE
) *
372 GTBlockInfo
->GTBlockTimerFrameCount
);
374 // Check that the length of the GT block does not
376 if (Length
> MAX_UINT16
) {
377 Status
= EFI_INVALID_PARAMETER
;
380 "ERROR: GTDT: Too many GT Frames. Count = %d. " \
381 "Maximum supported GT Block size exceeded. " \
383 GTBlockInfo
->GTBlockTimerFrameCount
,
389 GTBlock
->Type
= EFI_ACPI_6_3_GTDT_GT_BLOCK
;
390 GTBlock
->Length
= (UINT16
)Length
;
391 GTBlock
->Reserved
= EFI_ACPI_RESERVED_BYTE
;
392 GTBlock
->CntCtlBase
= GTBlockInfo
->GTBlockPhysicalAddress
;
393 GTBlock
->GTBlockTimerCount
= GTBlockInfo
->GTBlockTimerFrameCount
;
394 GTBlock
->GTBlockTimerOffset
=
395 sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE
);
397 GtBlockFrame
= (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE
*)
398 ((UINT8
*)GTBlock
+ GTBlock
->GTBlockTimerOffset
);
400 // Add GT Block Timer frames
401 Status
= AddGTBlockTimerFrames (
403 GTBlockTimerFrameList
,
404 GTBlockTimerFrameCount
406 if (EFI_ERROR (Status
)) {
409 "ERROR: GTDT: Failed to add Generic Timer Frames. Status = %r\n",
416 GTBlock
= (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE
*)((UINT8
*)GTBlock
+
423 /** Construct the GTDT ACPI table.
425 Called by the Dynamic Table Manager, this function invokes the
426 Configuration Manager protocol interface to get the required hardware
427 information for generating the ACPI table.
429 If this function allocates any resources then they must be freed
430 in the FreeXXXXTableResources function.
432 @param [in] This Pointer to the table generator.
433 @param [in] AcpiTableInfo Pointer to the ACPI Table Info.
434 @param [in] CfgMgrProtocol Pointer to the Configuration Manager
436 @param [out] Table Pointer to the constructed ACPI Table.
438 @retval EFI_SUCCESS Table generated successfully.
439 @retval EFI_INVALID_PARAMETER A parameter is invalid.
440 @retval EFI_NOT_FOUND The required object was not found.
441 @retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration
442 Manager is less than the Object size for the
444 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
450 IN CONST ACPI_TABLE_GENERATOR
* CONST This
,
451 IN CONST CM_STD_OBJ_ACPI_TABLE_INFO
* CONST AcpiTableInfo
,
452 IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL
* CONST CfgMgrProtocol
,
453 OUT EFI_ACPI_DESCRIPTION_HEADER
** CONST Table
458 UINT32 PlatformTimerCount
;
459 UINT32 WatchdogCount
;
460 UINT32 BlockTimerCount
;
461 CM_ARM_GENERIC_WATCHDOG_INFO
* WatchdogInfoList
;
462 CM_ARM_GTBLOCK_INFO
* GTBlockInfo
;
463 EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE
* Gtdt
;
465 UINT32 GTBlockOffset
;
466 UINT32 WatchdogOffset
;
468 ASSERT (This
!= NULL
);
469 ASSERT (AcpiTableInfo
!= NULL
);
470 ASSERT (CfgMgrProtocol
!= NULL
);
471 ASSERT (Table
!= NULL
);
472 ASSERT (AcpiTableInfo
->TableGeneratorId
== This
->GeneratorID
);
473 ASSERT (AcpiTableInfo
->AcpiTableSignature
== This
->AcpiTableSignature
);
475 if ((AcpiTableInfo
->AcpiTableRevision
< This
->MinAcpiTableRevision
) ||
476 (AcpiTableInfo
->AcpiTableRevision
> This
->AcpiTableRevision
)) {
479 "ERROR: GTDT: Requested table revision = %d, is not supported."
480 "Supported table revision: Minimum = %d, Maximum = %d\n",
481 AcpiTableInfo
->AcpiTableRevision
,
482 This
->MinAcpiTableRevision
,
483 This
->AcpiTableRevision
485 return EFI_INVALID_PARAMETER
;
489 Status
= GetEArmObjPlatformGTBlockInfo (
495 if (EFI_ERROR (Status
) && (Status
!= EFI_NOT_FOUND
)) {
498 "ERROR: GTDT: Failed to Get Platform GT Block Information." \
505 Status
= GetEArmObjPlatformGenericWatchdogInfo (
511 if (EFI_ERROR (Status
) && (Status
!= EFI_NOT_FOUND
)) {
514 "ERROR: GTDT: Failed to Get Platform Generic Watchdog Information." \
523 "GTDT: BlockTimerCount = %d, WatchdogCount = %d\n",
528 // Calculate the GTDT Table Size
529 PlatformTimerCount
= 0;
530 TableSize
= sizeof (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE
);
531 if (BlockTimerCount
!= 0) {
532 GTBlockOffset
= TableSize
;
533 PlatformTimerCount
+= BlockTimerCount
;
534 TableSize
+= (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE
) *
537 for (Idx
= 0; Idx
< BlockTimerCount
; Idx
++) {
538 if (GTBlockInfo
[Idx
].GTBlockTimerFrameCount
> 8) {
539 Status
= EFI_INVALID_PARAMETER
;
542 "GTDT: GTBockFrameCount cannot be more than 8." \
543 " GTBockFrameCount = %d, Status = %r\n",
544 GTBlockInfo
[Idx
].GTBlockTimerFrameCount
,
549 TableSize
+= (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE
) *
550 GTBlockInfo
[Idx
].GTBlockTimerFrameCount
);
555 "GTDT: GTBockOffset = 0x%x, PLATFORM_TIMER_COUNT = %d\n",
562 if (WatchdogCount
!= 0) {
563 WatchdogOffset
= TableSize
;
564 PlatformTimerCount
+= WatchdogCount
;
565 TableSize
+= (sizeof (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE
) *
569 "GTDT: WatchdogOffset = 0x%x, PLATFORM_TIMER_COUNT = %d\n",
575 *Table
= (EFI_ACPI_DESCRIPTION_HEADER
*)AllocateZeroPool (TableSize
);
576 if (*Table
== NULL
) {
577 Status
= EFI_OUT_OF_RESOURCES
;
580 "ERROR: GTDT: Failed to allocate memory for GTDT Table, Size = %d," \
588 Gtdt
= (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE
*)*Table
;
591 "GTDT: Gtdt = 0x%p TableSize = 0x%x\n",
596 Status
= AddAcpiHeader (
603 if (EFI_ERROR (Status
)) {
606 "ERROR: GTDT: Failed to add ACPI header. Status = %r\n",
612 Status
= AddGenericTimerInfo (
616 AcpiTableInfo
->AcpiTableRevision
618 if (EFI_ERROR (Status
)) {
621 "ERROR: GTDT: Failed to add Generic Timer Info. Status = %r\n",
627 if (BlockTimerCount
!= 0) {
628 Status
= AddGTBlockList (
635 if (EFI_ERROR (Status
)) {
638 "ERROR: GTDT: Failed to add GT Block timers. Status = %r\n",
645 if (WatchdogCount
!= 0) {
646 AddGenericWatchdogList (
657 if (*Table
!= NULL
) {
664 /** Free any resources allocated for constructing the GTDT.
666 @param [in] This Pointer to the table generator.
667 @param [in] AcpiTableInfo Pointer to the ACPI Table Info.
668 @param [in] CfgMgrProtocol Pointer to the Configuration Manager
670 @param [in, out] Table Pointer to the ACPI Table.
672 @retval EFI_SUCCESS The resources were freed successfully.
673 @retval EFI_INVALID_PARAMETER The table pointer is NULL or invalid.
677 FreeGtdtTableResources (
678 IN CONST ACPI_TABLE_GENERATOR
* CONST This
,
679 IN CONST CM_STD_OBJ_ACPI_TABLE_INFO
* CONST AcpiTableInfo
,
680 IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL
* CONST CfgMgrProtocol
,
681 IN OUT EFI_ACPI_DESCRIPTION_HEADER
** CONST Table
684 ASSERT (This
!= NULL
);
685 ASSERT (AcpiTableInfo
!= NULL
);
686 ASSERT (CfgMgrProtocol
!= NULL
);
687 ASSERT (AcpiTableInfo
->TableGeneratorId
== This
->GeneratorID
);
688 ASSERT (AcpiTableInfo
->AcpiTableSignature
== This
->AcpiTableSignature
);
690 if ((Table
== NULL
) || (*Table
== NULL
)) {
691 DEBUG ((DEBUG_ERROR
, "ERROR: GTDT: Invalid Table Pointer\n"));
692 ASSERT ((Table
!= NULL
) && (*Table
!= NULL
));
693 return EFI_INVALID_PARAMETER
;
701 /** This macro defines the GTDT Table Generator revision.
703 #define GTDT_GENERATOR_REVISION CREATE_REVISION (1, 0)
705 /** The interface for the GTDT Table Generator.
709 ACPI_TABLE_GENERATOR GtdtGenerator
= {
711 CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdGtdt
),
712 // Generator Description
713 L
"ACPI.STD.GTDT.GENERATOR",
714 // ACPI Table Signature
715 EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE
,
716 // ACPI Table Revision supported by this Generator
717 EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION
,
718 // Minimum ACPI Table Revision supported by this Generator
719 EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION
,
721 TABLE_GENERATOR_CREATOR_ID_ARM
,
723 GTDT_GENERATOR_REVISION
,
724 // Build Table function
726 // Free Resource function
727 FreeGtdtTableResources
,
728 // Extended build function not needed
730 // Extended build function not implemented by the generator.
731 // Hence extended free resource function is not required.
735 /** Register the Generator with the ACPI Table Factory.
737 @param [in] ImageHandle The handle to the image.
738 @param [in] SystemTable Pointer to the System Table.
740 @retval EFI_SUCCESS The Generator is registered.
741 @retval EFI_INVALID_PARAMETER A parameter is invalid.
742 @retval EFI_ALREADY_STARTED The Generator for the Table ID
743 is already registered.
747 AcpiGtdtLibConstructor (
748 IN EFI_HANDLE ImageHandle
,
749 IN EFI_SYSTEM_TABLE
* SystemTable
753 Status
= RegisterAcpiTableGenerator (&GtdtGenerator
);
754 DEBUG ((DEBUG_INFO
, "GTDT: Register Generator. Status = %r\n", Status
));
755 ASSERT_EFI_ERROR (Status
);
759 /** Deregister the Generator from the ACPI Table Factory.
761 @param [in] ImageHandle The handle to the image.
762 @param [in] SystemTable Pointer to the System Table.
764 @retval EFI_SUCCESS The Generator is deregistered.
765 @retval EFI_INVALID_PARAMETER A parameter is invalid.
766 @retval EFI_NOT_FOUND The Generator is not registered.
770 AcpiGtdtLibDestructor (
771 IN EFI_HANDLE ImageHandle
,
772 IN EFI_SYSTEM_TABLE
* SystemTable
776 Status
= DeregisterAcpiTableGenerator (&GtdtGenerator
);
777 DEBUG ((DEBUG_INFO
, "GTDT: Deregister Generator. Status = %r\n", Status
));
778 ASSERT_EFI_ERROR (Status
);