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

Go to the source code of this file.

Macros

#define VALID_HARDWARE_REDUCED_FLAG_MASK
 
#define VALID_NON_HARDWARE_REDUCED_FLAG_MASK
 
#define FADT_GENERATOR_REVISION   CREATE_REVISION (1, 0)
 

Functions

 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjPowerManagementProfileInfo, CM_ARCH_COMMON_POWER_MANAGEMENT_PROFILE_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjHypervisorVendorIdentity, CM_ARCH_COMMON_HYPERVISOR_VENDOR_ID)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjFixedFeatureFlags, CM_ARCH_COMMON_FIXED_FEATURE_FLAGS)
 
STATIC EFI_STATUS EFIAPI FadtAddPmProfileInfo (IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol)
 
STATIC EFI_STATUS EFIAPI FadtAddHypervisorVendorId (IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol)
 
STATIC EFI_STATUS EFIAPI FadtAddFixedFeatureFlags (IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol)
 
STATIC EFI_STATUS EFIAPI BuildFadtTable (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)
 
EFI_STATUS EFIAPI AcpiFadtLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI AcpiFadtLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt
 
STATIC CONST ACPI_TABLE_GENERATOR FadtGenerator
 

Detailed Description

FADT Table Generator

Copyright (c) 2017 - 2023, Arm Limited. All rights reserved. Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.

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

Reference(s):
  • ACPI 6.5 Specification, Aug 29, 2022

Definition in file FadtGenerator.c.

Macro Definition Documentation

◆ FADT_GENERATOR_REVISION

#define FADT_GENERATOR_REVISION   CREATE_REVISION (1, 0)

This macro defines the FADT Table Generator revision.

Definition at line 634 of file FadtGenerator.c.

◆ VALID_HARDWARE_REDUCED_FLAG_MASK

#define VALID_HARDWARE_REDUCED_FLAG_MASK
Value:
( \
EFI_ACPI_6_5_WBINVD | \
EFI_ACPI_6_5_PWR_BUTTON | \
EFI_ACPI_6_5_SLP_BUTTON | \
EFI_ACPI_6_5_FIX_RTC | \
EFI_ACPI_6_5_DCK_CAP | \
EFI_ACPI_6_5_RESET_REG_SUP | \
EFI_ACPI_6_5_SEALED_CASE | \
EFI_ACPI_6_5_HEADLESS | \
EFI_ACPI_6_5_USE_PLATFORM_CLOCK | \
EFI_ACPI_6_5_FORCE_APIC_CLUSTER_MODEL | \
EFI_ACPI_6_5_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \
EFI_ACPI_6_5_HW_REDUCED_ACPI | \
EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE)

Standard FADT Generator

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

  • EArchCommonObjPowerManagementProfileInfo
  • EArchCommonObjHypervisorVendorIdentity (OPTIONAL) This macro defines the valid mask for the FADT flag option if HW_REDUCED_ACPI flag in the table is set.

Invalid bits are: 1, 2, 3,7, 8, 13, 14,16, 17 and 22-31 (reserved).

Valid bits are: EFI_ACPI_6_5_WBINVD BIT0 EFI_ACPI_6_5_PWR_BUTTON BIT4 EFI_ACPI_6_5_SLP_BUTTON BIT5 EFI_ACPI_6_5_FIX_RTC BIT6 EFI_ACPI_6_5_DCK_CAP BIT9 EFI_ACPI_6_5_RESET_REG_SUP BIT10 EFI_ACPI_6_5_SEALED_CASE BIT11 EFI_ACPI_6_5_HEADLESS BIT12 EFI_ACPI_6_5_USE_PLATFORM_CLOCK BIT15 EFI_ACPI_6_5_FORCE_APIC_CLUSTER_MODEL BIT18 EFI_ACPI_6_5_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19 EFI_ACPI_6_5_HW_REDUCED_ACPI BIT20 EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE BIT21

Definition at line 56 of file FadtGenerator.c.

◆ VALID_NON_HARDWARE_REDUCED_FLAG_MASK

#define VALID_NON_HARDWARE_REDUCED_FLAG_MASK
Value:
( \
EFI_ACPI_6_5_WBINVD | \
EFI_ACPI_6_5_WBINVD_FLUSH | \
EFI_ACPI_6_5_PROC_C1 | \
EFI_ACPI_6_5_P_LVL2_UP | \
EFI_ACPI_6_5_PWR_BUTTON | \
EFI_ACPI_6_5_SLP_BUTTON | \
EFI_ACPI_6_5_FIX_RTC | \
EFI_ACPI_6_5_RTC_S4 | \
EFI_ACPI_6_5_TMR_VAL_EXT | \
EFI_ACPI_6_5_DCK_CAP | \
EFI_ACPI_6_5_RESET_REG_SUP | \
EFI_ACPI_6_5_SEALED_CASE | \
EFI_ACPI_6_5_HEADLESS | \
EFI_ACPI_6_5_CPU_SW_SLP | \
EFI_ACPI_6_5_PCI_EXP_WAK | \
EFI_ACPI_6_5_USE_PLATFORM_CLOCK | \
EFI_ACPI_6_5_S4_RTC_STS_VALID | \
EFI_ACPI_6_5_REMOTE_POWER_ON_CAPABLE | \
EFI_ACPI_6_5_FORCE_APIC_CLUSTER_MODEL | \
EFI_ACPI_6_5_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \
EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE)

This macro defines the valid mask for the FADT flag option if HW_REDUCED_ACPI flag in the table is not set.

Invalid bits are: Bit 20 and 22-31 (reserved).

Valid bits are: EFI_ACPI_6_5_WBINVD BIT0 EFI_ACPI_6_5_WBINVD_FLUSH BIT1 EFI_ACPI_6_5_PROC_C1 BIT2 EFI_ACPI_6_5_P_LVL2_UP BIT3 EFI_ACPI_6_5_PWR_BUTTON BIT4 EFI_ACPI_6_5_SLP_BUTTON BIT5 EFI_ACPI_6_5_FIX_RTC BIT6 EFI_ACPI_6_5_RTC_S4 BIT7 EFI_ACPI_6_5_TMR_VAL_EXT BIT8 EFI_ACPI_6_5_DCK_CAP BIT9 EFI_ACPI_6_5_RESET_REG_SUP BIT10 EFI_ACPI_6_5_SEALED_CASE BIT11 EFI_ACPI_6_5_HEADLESS BIT12 EFI_ACPI_6_5_CPU_SW_SLP BIT13 EFI_ACPI_6_5_PCI_EXP_WAK BIT14 EFI_ACPI_6_5_USE_PLATFORM_CLOCK BIT15 EFI_ACPI_6_5_S4_RTC_STS_VALID BIT16 EFI_ACPI_6_5_REMOTE_POWER_ON_CAPABLE BIT17 EFI_ACPI_6_5_FORCE_APIC_CLUSTER_MODEL BIT18 EFI_ACPI_6_5_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19 EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE BIT21

Definition at line 99 of file FadtGenerator.c.

Function Documentation

◆ AcpiFadtLibConstructor()

EFI_STATUS EFIAPI AcpiFadtLibConstructor ( 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 679 of file FadtGenerator.c.

◆ AcpiFadtLibDestructor()

EFI_STATUS EFIAPI AcpiFadtLibDestructor ( 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 703 of file FadtGenerator.c.

◆ BuildFadtTable()

Construct the FADT table.

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.

Definition at line 502 of file FadtGenerator.c.

◆ FadtAddFixedFeatureFlags()

STATIC EFI_STATUS EFIAPI FadtAddFixedFeatureFlags ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol)

Update the Fixed Feature Flags in the FADT Table.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
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 406 of file FadtGenerator.c.

◆ FadtAddHypervisorVendorId()

STATIC EFI_STATUS EFIAPI FadtAddHypervisorVendorId ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol)

Update the Hypervisor Vendor ID in the FADT Table.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
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 344 of file FadtGenerator.c.

◆ FadtAddPmProfileInfo()

STATIC EFI_STATUS EFIAPI FadtAddPmProfileInfo ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol)

Update the Power Management Profile information in the FADT Table.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
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 291 of file FadtGenerator.c.

◆ GET_OBJECT_LIST() [1/3]

This macro expands to a function that retrieves the Fixed feature flags for the platform from the Configuration Manager.

◆ GET_OBJECT_LIST() [2/3]

This macro expands to a function that retrieves the Hypervisor Vendor ID from the Configuration Manager.

◆ GET_OBJECT_LIST() [3/3]

This macro expands to a function that retrieves the Power Management Profile Information from the Configuration Manager.

Variable Documentation

◆ AcpiFadt

The AcpiFadt is a template EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE structure used for generating the FADT Table. Note: fields marked with "{Template}" will be updated dynamically.

Definition at line 129 of file FadtGenerator.c.

◆ FadtGenerator

Initial value:
= {
L"ACPI.STD.FADT.GENERATOR",
}
#define EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_REVISION
Definition: Acpi62.h:278
#define EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_REVISION
Definition: Acpi65.h:188
#define EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE
Definition: Acpi65.h:3082
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdFadt
FADT Generator.
#define FADT_GENERATOR_REVISION
STATIC EFI_STATUS EFIAPI BuildFadtTable(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 NULL
Definition: Base.h:319

The interface for the FADT Table Generator.

Definition at line 640 of file FadtGenerator.c.