Skip to content

Commit 2b3ea93

Browse files
Abdul Lateef Attarmergify[bot]
Abdul Lateef Attar
authored andcommitted
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 <[email protected]> Cc: Pierre Gondois <[email protected]> Signed-off-by: Abdul Lateef Attar <[email protected]>
1 parent 1f1182c commit 2b3ea93

File tree

9 files changed

+307
-119
lines changed

9 files changed

+307
-119
lines changed

DynamicTablesPkg/DynamicTables.dsc.inc

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
# Generators
7272
# Common
7373
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
74+
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
7475
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSpmiLib/AcpiSpmiLib.inf
7576
# X64 specific
7677
NULL|DynamicTablesPkg/Library/Acpi/X64/AcpiFacsLib/AcpiFacsLib.inf

DynamicTablesPkg/DynamicTablesPkg.ci.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# CI configuration for DynamicTablesPkg
33
#
44
# Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
5-
# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
5+
# Copyright (C) 2024 - 2025 Advanced Micro Devices, Inc. All rights reserved.<BR>
66
# SPDX-License-Identifier: BSD-2-Clause-Patent
77
##
88
{
@@ -123,6 +123,7 @@
123123
"Rdword",
124124
"Roadmap",
125125
"ROOTNODEBASE",
126+
"sapic",
126127
"ssdtcmn",
127128
"ssdtserialporttemplate",
128129
"SMMUV",

DynamicTablesPkg/Include/X64NameSpaceObjects.h

+33-19
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,26 @@ typedef enum {
3333
in the X64 Namespace
3434
*/
3535
typedef enum X64ObjectID {
36-
EX64ObjReserved, ///< 0 - Reserved
37-
EX64ObjFadtSciInterrupt, ///< 1 - FADT SCI Interrupt information
38-
EX64ObjFadtSciCmdInfo, ///< 2 - FADT SCI CMD information
39-
EX64ObjFadtPmBlockInfo, ///< 3 - FADT Power management block info
40-
EX64ObjFadtGpeBlockInfo, ///< 4 - FADT GPE block info
41-
EX64ObjFadtXpmBlockInfo, ///< 5 - FADT 64-bit Power Management block info
42-
EX64ObjFadtXgpeBlockInfo, ///< 6 - FADT 64-bit GPE block info
43-
EX64ObjFadtSleepBlockInfo, ///< 7 - FADT Sleep block info
44-
EX64ObjFadtResetBlockInfo, ///< 8 - FADT Reset block info
45-
EX64ObjFadtMiscInfo, ///< 9 - FADT Legacy fields info
46-
EX64ObjWsmtFlagsInfo, ///< 10 - WSMT protection flags info
47-
EX64ObjHpetInfo, ///< 11 - HPET device info
48-
EX64ObjMadtInfo, ///< 12 - MADT info
49-
EX64ObjLocalApicX2ApicInfo, ///< 13 - Local APIC and X2APIC info
50-
EX64ObjIoApicInfo, ///< 14 - IO APIC info
51-
EX64ObjIntrSourceOverrideInfo, ///< 15 - Interrupt Source Override info
52-
EX64ObjLocalApicX2ApicNmiInfo, ///< 16 - Local APIC and X2APIC NMI info
53-
EX64ObjFacsInfo, ///< 17 - FACS info
54-
EX64ObjMax ///< 18 - Maximum Object ID
36+
EX64ObjReserved, ///< 0 - Reserved
37+
EX64ObjFadtSciInterrupt, ///< 1 - FADT SCI Interrupt information
38+
EX64ObjFadtSciCmdInfo, ///< 2 - FADT SCI CMD information
39+
EX64ObjFadtPmBlockInfo, ///< 3 - FADT Power management block info
40+
EX64ObjFadtGpeBlockInfo, ///< 4 - FADT GPE block info
41+
EX64ObjFadtXpmBlockInfo, ///< 5 - FADT 64-bit Power Management block info
42+
EX64ObjFadtXgpeBlockInfo, ///< 6 - FADT 64-bit GPE block info
43+
EX64ObjFadtSleepBlockInfo, ///< 7 - FADT Sleep block info
44+
EX64ObjFadtResetBlockInfo, ///< 8 - FADT Reset block info
45+
EX64ObjFadtMiscInfo, ///< 9 - FADT Legacy fields info
46+
EX64ObjWsmtFlagsInfo, ///< 10 - WSMT protection flags info
47+
EX64ObjHpetInfo, ///< 11 - HPET device info
48+
EX64ObjMadtInfo, ///< 12 - MADT info
49+
EX64ObjLocalApicX2ApicInfo, ///< 13 - Local APIC and X2APIC info
50+
EX64ObjIoApicInfo, ///< 14 - IO APIC info
51+
EX64ObjIntrSourceOverrideInfo, ///< 15 - Interrupt Source Override info
52+
EX64ObjLocalApicX2ApicNmiInfo, ///< 16 - Local APIC and X2APIC NMI info
53+
EX64ObjFacsInfo, ///< 17 - FACS info
54+
EX64ObjLocalApicX2ApicAffinityInfo, ///< 18 - Local APIC and X2APIC Affinity info
55+
EX64ObjMax ///< 19 - Maximum Object ID
5556
} EX64_OBJECT_ID;
5657

5758
/** A structure that describes the
@@ -278,5 +279,18 @@ typedef struct CmX64FacsInfo {
278279
UINT32 OspmFlags;
279280
} CM_X64_FACS_INFO;
280281

282+
/**
283+
A structure that describes the Local APIC and X2APIC Affinity information.
284+
285+
ID: EX64ObjLocalApicX2ApicAffinityInfo
286+
*/
287+
typedef struct CmX64LocalApicX2ApicAffinityInfo {
288+
LOCAL_APIC_MODE ApicMode;
289+
UINT32 ApicId;
290+
UINT32 ProximityDomain;
291+
UINT32 Flags;
292+
UINT32 ClockDomain;
293+
} CM_X64_LOCAL_APIC_X2APIC_AFFINITY_INFO;
294+
281295
#pragma pack()
282296
#endif // X64_NAMESPACE_OBJECTS_H_

DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SRAT Table Generator
33
#
44
# Copyright (c) 2019, ARM Limited. All rights reserved.
5+
# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
56
#
67
# SPDX-License-Identifier: BSD-2-Clause-Patent
78
##
@@ -24,7 +25,7 @@
2425
Arm/ArmSratGenerator.c
2526

2627
[Sources.IA32, Sources.X64]
27-
SratGeneratorNull.c
28+
X64/X64SratGenerator.c
2829

2930
[Packages]
3031
EmbeddedPkg/EmbeddedPkg.dec

DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
SRAT Table Generator
33
44
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.
5+
Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
6+
57
SPDX-License-Identifier: BSD-2-Clause-Patent
68
79
@par Reference(s):
@@ -140,9 +142,9 @@ AddMemoryAffinity (
140142
MemAff->ProximityDomain = MemAffInfo->ProximityDomain;
141143
MemAff->Reserved1 = EFI_ACPI_RESERVED_WORD;
142144
MemAff->AddressBaseLow = (UINT32)(MemAffInfo->BaseAddress & MAX_UINT32);
143-
MemAff->AddressBaseHigh = (UINT32)(MemAffInfo->BaseAddress >> 32);
145+
MemAff->AddressBaseHigh = (UINT32)RShiftU64 (MemAffInfo->BaseAddress, 32);
144146
MemAff->LengthLow = (UINT32)(MemAffInfo->Length & MAX_UINT32);
145-
MemAff->LengthHigh = (UINT32)(MemAffInfo->Length >> 32);
147+
MemAff->LengthHigh = (UINT32)RShiftU64 (MemAffInfo->Length, 32);
146148
MemAff->Reserved2 = EFI_ACPI_RESERVED_DWORD;
147149
MemAff->Flags = MemAffInfo->Flags;
148150
MemAff->Reserved3 = EFI_ACPI_RESERVED_QWORD;

DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGeneratorNull.c

-79
This file was deleted.

0 commit comments

Comments
 (0)