TianoCore EDK2 master
Loading...
Searching...
No Matches
HmatParser.c File Reference
#include <Library/PrintLib.h>
#include <Library/BaseLib.h>
#include <Library/UefiLib.h>
#include "AcpiParser.h"
#include "AcpiView.h"

Go to the source code of this file.

Macros

#define MAX_MEMORY_DOMAIN_TARGET_PRINT_MATRIX   10
 

Functions

STATIC VOID EFIAPI ValidateCacheAttributes (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI DumpCacheAttributes (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
 
STATIC VOID DumpMpda (IN UINT8 *Ptr, IN UINT32 Length)
 
STATIC VOID DumpSllbi (IN UINT8 *Ptr, IN UINT32 Length)
 
STATIC VOID DumpMsci (IN UINT8 *Ptr, IN UINT32 Length)
 
VOID EFIAPI ParseAcpiHmat (IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
 

Variables

STATIC CONST UINT16 * HmatStructureType
 
STATIC CONST UINT32 * HmatStructureLength
 
STATIC CONST UINT32 * NumberInitiatorProximityDomain
 
STATIC CONST UINT32 * NumberTargetProximityDomain
 
STATIC CONST EFI_ACPI_6_4_HMAT_STRUCTURE_SYSTEM_LOCALITY_LATENCY_AND_BANDWIDTH_INFO_FLAGSSllbiFlags
 
STATIC CONST UINT8 * SllbiDataType
 
STATIC CONST UINT16 * NumberSMBIOSHandles
 
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo
 
STATIC CONST CHAR16 * SllbiNames []
 
STATIC CONST ACPI_PARSER HmatParser []
 
STATIC CONST ACPI_PARSER HmatStructureHeaderParser []
 
STATIC CONST ACPI_PARSER MemProximityDomainAttributeParser []
 
STATIC CONST ACPI_PARSER SllbiParser []
 
STATIC CONST ACPI_PARSER MemSideCacheInfoParser []
 

Detailed Description

HMAT table parser

Copyright (c) 2020 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Reference(s):
  • ACPI 6.3 Specification - January 2019
Glossary:
  • MPDA - Memory Proximity Domain Attributes
  • SLLBI - System Locality Latency and Bandwidth Information
  • MSCI - Memory Side Cache Information
  • Dom - Domain

Definition in file HmatParser.c.

Macro Definition Documentation

◆ MAX_MEMORY_DOMAIN_TARGET_PRINT_MATRIX

#define MAX_MEMORY_DOMAIN_TARGET_PRINT_MATRIX   10

Definition at line 24 of file HmatParser.c.

Function Documentation

◆ DumpCacheAttributes()

STATIC VOID EFIAPI DumpCacheAttributes ( IN CONST CHAR16 *Format  OPTIONAL,
IN UINT8 *  Ptr,
IN UINT32  Length 
)

Dumps the cache attributes field

Parameters
[in]FormatOptional format string for tracing the data.
[in]PtrPointer to the start of the buffer.
[in]LengthLength of the field.

Definition at line 119 of file HmatParser.c.

◆ DumpMpda()

STATIC VOID DumpMpda ( IN UINT8 *  Ptr,
IN UINT32  Length 
)

This function parses the Memory Proximity Domain Attributes Structure (Type 0).

Parameters
[in]PtrPointer to the start of the Memory Proximity Domain Attributes Structure data.
[in]LengthLength of the Memory Proximity Domain Attributes Structure.

Definition at line 231 of file HmatParser.c.

◆ DumpMsci()

STATIC VOID DumpMsci ( IN UINT8 *  Ptr,
IN UINT32  Length 
)

This function parses the Memory Side Cache Information Structure (Type 2).

Parameters
[in]PtrPointer to the start of the Memory Side Cache Information Structure data.
[in]LengthLength of the Memory Side Cache Information Structure.

Definition at line 494 of file HmatParser.c.

◆ DumpSllbi()

STATIC VOID DumpSllbi ( IN UINT8 *  Ptr,
IN UINT32  Length 
)

This function parses the System Locality Latency and Bandwidth Information Structure (Type 1).

Parameters
[in]PtrPointer to the start of the System Locality Latency and Bandwidth Information Structure data.
[in]LengthLength of the System Locality Latency and Bandwidth Information Structure.

Definition at line 257 of file HmatParser.c.

◆ ParseAcpiHmat()

VOID EFIAPI ParseAcpiHmat ( IN BOOLEAN  Trace,
IN UINT8 *  Ptr,
IN UINT32  AcpiTableLength,
IN UINT8  AcpiTableRevision 
)

This function parses the ACPI HMAT table. When trace is enabled this function parses the HMAT table and traces the ACPI table fields.

This function parses the following HMAT structures:

  • Memory Proximity Domain Attributes Structure (Type 0)
  • System Locality Latency and Bandwidth Info Structure (Type 1)
  • Memory Side Cache Info structure (Type 2)

This function also performs validation of the ACPI table fields.

Parameters
[in]TraceIf TRUE, trace the ACPI fields.
[in]PtrPointer to the start of the buffer.
[in]AcpiTableLengthLength of the ACPI table.
[in]AcpiTableRevisionRevision of the ACPI table.

Definition at line 573 of file HmatParser.c.

◆ ValidateCacheAttributes()

STATIC VOID EFIAPI ValidateCacheAttributes ( IN UINT8 *  Ptr,
IN UINT32  Length,
IN VOID *  Context 
)

This function validates the Cache Attributes field.

Parameters
[in]PtrPointer to the start of the field data.
[in]LengthLength of the field.
[in]ContextPointer to context specific information e.g. this could be a pointer to the ACPI table header.

Definition at line 64 of file HmatParser.c.

Variable Documentation

◆ AcpiHdrInfo

Definition at line 39 of file HmatParser.c.

◆ HmatParser

STATIC CONST ACPI_PARSER HmatParser[]
Initial value:
= {
PARSE_ACPI_HEADER (&AcpiHdrInfo),
{ L"Reserved", 4,36, NULL, NULL, NULL, NULL, NULL }
}
#define PARSE_ACPI_HEADER(Info)
Definition: AcpiParser.h:501
#define NULL
Definition: Base.h:319

An ACPI_PARSER array describing the ACPI HMAT Table.

Definition at line 147 of file HmatParser.c.

◆ HmatStructureHeaderParser

STATIC CONST ACPI_PARSER HmatStructureHeaderParser[]
Initial value:
= {
{ L"Type", 2, 0, NULL, NULL, (VOID **)&HmatStructureType, NULL, NULL },
{ L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL },
{ L"Length", 4, 4, NULL, NULL, (VOID **)&HmatStructureLength, NULL, NULL }
}

An ACPI_PARSER array describing the HMAT structure header.

Definition at line 155 of file HmatParser.c.

◆ HmatStructureLength

STATIC CONST UINT32* HmatStructureLength

Definition at line 28 of file HmatParser.c.

◆ HmatStructureType

STATIC CONST UINT16* HmatStructureType

Definition at line 27 of file HmatParser.c.

◆ MemProximityDomainAttributeParser

STATIC CONST ACPI_PARSER MemProximityDomainAttributeParser[]
Initial value:
= {
{ L"Type", 2, 0, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL },
{ L"Flags", 2, 8, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 10, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Proximity Dom for initiator", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Proximity Dom for memory", 4, 16, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Reserved", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL }
}

An ACPI PARSER array describing the Memory Proximity Domain Attributes Structure - Type 0.

Definition at line 165 of file HmatParser.c.

◆ MemSideCacheInfoParser

STATIC CONST ACPI_PARSER MemSideCacheInfoParser[]
Initial value:
= {
{ L"Type", 2, 0, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL },
{ L"Proximity Dom for memory", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Memory Side Cache Size", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Cache Attributes", 4, 24, NULL, DumpCacheAttributes, NULL,
{ L"Reserved", 2, 28, L"0x%x", NULL, NULL, NULL, NULL },
{ L"SMBIOS Handle Count", 2, 30, L"%d", NULL,
(VOID **)&NumberSMBIOSHandles, NULL, NULL }
}
STATIC VOID EFIAPI ValidateCacheAttributes(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: HmatParser.c:64
STATIC VOID EFIAPI DumpCacheAttributes(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: HmatParser.c:119

An ACPI PARSER array describing the Memory Side Cache Information Structure - Type 2.

Definition at line 205 of file HmatParser.c.

◆ NumberInitiatorProximityDomain

STATIC CONST UINT32* NumberInitiatorProximityDomain

Definition at line 30 of file HmatParser.c.

◆ NumberSMBIOSHandles

STATIC CONST UINT16* NumberSMBIOSHandles

Definition at line 37 of file HmatParser.c.

◆ NumberTargetProximityDomain

STATIC CONST UINT32* NumberTargetProximityDomain

Definition at line 31 of file HmatParser.c.

◆ SllbiDataType

STATIC CONST UINT8* SllbiDataType

Definition at line 36 of file HmatParser.c.

◆ SllbiFlags

◆ SllbiNames

STATIC CONST CHAR16* SllbiNames[]
Initial value:
= {
L"Access %sLatency%s",
L"Read %sLatency%s",
L"Write %sLatency%s",
L"Access %sBandwidth%s",
L"Read %sBandwidth%s",
L"Write %sBandwidth%s"
}

Names of System Locality Latency Bandwidth Information (SLLBI) data types

Definition at line 44 of file HmatParser.c.

◆ SllbiParser

STATIC CONST ACPI_PARSER SllbiParser[]
Initial value:
= {
{ L"Type", 2, 0, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL },
{ L"Flags", 1, 8, L"0x%x", NULL, (VOID **)&SllbiFlags, NULL, NULL },
{ L"Data type", 1, 9, L"0x%x", NULL, (VOID **)&SllbiDataType, NULL, NULL },
{ L"Min Transfer Size", 1, 10, L"%d", NULL, NULL, NULL, NULL },
{ L"Reserved", 1, 11, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Initiator Proximity Dom Count", 4, 12, L"%d", NULL,
(VOID **)&NumberInitiatorProximityDomain, NULL, NULL },
{ L"Target Proximity Dom Count", 4, 16, L"%d", NULL,
(VOID **)&NumberTargetProximityDomain, NULL, NULL },
{ L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Entry Base Unit", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL }
}

An ACPI PARSER array describing the System Locality Latency and Bandwidth Information Structure - Type 1.

Definition at line 182 of file HmatParser.c.