TianoCore EDK2 master
|
#include <Library/AcpiLib.h>
#include <Library/DebugLib.h>
#include <Protocol/AcpiTable.h>
#include <AcpiTableGenerator.h>
#include <ConfigurationManagerObject.h>
#include <ConfigurationManagerHelper.h>
#include <Library/TableHelperLib.h>
#include <Protocol/ConfigurationManagerProtocol.h>
#include "FadtGenerator.h"
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) |
Variables | |
STATIC EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE | AcpiFadt |
STATIC CONST ACPI_TABLE_GENERATOR | FadtGenerator |
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
Definition in file FadtGenerator.c.
#define FADT_GENERATOR_REVISION CREATE_REVISION (1, 0) |
This macro defines the FADT Table Generator revision.
Definition at line 634 of file FadtGenerator.c.
#define VALID_HARDWARE_REDUCED_FLAG_MASK |
Standard FADT Generator
Requirements: The following Configuration Manager Object(s) are required by this Generator:
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.
#define VALID_NON_HARDWARE_REDUCED_FLAG_MASK |
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.
EFI_STATUS EFIAPI AcpiFadtLibConstructor | ( | 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 679 of file FadtGenerator.c.
EFI_STATUS EFIAPI AcpiFadtLibDestructor | ( | 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 703 of file FadtGenerator.c.
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 | ||
) |
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.
[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. |
Definition at line 502 of file FadtGenerator.c.
STATIC EFI_STATUS EFIAPI FadtAddFixedFeatureFlags | ( | IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol | ) |
Update the Fixed Feature Flags in the FADT Table.
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
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 406 of file FadtGenerator.c.
STATIC EFI_STATUS EFIAPI FadtAddHypervisorVendorId | ( | IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol | ) |
Update the Hypervisor Vendor ID in the FADT Table.
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
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 344 of file FadtGenerator.c.
STATIC EFI_STATUS EFIAPI FadtAddPmProfileInfo | ( | IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol | ) |
Update the Power Management Profile information in the FADT Table.
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
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 291 of file FadtGenerator.c.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjFixedFeatureFlags | , | ||
CM_ARCH_COMMON_FIXED_FEATURE_FLAGS | |||
) |
This macro expands to a function that retrieves the Fixed feature flags for the platform from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjHypervisorVendorIdentity | , | ||
CM_ARCH_COMMON_HYPERVISOR_VENDOR_ID | |||
) |
This macro expands to a function that retrieves the Hypervisor Vendor ID from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjPowerManagementProfileInfo | , | ||
CM_ARCH_COMMON_POWER_MANAGEMENT_PROFILE_INFO | |||
) |
This macro expands to a function that retrieves the Power Management Profile Information from the Configuration Manager.
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.
STATIC CONST ACPI_TABLE_GENERATOR FadtGenerator |
The interface for the FADT Table Generator.
Definition at line 640 of file FadtGenerator.c.