From 967cbd87b7a1ebf01c12627f6099e785099bf85c Mon Sep 17 00:00:00 2001 From: Abdul Lateef Attar Date: Wed, 31 Jul 2024 10:51:52 +0000 Subject: DynamicTablesPkg: Adds X64 namespace object REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4781 Adds empty X64 namespace object for future use. Cc: Sami Mujawar Cc: Pierre Gondois Signed-off-by: Abdul Lateef Attar --- .../Include/ConfigurationManagerObject.h | 15 +++++++++++++ DynamicTablesPkg/Include/X64NameSpaceObjects.h | 26 ++++++++++++++++++++++ .../ConfigurationManagerObjectParser.c | 24 ++++++++++++++++++++ DynamicTablesPkg/Readme.md | 7 ++++++ 4 files changed, 72 insertions(+) create mode 100644 DynamicTablesPkg/Include/X64NameSpaceObjects.h (limited to 'DynamicTablesPkg') diff --git a/DynamicTablesPkg/Include/ConfigurationManagerObject.h b/DynamicTablesPkg/Include/ConfigurationManagerObject.h index dd730ca677..26605229d3 100644 --- a/DynamicTablesPkg/Include/ConfigurationManagerObject.h +++ b/DynamicTablesPkg/Include/ConfigurationManagerObject.h @@ -1,12 +1,14 @@ /** @file Copyright (c) 2017 - 2024, Arm Limited. All rights reserved. + Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @par Glossary: - Cm or CM - Configuration Manager - Obj or OBJ - Object + - X64 or x64 - X64 Architecture **/ #ifndef CONFIGURATION_MANAGER_OBJECT_H_ @@ -15,6 +17,7 @@ #include #include #include +#include #pragma pack(1) @@ -32,6 +35,7 @@ Bits: [31:28] - Name Space ID 0000 - Standard 0001 - Arch Common 0010 - ARM + 0011 - X64 1111 - Custom/OEM All other values are reserved. @@ -83,6 +87,7 @@ typedef enum ObjectNameSpaceID { EObjNameSpaceStandard, ///< Standard Objects Namespace EObjNameSpaceArchCommon, ///< Arch Common Objects Namespace EObjNameSpaceArm, ///< ARM Objects Namespace + EObjNameSpaceX64, ///< X64 Objects Namespace EObjNameSpaceOem = 0xF, ///< OEM Objects Namespace EObjNameSpaceMax, } EOBJECT_NAMESPACE_ID; @@ -178,4 +183,14 @@ typedef struct CmObjDescriptor { #define CREATE_CM_OEM_OBJECT_ID(ObjectId) \ (CREATE_CM_OBJECT_ID (EObjNameSpaceOem, ObjectId)) +/** This macro returns a Configuration Manager Object ID + in the X64 Object Namespace. + + @param [in] ObjectId The Object ID. + + @retval Returns X64 Configuration Manager Object ID. +**/ +#define CREATE_CM_X64_OBJECT_ID(ObjectId) \ + (CREATE_CM_OBJECT_ID (EObjNameSpaceX64, ObjectId)) + #endif // CONFIGURATION_MANAGER_OBJECT_H_ diff --git a/DynamicTablesPkg/Include/X64NameSpaceObjects.h b/DynamicTablesPkg/Include/X64NameSpaceObjects.h new file mode 100644 index 0000000000..f9f131e822 --- /dev/null +++ b/DynamicTablesPkg/Include/X64NameSpaceObjects.h @@ -0,0 +1,26 @@ +/** @file + + Defines the X64 Namespace Object. + + Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Glossary: + - Cm or CM - Configuration Manager + - Obj or OBJ - Object + - X64 or x64 - X64 Architecture +**/ + +#ifndef X64_NAMESPACE_OBJECTS_H_ +#define X64_NAMESPACE_OBJECTS_H_ + +/** The EX64_OBJECT_ID enum describes the Object IDs + in the X64 Namespace +*/ +typedef enum X64ObjectID { + EX64ObjReserved, ///< 0 - Reserved + EX64ObjMax +} EX64_OBJECT_ID; + +#endif // X64_NAMESPACE_OBJECTS_H_ diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c index e726b2c616..ccd681fb91 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c @@ -2,6 +2,7 @@ Configuration Manager Object parser. Copyright (c) 2021 - 2023, ARM Limited. All rights reserved.
+ Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -729,6 +730,13 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = { CM_PARSER_ADD_OBJECT_RESERVED (EArmObjMax) }; +/** A parser for X64 namespace objects. +*/ +STATIC CONST CM_OBJ_PARSER_ARRAY X64NamespaceObjectParser[] = { + CM_PARSER_ADD_OBJECT_RESERVED (EX64ObjReserved), + CM_PARSER_ADD_OBJECT_RESERVED (EX64ObjMax) +}; + /** A parser for EStdObjCfgMgrInfo. */ STATIC CONST CM_OBJ_PARSER StdObjCfgMgrInfoParser[] = { @@ -1070,6 +1078,22 @@ ParseCmObjDesc ( ParserArray = &ArchCommonNamespaceObjectParser[ObjId]; break; + + case EObjNameSpaceX64: + if (ObjId >= EX64ObjMax) { + ASSERT (0); + return; + } + + if (ObjId >= ARRAY_SIZE (X64NamespaceObjectParser)) { + DEBUG ((DEBUG_ERROR, "ObjId 0x%x is missing from the X64NamespaceObjectParser array\n", ObjId)); + ASSERT (0); + return; + } + + ParserArray = &X64NamespaceObjectParser[ObjId]; + break; + default: // Not supported DEBUG ((DEBUG_ERROR, "NameSpaceId 0x%x, ObjId 0x%x is not supported by the parser\n", NameSpaceId, ObjId)); diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md index 7790b14636..eebde70046 100644 --- a/DynamicTablesPkg/Readme.md +++ b/DynamicTablesPkg/Readme.md @@ -421,6 +421,7 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager | 0000b | Standard | | | 0001b | Arch Common | | | 0010b | ARM | | +| 0011b | X64 | | | 1111b | Custom/OEM | | | `*` | All other values are reserved. | | @@ -498,3 +499,9 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager | 25 | P-State Dependency (PSD) Info | | | `*` | All other values are reserved. | | +#### Object ID's in the X64 Namespace: + +| ID | Description | Comments | +| ---: | :-------------------------- | :--- | +| 0 | Reserved | | +| `*` | All other values are reserved. | | -- cgit