TianoCore EDK2 master
|
#include <Library/AcpiLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Protocol/AcpiTable.h>
#include <AcpiTableGenerator.h>
#include <ConfigurationManagerObject.h>
#include <ConfigurationManagerHelper.h>
#include <Library/TableHelperLib.h>
#include <Protocol/ConfigurationManagerProtocol.h>
#include "SratGenerator.h"
Go to the source code of this file.
Macros | |
#define | SRAT_GENERATOR_REVISION CREATE_REVISION (1, 0) |
Variables | |
STATIC CONST ACPI_TABLE_GENERATOR | SratGenerator |
SRAT Table Generator
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SratGenerator.c.
#define SRAT_GENERATOR_REVISION CREATE_REVISION (1, 0) |
The SRAT Table Generator revision.
Definition at line 584 of file SratGenerator.c.
EFI_STATUS EFIAPI AcpiSratLibConstructor | ( | 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 628 of file SratGenerator.c.
EFI_STATUS EFIAPI AcpiSratLibDestructor | ( | 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 652 of file SratGenerator.c.
STATIC EFI_STATUS AddGenericInitiatorAffinity | ( | IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol, |
IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST | Srat, | ||
IN CONST UINT32 | GenInitAffOff, | ||
IN CONST CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO * | GenInitAffInfo, | ||
IN UINT32 | GenInitAffCount | ||
) |
Add the Generic Initiator Affinity Structures in the SRAT Table.
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in] | Srat | Pointer to the SRAT Table. |
[in] | GenInitAffOff | Offset of the Generic Initiator Affinity information in the SRAT Table. |
[in] | GenInitAffInfo | Pointer to the Generic Initiator Affinity Information list. |
[in] | GenInitAffCount | Count of Generic Initiator Affinity objects. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | The required object information is 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 179 of file SratGenerator.c.
STATIC EFI_STATUS AddMemoryAffinity | ( | IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol, |
IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST | Srat, | ||
IN CONST UINT32 | MemAffOffset, | ||
IN CONST CM_ARCH_COMMON_MEMORY_AFFINITY_INFO * | MemAffInfo, | ||
IN UINT32 | MemAffCount | ||
) |
Add the Memory Affinity Structures in the SRAT Table.
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in] | Srat | Pointer to the SRAT Table. |
[in] | MemAffOffset | Offset of the Memory Affinity information in the SRAT Table. |
[in] | MemAffInfo | Pointer to the Memory Affinity Information list. |
[in] | MemAffCount | Count of Memory Affinity objects. |
EFI_SUCCESS | Table generated successfully. |
Definition at line 119 of file SratGenerator.c.
STATIC EFI_STATUS EFIAPI BuildSratTable | ( | 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 SRAT ACPI table.
Called by the Dynamic Table Manager, 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. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
Definition at line 334 of file SratGenerator.c.
STATIC EFI_STATUS EFIAPI FreeSratTableResources | ( | 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 SRAT.
[in] | This | Pointer to the table generator. |
[in] | AcpiTableInfo | Pointer to the ACPI Table Info. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in,out] | Table | Pointer to the ACPI Table. |
EFI_SUCCESS | The resources were freed successfully. |
EFI_INVALID_PARAMETER | The table pointer is NULL or invalid. |
Definition at line 556 of file SratGenerator.c.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjDeviceHandleAcpi | , | ||
CM_ARCH_COMMON_DEVICE_HANDLE_ACPI | |||
) |
This macro expands to a function that retrieves the ACPI Device Handle information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjDeviceHandlePci | , | ||
CM_ARCH_COMMON_DEVICE_HANDLE_PCI | |||
) |
This macro expands to a function that retrieves the PCI Device Handle information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjGenericInitiatorAffinityInfo | , | ||
CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO | |||
) |
This macro expands to a function that retrieves the Generic Initiator Affinity information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjMemoryAffinityInfo | , | ||
CM_ARCH_COMMON_MEMORY_AFFINITY_INFO | |||
) |
Standard SRAT Generator
Requirements: The following Configuration Manager Object(s) are used by this Generator:
STATIC UINT16 GetBdf | ( | IN CONST CM_ARCH_COMMON_DEVICE_HANDLE_PCI * | DeviceHandlePci | ) |
Return the PCI Device information in BDF format
PCI Bus Number - Max 256 busses (Bits 15:8 of BDF) PCI Device Number - Max 32 devices (Bits 7:3 of BDF) PCI Function Number - Max 8 functions (Bits 2:0 of BDF)
[in] | DeviceHandlePci | Pointer to the PCI Device Handle. |
BDF | value corresponding to the PCI Device Handle. |
Definition at line 93 of file SratGenerator.c.
STATIC CONST ACPI_TABLE_GENERATOR SratGenerator |
The interface for the SRAT Table Generator.
Definition at line 590 of file SratGenerator.c.