mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
DynamicTablesPkg: Adds X64 support to SRAT table generator
Adds X64 support to the SRAT table generator library. Adds EX64ObjLocalApicX2ApicAffinity CM object to get platform configuration information. Update the parser with newly added CM object. Cc: Sami Mujawar <Sami.Mujawar@arm.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
This commit is contained in:
parent
1f1182c396
commit
2b3ea9334f
DynamicTablesPkg
DynamicTables.dsc.incDynamicTablesPkg.ci.yamlReadme.md
Include
Library
Acpi/Common/AcpiSratLib
Common/TableHelperLib
@ -71,6 +71,7 @@
|
||||
# Generators
|
||||
# Common
|
||||
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
|
||||
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
|
||||
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSpmiLib/AcpiSpmiLib.inf
|
||||
# X64 specific
|
||||
NULL|DynamicTablesPkg/Library/Acpi/X64/AcpiFacsLib/AcpiFacsLib.inf
|
||||
|
@ -2,7 +2,7 @@
|
||||
# CI configuration for DynamicTablesPkg
|
||||
#
|
||||
# Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
|
||||
# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
|
||||
# Copyright (C) 2024 - 2025 Advanced Micro Devices, Inc. All rights reserved.<BR>
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
{
|
||||
@ -123,6 +123,7 @@
|
||||
"Rdword",
|
||||
"Roadmap",
|
||||
"ROOTNODEBASE",
|
||||
"sapic",
|
||||
"ssdtcmn",
|
||||
"ssdtserialporttemplate",
|
||||
"SMMUV",
|
||||
|
@ -33,25 +33,26 @@ typedef enum {
|
||||
in the X64 Namespace
|
||||
*/
|
||||
typedef enum X64ObjectID {
|
||||
EX64ObjReserved, ///< 0 - Reserved
|
||||
EX64ObjFadtSciInterrupt, ///< 1 - FADT SCI Interrupt information
|
||||
EX64ObjFadtSciCmdInfo, ///< 2 - FADT SCI CMD information
|
||||
EX64ObjFadtPmBlockInfo, ///< 3 - FADT Power management block info
|
||||
EX64ObjFadtGpeBlockInfo, ///< 4 - FADT GPE block info
|
||||
EX64ObjFadtXpmBlockInfo, ///< 5 - FADT 64-bit Power Management block info
|
||||
EX64ObjFadtXgpeBlockInfo, ///< 6 - FADT 64-bit GPE block info
|
||||
EX64ObjFadtSleepBlockInfo, ///< 7 - FADT Sleep block info
|
||||
EX64ObjFadtResetBlockInfo, ///< 8 - FADT Reset block info
|
||||
EX64ObjFadtMiscInfo, ///< 9 - FADT Legacy fields info
|
||||
EX64ObjWsmtFlagsInfo, ///< 10 - WSMT protection flags info
|
||||
EX64ObjHpetInfo, ///< 11 - HPET device info
|
||||
EX64ObjMadtInfo, ///< 12 - MADT info
|
||||
EX64ObjLocalApicX2ApicInfo, ///< 13 - Local APIC and X2APIC info
|
||||
EX64ObjIoApicInfo, ///< 14 - IO APIC info
|
||||
EX64ObjIntrSourceOverrideInfo, ///< 15 - Interrupt Source Override info
|
||||
EX64ObjLocalApicX2ApicNmiInfo, ///< 16 - Local APIC and X2APIC NMI info
|
||||
EX64ObjFacsInfo, ///< 17 - FACS info
|
||||
EX64ObjMax ///< 18 - Maximum Object ID
|
||||
EX64ObjReserved, ///< 0 - Reserved
|
||||
EX64ObjFadtSciInterrupt, ///< 1 - FADT SCI Interrupt information
|
||||
EX64ObjFadtSciCmdInfo, ///< 2 - FADT SCI CMD information
|
||||
EX64ObjFadtPmBlockInfo, ///< 3 - FADT Power management block info
|
||||
EX64ObjFadtGpeBlockInfo, ///< 4 - FADT GPE block info
|
||||
EX64ObjFadtXpmBlockInfo, ///< 5 - FADT 64-bit Power Management block info
|
||||
EX64ObjFadtXgpeBlockInfo, ///< 6 - FADT 64-bit GPE block info
|
||||
EX64ObjFadtSleepBlockInfo, ///< 7 - FADT Sleep block info
|
||||
EX64ObjFadtResetBlockInfo, ///< 8 - FADT Reset block info
|
||||
EX64ObjFadtMiscInfo, ///< 9 - FADT Legacy fields info
|
||||
EX64ObjWsmtFlagsInfo, ///< 10 - WSMT protection flags info
|
||||
EX64ObjHpetInfo, ///< 11 - HPET device info
|
||||
EX64ObjMadtInfo, ///< 12 - MADT info
|
||||
EX64ObjLocalApicX2ApicInfo, ///< 13 - Local APIC and X2APIC info
|
||||
EX64ObjIoApicInfo, ///< 14 - IO APIC info
|
||||
EX64ObjIntrSourceOverrideInfo, ///< 15 - Interrupt Source Override info
|
||||
EX64ObjLocalApicX2ApicNmiInfo, ///< 16 - Local APIC and X2APIC NMI info
|
||||
EX64ObjFacsInfo, ///< 17 - FACS info
|
||||
EX64ObjLocalApicX2ApicAffinityInfo, ///< 18 - Local APIC and X2APIC Affinity info
|
||||
EX64ObjMax ///< 19 - Maximum Object ID
|
||||
} EX64_OBJECT_ID;
|
||||
|
||||
/** A structure that describes the
|
||||
@ -278,5 +279,18 @@ typedef struct CmX64FacsInfo {
|
||||
UINT32 OspmFlags;
|
||||
} CM_X64_FACS_INFO;
|
||||
|
||||
/**
|
||||
A structure that describes the Local APIC and X2APIC Affinity information.
|
||||
|
||||
ID: EX64ObjLocalApicX2ApicAffinityInfo
|
||||
*/
|
||||
typedef struct CmX64LocalApicX2ApicAffinityInfo {
|
||||
LOCAL_APIC_MODE ApicMode;
|
||||
UINT32 ApicId;
|
||||
UINT32 ProximityDomain;
|
||||
UINT32 Flags;
|
||||
UINT32 ClockDomain;
|
||||
} CM_X64_LOCAL_APIC_X2APIC_AFFINITY_INFO;
|
||||
|
||||
#pragma pack()
|
||||
#endif // X64_NAMESPACE_OBJECTS_H_
|
||||
|
@ -2,6 +2,7 @@
|
||||
# SRAT Table Generator
|
||||
#
|
||||
# Copyright (c) 2019, ARM Limited. All rights reserved.
|
||||
# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
@ -24,7 +25,7 @@
|
||||
Arm/ArmSratGenerator.c
|
||||
|
||||
[Sources.IA32, Sources.X64]
|
||||
SratGeneratorNull.c
|
||||
X64/X64SratGenerator.c
|
||||
|
||||
[Packages]
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
|
@ -2,6 +2,8 @@
|
||||
SRAT Table Generator
|
||||
|
||||
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.
|
||||
Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@par Reference(s):
|
||||
@ -140,9 +142,9 @@ AddMemoryAffinity (
|
||||
MemAff->ProximityDomain = MemAffInfo->ProximityDomain;
|
||||
MemAff->Reserved1 = EFI_ACPI_RESERVED_WORD;
|
||||
MemAff->AddressBaseLow = (UINT32)(MemAffInfo->BaseAddress & MAX_UINT32);
|
||||
MemAff->AddressBaseHigh = (UINT32)(MemAffInfo->BaseAddress >> 32);
|
||||
MemAff->AddressBaseHigh = (UINT32)RShiftU64 (MemAffInfo->BaseAddress, 32);
|
||||
MemAff->LengthLow = (UINT32)(MemAffInfo->Length & MAX_UINT32);
|
||||
MemAff->LengthHigh = (UINT32)(MemAffInfo->Length >> 32);
|
||||
MemAff->LengthHigh = (UINT32)RShiftU64 (MemAffInfo->Length, 32);
|
||||
MemAff->Reserved2 = EFI_ACPI_RESERVED_DWORD;
|
||||
MemAff->Flags = MemAffInfo->Flags;
|
||||
MemAff->Reserved3 = EFI_ACPI_RESERVED_QWORD;
|
||||
|
@ -1,79 +0,0 @@
|
||||
/** @file
|
||||
Common SRAT Table Generator
|
||||
|
||||
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@par Reference(s):
|
||||
- ACPI 6.3 Specification, January 2019
|
||||
|
||||
@par Glossary:
|
||||
- Cm or CM - Configuration Manager
|
||||
- Obj or OBJ - Object
|
||||
**/
|
||||
|
||||
#include <Library/AcpiLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Protocol/AcpiTable.h>
|
||||
|
||||
// Module specific include files.
|
||||
#include <AcpiTableGenerator.h>
|
||||
#include <ConfigurationManagerObject.h>
|
||||
#include <ConfigurationManagerHelper.h>
|
||||
#include <Library/TableHelperLib.h>
|
||||
#include <Protocol/ConfigurationManagerProtocol.h>
|
||||
|
||||
#include "SratGenerator.h"
|
||||
|
||||
/** Reserve arch sub-tables space.
|
||||
|
||||
@param [in] CfgMgrProtocol Pointer to the Configuration Manager
|
||||
@param [in, out] ArchOffset On input, contains the offset where arch specific
|
||||
sub-tables can be written. It is expected that
|
||||
there enough space to write all the arch specific
|
||||
sub-tables from this offset onward.
|
||||
On ouput, contains the ending offset of the arch
|
||||
specific sub-tables.
|
||||
|
||||
@retval EFI_SUCCESS Table generated successfully.
|
||||
@retval EFI_UNSUPPORTED Not supported.
|
||||
@retval EFI_INVALID_PARAMETER A parameter is invalid.
|
||||
@retval EFI_NOT_FOUND The required object information is not found.
|
||||
@retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration
|
||||
Manager is less than the Object size for the
|
||||
requested object.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArchReserveOffsets (
|
||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
|
||||
IN OUT UINT32 *ArchOffset
|
||||
)
|
||||
{
|
||||
// Not implemented.
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
/** Add the arch specific sub-tables to the SRAT table.
|
||||
|
||||
These sub-tables are written in the space reserved beforehand.
|
||||
|
||||
@param [in] CfgMgrProtocol Pointer to the Configuration Manager
|
||||
Protocol Interface.
|
||||
@param [in] Srat Pointer to the SRAT Table.
|
||||
|
||||
@retval EFI_SUCCESS Table generated successfully.
|
||||
@retval EFI_UNSUPPORTED Not supported.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AddArchObjects (
|
||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
|
||||
IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST Srat
|
||||
)
|
||||
{
|
||||
// Not implemented.
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
@ -0,0 +1,236 @@
|
||||
/** @file
|
||||
X64 SRAT Table Generator
|
||||
|
||||
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.
|
||||
Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@par Reference(s):
|
||||
- ACPI 6.3 Specification, January 2019
|
||||
|
||||
@par Glossary:
|
||||
- Cm or CM - Configuration Manager
|
||||
- Obj or OBJ - Object
|
||||
**/
|
||||
|
||||
#include <Library/AcpiLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Protocol/AcpiTable.h>
|
||||
|
||||
// Module specific include files.
|
||||
#include <AcpiTableGenerator.h>
|
||||
#include <ConfigurationManagerObject.h>
|
||||
#include <ConfigurationManagerHelper.h>
|
||||
#include <Library/TableHelperLib.h>
|
||||
#include <Protocol/ConfigurationManagerProtocol.h>
|
||||
|
||||
#include "SratGenerator.h"
|
||||
|
||||
/**
|
||||
This macro is used to get the object information for the Local APIC X2APIC
|
||||
Affinity object.
|
||||
*/
|
||||
GET_OBJECT_LIST (
|
||||
EObjNameSpaceX64,
|
||||
EX64ObjLocalApicX2ApicAffinityInfo,
|
||||
CM_X64_LOCAL_APIC_X2APIC_AFFINITY_INFO
|
||||
);
|
||||
|
||||
/** Enum of the X64 specific CM objects required to
|
||||
build the arch specific information of the SRAT table.
|
||||
*/
|
||||
typedef enum X64SratSubTableType {
|
||||
EX64LocalApicX2ApicAffinityTableType,
|
||||
EX64SubTableTypeMax
|
||||
} EX64_SRAT_SUB_TABLE_TYPE;
|
||||
|
||||
typedef struct SratSubTable {
|
||||
/// Start offset of the arch specific sub-table.
|
||||
UINT32 Offset;
|
||||
|
||||
/// Count
|
||||
UINT32 Count;
|
||||
|
||||
/// Array of CmInfo objects of the relevant type.
|
||||
VOID *CmInfo;
|
||||
} SRAT_SUB_TABLE;
|
||||
|
||||
STATIC SRAT_SUB_TABLE mSratSubTable[EX64SubTableTypeMax];
|
||||
|
||||
/** Reserve arch sub-tables space.
|
||||
|
||||
@param [in] CfgMgrProtocol Pointer to the Configuration Manager
|
||||
@param [in, out] ArchOffset On input, contains the offset where arch specific
|
||||
sub-tables can be written. It is expected that
|
||||
there enough space to write all the arch specific
|
||||
sub-tables from this offset onward.
|
||||
On ouput, contains the ending offset of the arch
|
||||
specific sub-tables.
|
||||
|
||||
@retval EFI_SUCCESS Table generated successfully.
|
||||
@retval EFI_UNSUPPORTED Not supported.
|
||||
@retval EFI_INVALID_PARAMETER A parameter is invalid.
|
||||
@retval EFI_NOT_FOUND The required object information is not found.
|
||||
@retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration
|
||||
Manager is less than the Object size for the
|
||||
requested object.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArchReserveOffsets (
|
||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
|
||||
IN OUT UINT32 *ArchOffset
|
||||
)
|
||||
{
|
||||
CM_X64_LOCAL_APIC_X2APIC_AFFINITY_INFO *CmX2ApicAffinity;
|
||||
EFI_STATUS Status;
|
||||
LOCAL_APIC_MODE ApicMode;
|
||||
UINT32 CmCount;
|
||||
UINT32 Index;
|
||||
|
||||
ASSERT (CfgMgrProtocol != NULL);
|
||||
ASSERT (ArchOffset != NULL);
|
||||
|
||||
Status = GetEX64ObjLocalApicX2ApicAffinityInfo (
|
||||
CfgMgrProtocol,
|
||||
CM_NULL_TOKEN,
|
||||
&CmX2ApicAffinity,
|
||||
&CmCount
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"ERROR: SRAT: Failed to get Local Apic/X2Apic Affinity Info. Status = %r\n",
|
||||
Status
|
||||
));
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (CmCount == 0) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"ERROR: SRAT: Local Apic/X2Apic Affinity information not provided.\n"
|
||||
));
|
||||
ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ApicMode = CmX2ApicAffinity[0].ApicMode;
|
||||
for (Index = 0; Index < CmCount; Index++) {
|
||||
if ((CmX2ApicAffinity[Index].Flags &
|
||||
~EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED) != 0)
|
||||
{
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"ERROR: SRAT: Invalid Flags. Flags = 0x%x\n",
|
||||
CmX2ApicAffinity[Index].Flags
|
||||
));
|
||||
ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (CmX2ApicAffinity[Index].ApicMode == LocalApicModeXApic) {
|
||||
if (CmX2ApicAffinity[Index].ApicId > MAX_UINT8) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"ERROR: SRAT: Local Apic Id is invalid. ApicId = 0x%x\n",
|
||||
CmX2ApicAffinity[Index].ApicId
|
||||
));
|
||||
ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
if (CmX2ApicAffinity[Index].ApicMode != ApicMode) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"ERROR: SRAT: Mixed Apic Modes are not supported.\n"
|
||||
));
|
||||
ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
mSratSubTable[EX64LocalApicX2ApicAffinityTableType].CmInfo = CmX2ApicAffinity;
|
||||
mSratSubTable[EX64LocalApicX2ApicAffinityTableType].Count = CmCount;
|
||||
mSratSubTable[EX64LocalApicX2ApicAffinityTableType].Offset = *ArchOffset;
|
||||
|
||||
if (CmX2ApicAffinity[0].ApicMode == LocalApicModeX2Apic) {
|
||||
*ArchOffset += sizeof (EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE) * CmCount;
|
||||
} else {
|
||||
*ArchOffset += sizeof (EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE) * CmCount;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/** Add the arch specific sub-tables to the SRAT table.
|
||||
|
||||
These sub-tables are written in the space reserved beforehand.
|
||||
|
||||
@param [in] CfgMgrProtocol Pointer to the Configuration Manager
|
||||
Protocol Interface.
|
||||
@param [in] Srat Pointer to the SRAT Table.
|
||||
|
||||
@retval EFI_SUCCESS Table generated successfully.
|
||||
@retval EFI_UNSUPPORTED Not supported.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AddArchObjects (
|
||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
|
||||
IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST Srat
|
||||
)
|
||||
{
|
||||
CM_X64_LOCAL_APIC_X2APIC_AFFINITY_INFO *CmX2ApicAffinity;
|
||||
EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE *ApicAffinity;
|
||||
EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE *X2ApicAffinity;
|
||||
|
||||
CmX2ApicAffinity = (CM_X64_LOCAL_APIC_X2APIC_AFFINITY_INFO *)
|
||||
mSratSubTable[EX64LocalApicX2ApicAffinityTableType].CmInfo;
|
||||
|
||||
if (CmX2ApicAffinity->ApicMode == LocalApicModeX2Apic) {
|
||||
X2ApicAffinity = (EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE *)
|
||||
((UINT8 *)Srat +
|
||||
mSratSubTable[EX64LocalApicX2ApicAffinityTableType].Offset);
|
||||
while (mSratSubTable[EX64LocalApicX2ApicAffinityTableType].Count-- != 0) {
|
||||
X2ApicAffinity->Type = EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_AFFINITY;
|
||||
X2ApicAffinity->Length = sizeof (EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE);
|
||||
X2ApicAffinity->Reserved1[0] = EFI_ACPI_RESERVED_BYTE;
|
||||
X2ApicAffinity->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
|
||||
X2ApicAffinity->ProximityDomain = CmX2ApicAffinity->ProximityDomain;
|
||||
X2ApicAffinity->X2ApicId = CmX2ApicAffinity->ApicId;
|
||||
X2ApicAffinity->Flags = CmX2ApicAffinity->Flags;
|
||||
X2ApicAffinity->ClockDomain = CmX2ApicAffinity->ClockDomain;
|
||||
X2ApicAffinity->Reserved2[0] = EFI_ACPI_RESERVED_BYTE;
|
||||
X2ApicAffinity->Reserved2[1] = EFI_ACPI_RESERVED_BYTE;
|
||||
X2ApicAffinity->Reserved2[2] = EFI_ACPI_RESERVED_BYTE;
|
||||
X2ApicAffinity->Reserved2[3] = EFI_ACPI_RESERVED_BYTE;
|
||||
X2ApicAffinity++;
|
||||
// Next
|
||||
CmX2ApicAffinity++;
|
||||
}
|
||||
} else {
|
||||
ApicAffinity = (EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE *)
|
||||
((UINT8 *)Srat +
|
||||
mSratSubTable[EX64LocalApicX2ApicAffinityTableType].Offset);
|
||||
while (mSratSubTable[EX64LocalApicX2ApicAffinityTableType].Count-- != 0) {
|
||||
ApicAffinity->Type = EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY;
|
||||
ApicAffinity->Length = sizeof (EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE);
|
||||
ApicAffinity->ProximityDomain7To0 = (CmX2ApicAffinity->ProximityDomain & MAX_UINT8);
|
||||
ApicAffinity->ApicId = CmX2ApicAffinity->ApicId & MAX_UINT8;
|
||||
ApicAffinity->Flags = CmX2ApicAffinity->Flags;
|
||||
ApicAffinity->LocalSapicEid = 0;
|
||||
ApicAffinity->ProximityDomain31To8[0] = (CmX2ApicAffinity->ProximityDomain >> 8) & MAX_UINT8;
|
||||
ApicAffinity->ProximityDomain31To8[0] = (CmX2ApicAffinity->ProximityDomain >> 16) & MAX_UINT8;
|
||||
ApicAffinity->ProximityDomain31To8[0] = (CmX2ApicAffinity->ProximityDomain >> 24) & MAX_UINT8;
|
||||
ApicAffinity->ClockDomain = CmX2ApicAffinity->ClockDomain;
|
||||
ApicAffinity++;
|
||||
CmX2ApicAffinity++;
|
||||
} // while
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
@ -934,27 +934,38 @@ STATIC CONST CM_OBJ_PARSER CmX64ObjFacsInfoParser[] = {
|
||||
{ "OspmFlags", 4, "0x%x", NULL }
|
||||
};
|
||||
|
||||
/** A parser for CmX64LocalApicX2ApicAffinityInfo.
|
||||
*/
|
||||
STATIC CONST CM_OBJ_PARSER CmX64LocalApicX2ApicAffinityInfo[] = {
|
||||
{ "ApicMode", sizeof (LOCAL_APIC_MODE), "0x%x", NULL },
|
||||
{ "ApicId", 4, "0x%x", NULL },
|
||||
{ "ProximityDomain", 4, "0x%x", NULL },
|
||||
{ "Flags", 4, "0x%x", NULL },
|
||||
{ "ClockDomain", 4, "0x%x", NULL }
|
||||
};
|
||||
|
||||
/** A parser for X64 namespace objects.
|
||||
*/
|
||||
STATIC CONST CM_OBJ_PARSER_ARRAY X64NamespaceObjectParser[] = {
|
||||
CM_PARSER_ADD_OBJECT_RESERVED (EX64ObjReserved),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtSciInterrupt, CmX64ObjFadtSciInterruptParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtSciCmdInfo, CmX64ObjFadtSciCmdInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtPmBlockInfo, CmX64ObjFadtPmBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtGpeBlockInfo, CmX64ObjFadtGpeBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtXpmBlockInfo, CmX64ObjFadtXpmBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtXgpeBlockInfo, CmX64ObjFadtXgpeBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtSleepBlockInfo, CmX64ObjFadtSleepBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtResetBlockInfo, CmX64ObjFadtResetBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtMiscInfo, CmX64ObjFadtMiscInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjWsmtFlagsInfo, CmX64ObjWsmtFlagsInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjHpetInfo, CmX64ObjHpetInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjMadtInfo, CmX64ObjMadtInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjLocalApicX2ApicInfo, CmX64ObjLocalApicX2ApicInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjIoApicInfo, CmX64IoApicInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjIntrSourceOverrideInfo,CmX64IntrSourceOverrideInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjLocalApicX2ApicNmiInfo,CmX64LocalApicNmiInfo),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFacsInfo, CmX64ObjFacsInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtSciInterrupt, CmX64ObjFadtSciInterruptParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtSciCmdInfo, CmX64ObjFadtSciCmdInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtPmBlockInfo, CmX64ObjFadtPmBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtGpeBlockInfo, CmX64ObjFadtGpeBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtXpmBlockInfo, CmX64ObjFadtXpmBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtXgpeBlockInfo, CmX64ObjFadtXgpeBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtSleepBlockInfo, CmX64ObjFadtSleepBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtResetBlockInfo, CmX64ObjFadtResetBlockInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFadtMiscInfo, CmX64ObjFadtMiscInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjWsmtFlagsInfo, CmX64ObjWsmtFlagsInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjHpetInfo, CmX64ObjHpetInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjMadtInfo, CmX64ObjMadtInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjLocalApicX2ApicInfo, CmX64ObjLocalApicX2ApicInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjIoApicInfo, CmX64IoApicInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjIntrSourceOverrideInfo, CmX64IntrSourceOverrideInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjLocalApicX2ApicNmiInfo, CmX64LocalApicNmiInfo),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjFacsInfo, CmX64ObjFacsInfoParser),
|
||||
CM_PARSER_ADD_OBJECT (EX64ObjLocalApicX2ApicAffinityInfo,CmX64LocalApicX2ApicAffinityInfo),
|
||||
CM_PARSER_ADD_OBJECT_RESERVED (EX64ObjMax)
|
||||
};
|
||||
|
||||
|
@ -525,4 +525,5 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
|
||||
| 15 | Interrupt Source Override info | |
|
||||
| 16 | Local APIC and X2APIC NMI info | |
|
||||
| 17 | FACS Information | |
|
||||
| 18 | Local APIC and X2APIC Affinity info | |
|
||||
| `*` | All other values are reserved. | |
|
||||
|
Loading…
x
Reference in New Issue
Block a user