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

Go to the source code of this file.

Macros

#define HPET_VALID_PAGE_PROTECTION
 
#define HPET_GENERATOR_REVISION   CREATE_REVISION (1, 0)
 

Functions

 GET_OBJECT_LIST (EObjNameSpaceX64, EX64ObjHpetInfo, CM_X64_HPET_INFO)
 
STATIC EFI_STATUS EFIAPI SsdtHpetUpdateTableInfo (IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT AML_OBJECT_NODE_HANDLE ScopeNode)
 
STATIC EFI_STATUS EFIAPI BuildSsdtHpetTable (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 EFIAPI FreeSsdtHpetTableResources (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 AcpiSsdtHpetLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI AcpiSsdtHpetLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC CONST ACPI_TABLE_GENERATOR SsdtHpetGenerator
 

Detailed Description

Generate ACPI HPET table for AMD platforms.

Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.

SPDX-License-Identifier BSD-2-Clause-Patent

Definition in file AcpiSsdtHpetLib.c.

Macro Definition Documentation

◆ HPET_GENERATOR_REVISION

#define HPET_GENERATOR_REVISION   CREATE_REVISION (1, 0)

This macro defines the HPET Table Generator revision.

Definition at line 349 of file AcpiSsdtHpetLib.c.

◆ HPET_VALID_PAGE_PROTECTION

#define HPET_VALID_PAGE_PROTECTION
Value:
(EFI_ACPI_NO_PAGE_PROTECTION | \
EFI_ACPI_4KB_PAGE_PROTECTION | \
EFI_ACPI_64KB_PAGE_PROTECTION)

This macro defines supported HPET page protection flags

Definition at line 29 of file AcpiSsdtHpetLib.c.

Function Documentation

◆ AcpiSsdtHpetLibConstructor()

EFI_STATUS EFIAPI AcpiSsdtHpetLibConstructor ( 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 393 of file AcpiSsdtHpetLib.c.

◆ AcpiSsdtHpetLibDestructor()

EFI_STATUS EFIAPI AcpiSsdtHpetLibDestructor ( 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 417 of file AcpiSsdtHpetLib.c.

◆ BuildSsdtHpetTable()

Construct the SSDT HPET table.

This function invokes the Configuration Manager protocol interface to get the required 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 231 of file AcpiSsdtHpetLib.c.

◆ FreeSsdtHpetTableResources()

STATIC EFI_STATUS EFIAPI FreeSsdtHpetTableResources ( 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 SSDT HPET ACPI table.

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 323 of file AcpiSsdtHpetLib.c.

◆ GET_OBJECT_LIST()

GET_OBJECT_LIST ( EObjNameSpaceX64  ,
EX64ObjHpetInfo  ,
CM_X64_HPET_INFO   
)

This macro expands to a function that retrieves the HPET device information from the Configuration Manager.

◆ SsdtHpetUpdateTableInfo()

STATIC EFI_STATUS EFIAPI SsdtHpetUpdateTableInfo ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN OUT AML_OBJECT_NODE_HANDLE  ScopeNode 
)

Update HPET table information.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in,out]ScopeNodeThe Scope Node for the HPET table.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe required object was not found or the HPET is not enabled.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.
EFI_UNSUPPORTEDIf invalid protection and oem flags provided.

Definition at line 61 of file AcpiSsdtHpetLib.c.

Variable Documentation

◆ SsdtHpetGenerator

STATIC CONST ACPI_TABLE_GENERATOR SsdtHpetGenerator
Initial value:
= {
L"ACPI.STD.SSDT.HPET.GENERATOR",
0,
0,
}
#define EFI_ACPI_6_5_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE
Definition: Acpi65.h:3182
STATIC EFI_STATUS EFIAPI FreeSsdtHpetTableResources(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 HPET_GENERATOR_REVISION
STATIC EFI_STATUS EFIAPI BuildSsdtHpetTable(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 CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdSsdtHpet
SSDT HPET Generator.
#define NULL
Definition: Base.h:319

The interface for the HPET Table Generator.

Definition at line 355 of file AcpiSsdtHpetLib.c.