DynamicTablesPkg: Add Additional Information CM objects

Add the Configuration Manager objects required to describe SMBIOS
Additional Information (Type 40) structures.

The top-level object references a list of Additional Information entries.
Each entry identifies a field in an existing SMBIOS structure and
references a typed value object containing the additional data.

Define the maximum value buffer size from the SMBIOS Type 40 formatted
length limit and add parsers for the new CM objects.

Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
This commit is contained in:
VarshitPandya 2026-07-21 17:41:36 +01:00 committed by mergify[bot]
parent 35345c76a9
commit 2bdb08ab00
2 changed files with 100 additions and 0 deletions

View file

@ -34,6 +34,23 @@
// Maximum interleave ways is defined in the CXL spec section 8.2.4.19.7.
#define CFMWS_MAX_INTERLEAVE_WAYS (16)
/**
Maximum number of Value bytes that can fit in a single-entry SMBIOS Type 40
formatted structure.
The SMBIOS formatted length is limited to MAX_UINT8. Five bytes are required
for the SMBIOS Type 40 header and NumberOfAdditionalInformationEntries, and
five bytes are required for the fixed portion of an Additional Information
Entry:
MAX_UINT8 - 5 - 5 = 245 bytes.
A Type 40 structure containing multiple entries may have a smaller effective
maximum per entry. The generator must therefore also validate the aggregate
formatted length.
**/
#define SMBIOS_MAX_ADDITIONAL_INFORMATION_VALUE_SIZE 245
/** The EARCH_COMMON_OBJECT_ID enum describes the Object IDs
in the Arch Common Namespace
*/
@ -107,6 +124,9 @@ typedef enum ArchCommonObjectID {
EArchCommonObjMemoryChannelDevice, ///< 65 - Memory Channel Device Info
EArchCommonObjProcessorSpecificBlockInfo, ///< 66 - Processor specific data Info
EArchCommonObjSystemInfo, ///< 67 - System Info
EArchCommonObjAdditionalInformation, ///< 68 - Additional Information
EArchCommonObjAdditionalInformationEntry, ///< 69 - Additional Information Entry
EArchCommonObjAdditionalInformationValue, ///< 70 - Additional Information Value
EArchCommonObjMax
} EARCH_COMMON_OBJECT_ID;
@ -1763,4 +1783,57 @@ typedef struct CmArchCommonSystemInfo {
CHAR8 Family[SMBIOS_MAX_STRING_SIZE];
} CM_ARCH_COMMON_SYSTEM_INFO;
/** A structure that describes SMBIOS Additional Information.
SMBIOS Specification v3.9.0 Type 40
ID: EArchCommonObjAdditionalInformation
**/
typedef struct CmArchCommonAdditionalInformation {
/// CM Object Token uniquely identifying this Additional Information structure.
CM_OBJECT_TOKEN AdditionalInformationToken;
/// Token referencing an array of Additional Information Entry structures.
CM_OBJECT_TOKEN AdditionalInformationEntryListToken;
} CM_ARCH_COMMON_ADDITIONAL_INFORMATION;
/** A structure that describes an Additional Information Entry.
SMBIOS Specification v3.9.0 Type 40
ID: EArchCommonObjAdditionalInformationEntry
**/
typedef struct CmArchCommonAdditionalInformationEntry {
/// CM Object Token of the SMBIOS structure referenced by this entry.
CM_OBJECT_TOKEN ReferencedObjectToken;
/// SMBIOS table generator ID for the referenced structure.
/// Allows to find the handle of the Smbios table to update.
UINT32 ReferencedTableGeneratorId;
/// Offset of the referenced field in the referenced SMBIOS structure.
UINT8 ReferencedOffset;
/// String describing the additional information entry.
/// Optional for SMBIOS spec. update already proposed.
CHAR8 EntryString[SMBIOS_MAX_STRING_SIZE];
/// Token referencing an Additional Information Value structure.
CM_OBJECT_TOKEN ValueToken;
} CM_ARCH_COMMON_ADDITIONAL_INFORMATION_ENTRY;
/** A structure that describes an Additional Information Value.
SMBIOS Specification v3.9.0 Type 40
ID: EArchCommonObjAdditionalInformationValue
**/
typedef struct CmArchCommonAdditionalInformationValue {
/// Number of valid bytes in the Value array.
UINT8 Len;
/// Additional Information Value bytes.
UINT8 Value[SMBIOS_MAX_ADDITIONAL_INFORMATION_VALUE_SIZE];
} CM_ARCH_COMMON_ADDITIONAL_INFORMATION_VALUE;
#pragma pack()

View file

@ -1248,6 +1248,30 @@ STATIC CONST CM_OBJ_PARSER CmArchCommonMemoryChannelInfoParser[] = {
{ "MemoryDeviceListToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
};
/** A parser for EArchCommonObjAdditionalInformation.
*/
STATIC CONST CM_OBJ_PARSER CmArchCommonAdditionalInformationParser[] = {
{ "AdditionalInformationToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "AdditionalInformationEntryListToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
};
/** A parser for EArchCommonObjAdditionalInformationEntry.
*/
STATIC CONST CM_OBJ_PARSER CmArchCommonAdditionalInformationEntryParser[] = {
{ "ReferencedObjectToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "ReferencedTableGeneratorId", sizeof (UINT32), "0x%x", NULL },
{ "ReferencedOffset", sizeof (UINT8), "0x%x", NULL },
{ "EntryString", SMBIOS_MAX_STRING_SIZE, NULL, PrintString },
{ "ValueToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
};
/** A parser for EArchCommonObjAdditionalInformationValue.
*/
STATIC CONST CM_OBJ_PARSER CmArchCommonAdditionalInformationValueParser[] = {
{ "Len", sizeof (UINT8), "0x%x", NULL },
{ "Value", SMBIOS_MAX_ADDITIONAL_INFORMATION_VALUE_SIZE, NULL, HexDump },
};
/** A parser for EArchCommonObjMemoryDeviceMappedAddress.
*/
STATIC CONST CM_OBJ_PARSER CmArchCommonMemoryDeviceMappedAddressParser[] = {
@ -1415,6 +1439,9 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArchCommonNamespaceObjectParser[] = {
CM_PARSER_ADD_OBJECT (EArchCommonObjMemoryChannelDevice, CmArchCommonMemoryChannelDeviceParser),
CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjProcessorSpecificBlockInfo),
CM_PARSER_ADD_OBJECT (EArchCommonObjSystemInfo, CmArchCommonSystemInfoParser),
CM_PARSER_ADD_OBJECT (EArchCommonObjAdditionalInformation, CmArchCommonAdditionalInformationParser),
CM_PARSER_ADD_OBJECT (EArchCommonObjAdditionalInformationEntry, CmArchCommonAdditionalInformationEntryParser),
CM_PARSER_ADD_OBJECT (EArchCommonObjAdditionalInformationValue, CmArchCommonAdditionalInformationValueParser),
CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
};