TianoCore EDK2 master
|
#include <IndustryStandard/Mpam.h>
#include <Library/PrintLib.h>
#include <Library/UefiLib.h>
#include "AcpiParser.h"
#include "AcpiView.h"
#include "AcpiViewConfig.h"
Go to the source code of this file.
Functions | |
STATIC VOID EFIAPI | MpamLengthError (IN CONST CHAR16 *ErrorMsg) |
STATIC VOID EFIAPI | ValidateReserved (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | ValidateReservedBits (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | ValidateMmioSize (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | DecodeLinkType (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | DecodeHardwareId (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | DecodeInterfaceType (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | DecodeInterruptMode (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | DecodeInterruptType (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | DecodeInterruptAffinityValid (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | DecodeInterruptAffinityType (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | DecodeLocatorType (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context) |
STATIC VOID EFIAPI | DumpMpamMscInterruptFlags (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
STATIC VOID EFIAPI | ParseLocator (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
STATIC VOID EFIAPI | PrintBlockTitle (IN UINT32 Indent, IN CONST CHAR16 *Title, IN CONST UINT32 Index) |
STATIC EFI_STATUS EFIAPI | ParseInterconnectDescriptors (IN UINT8 *CONST Ptr, IN CONST UINT32 AcpiTableLength, IN OUT UINT32 *CONST Offset) |
STATIC EFI_STATUS EFIAPI | ParseInterconnectDescriptorTable (IN UINT8 *CONST Ptr, IN CONST UINT32 AcpiTableLength, IN UINT32 Offset, IN CONST UINT64 InterconnectOffset) |
STATIC EFI_STATUS EFIAPI | ParseMpamMscFunctionalDependencies (IN UINT8 *CONST Ptr, IN CONST UINT32 AcpiTableLength, IN OUT UINT32 *CONST Offset) |
STATIC EFI_STATUS EFIAPI | ParseMpamMscResources (IN UINT8 *CONST Ptr, IN CONST UINT32 AcpiTableLength, IN UINT32 Offset) |
STATIC EFI_STATUS EFIAPI | ParseMpamMscNodes (IN UINT8 *CONST Ptr, IN CONST UINT32 AcpiTableLength, IN OUT UINT32 *CONST Offset) |
VOID EFIAPI | ParseAcpiMpam (IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision) |
MPAM table parser
Copyright (c) 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file MpamParser.c.
This function decodes the hardware ID field present within MPAM ACPI table. The specification states that the hardware ID has to be set to zero if not being used.
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this function, context is ignored. |
Definition at line 219 of file MpamParser.c.
This function decodes and validates the interface type for MPAM. Valid interfaces are of MMIO and PCC type.
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this function, context is ignored. |
Definition at line 248 of file MpamParser.c.
STATIC VOID EFIAPI DecodeInterruptAffinityType | ( | IN UINT8 * | Ptr, |
IN UINT32 | Length, | ||
IN VOID * | Context | ||
) |
This function decodes the interrupt affinity type flag for MPAM. Interrupt affinity type could either be "Processor affinity" or "Processor container affinity"
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this function, context holds the parent/double pointer to a variable holding the interrupt gsiv. Make sure to call the function accordingly. |
Definition at line 380 of file MpamParser.c.
STATIC VOID EFIAPI DecodeInterruptAffinityValid | ( | IN UINT8 * | Ptr, |
IN UINT32 | Length, | ||
IN VOID * | Context | ||
) |
This function decodes the interrupt affinity valid flag for MPAM. Interrupt affinity could be either be valid or not.
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this function, context holds the parent/double pointer to a variable holding the interrupt gsiv. Make sure to call the function accordingly. |
Definition at line 348 of file MpamParser.c.
This function decodes the interrupt mode flag for MPAM. Interrupt mode could either be "edge triggered" or "level triggered".
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this function, context holds the parent/double pointer to a variable holding the interrupt gsiv. Make sure to call the function accordingly. |
Definition at line 285 of file MpamParser.c.
This function decodes the interrupt type flag for MPAM. Interrupt type could be "wired interrupt". Other values are reserved at this point.
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this function, context holds the parent/double pointer to a variable holding the interrupt gsiv. Make sure to call the function accordingly. |
Definition at line 316 of file MpamParser.c.
This function decodes and validates the link type for MPAM's interconnect descriptor. Valid links are of NUMA and PROC type.
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this function, context is ignored. |
Definition at line 179 of file MpamParser.c.
This function decodes the locator type for a particular MPAM MSC resource.
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this function, context holds the parent/double pointer to a variable holding the interrupt gsiv. Make sure to call the function accordingly. |
Definition at line 410 of file MpamParser.c.
STATIC VOID EFIAPI DumpMpamMscInterruptFlags | ( | IN CONST CHAR16 *Format | OPTIONAL, |
IN UINT8 * | Ptr, | ||
IN UINT32 | Length | ||
) |
This function traces MPAM MSC Interrupt Flags. If no format string is specified the Format must be NULL.
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field. |
Definition at line 456 of file MpamParser.c.
When the length of the table is insufficient to be parsed, this function could be used to display an appropriate error message.
[in] | ErrorMsg | Error message string that has to be appended to the main error log. This string could explain the reason why a insufficient length error was encountered in the first place. |
Definition at line 60 of file MpamParser.c.
VOID EFIAPI ParseAcpiMpam | ( | IN BOOLEAN | Trace, |
IN UINT8 * | Ptr, | ||
IN UINT32 | AcpiTableLength, | ||
IN UINT8 | AcpiTableRevision | ||
) |
This function parses the MPAM ACPI table's generic header. It also invokes a sub routine that would help with parsing rest of the table.
[in] | Trace | If TRUE, trace the ACPI fields. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | AcpiTableLength | Length of the ACPI table. |
[in] | AcpiTableRevision | Revision of the ACPI table. |
Definition at line 1197 of file MpamParser.c.
STATIC EFI_STATUS EFIAPI ParseInterconnectDescriptors | ( | IN UINT8 *CONST | Ptr, |
IN CONST UINT32 | AcpiTableLength, | ||
IN OUT UINT32 *CONST | Offset | ||
) |
This function parses the interconnect descriptor(s) associated with an interconnect type locator object.
[in] | Ptr | Pointer to the start of the buffer. |
[in] | AcpiTableLength | Length of the ACPI table. |
[in,out] | Offset | Pointer to current offset within Ptr. |
Returns:
Status
EFI_SUCCESS MPAM MSC nodes were parsed properly. EFI_BAD_BUFFER_SIZE The buffer pointer provided as input is not long enough to be parsed correctly.
Definition at line 796 of file MpamParser.c.
STATIC EFI_STATUS EFIAPI ParseInterconnectDescriptorTable | ( | IN UINT8 *CONST | Ptr, |
IN CONST UINT32 | AcpiTableLength, | ||
IN UINT32 | Offset, | ||
IN CONST UINT64 | InterconnectOffset | ||
) |
This function parses the interconnect descriptor table associated with an interconnect type locator object. It also performs necessary validation to make sure the interconnect descriptor is at a valid location.
[in] | Ptr | Pointer to the start of the buffer. |
[in] | AcpiTableLength | Length of the ACPI table. |
[in] | Offset | Pointer to current offset within Ptr. |
[in] | InterconnectOffset | Offset to the interconnect descriptor table. |
Returns:
Status
EFI_SUCCESS MPAM MSC nodes were parsed properly. EFI_BAD_BUFFER_SIZE The buffer pointer provided as input is not long enough to be parsed correctly. EFI_INVALID_PARAMETER The Offset parameter encoded within the Ptr buffer is not valid.
Definition at line 857 of file MpamParser.c.
STATIC VOID EFIAPI ParseLocator | ( | IN CONST CHAR16 *Format | OPTIONAL, |
IN UINT8 * | Ptr, | ||
IN UINT32 | Length | ||
) |
This function parses the locator field within the resource node for ACPI MPAM table. The parsing is based on the locator type field.
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field. |
Definition at line 549 of file MpamParser.c.
STATIC EFI_STATUS EFIAPI ParseMpamMscFunctionalDependencies | ( | IN UINT8 *CONST | Ptr, |
IN CONST UINT32 | AcpiTableLength, | ||
IN OUT UINT32 *CONST | Offset | ||
) |
This function parses all the MPAM functional dependency nodes within a single resource node.
[in] | Ptr | Pointer to the start of the buffer. |
[in] | AcpiTableLength | Length of the ACPI table. |
[in,out] | Offset | Pointer to current offset within Ptr. |
Returns:
Status
EFI_SUCCESS MPAM MSC nodes were parsed properly. EFI_BAD_BUFFER_SIZE The buffer pointer provided as input is not long enough to be parsed correctly.
Definition at line 936 of file MpamParser.c.
STATIC EFI_STATUS EFIAPI ParseMpamMscNodes | ( | IN UINT8 *CONST | Ptr, |
IN CONST UINT32 | AcpiTableLength, | ||
IN OUT UINT32 *CONST | Offset | ||
) |
This function parses all the MPAM MSC nodes within the MPAM ACPI table. It also invokes a helper function to detect and parse resource nodes that maybe present.
[in] | Ptr | Pointer to the start of the buffer. |
[in] | AcpiTableLength | Length of the ACPI table. |
[in,out] | Offset | Pointer to the current offset within Ptr. |
Returns:
Status
EFI_SUCCESS MPAM MSC nodes were parsed properly. EFI_BAD_BUFFER_SIZE The buffer pointer provided as input is not long enough to be parsed correctly.
Definition at line 1136 of file MpamParser.c.
STATIC EFI_STATUS EFIAPI ParseMpamMscResources | ( | IN UINT8 *CONST | Ptr, |
IN CONST UINT32 | AcpiTableLength, | ||
IN UINT32 | Offset | ||
) |
This function parses all the MPAM resource nodes within a single MSC node within the MPAM ACPI table. It also invokes helper functions to validate and parse locators and functional dependency descriptors.
[in] | Ptr | Pointer to the start of the buffer. |
[in] | AcpiTableLength | Length of the ACPI table. |
[in] | Offset | Pointer to current offset within Ptr. |
Returns:
Status
EFI_SUCCESS MPAM MSC nodes were parsed properly. EFI_BAD_BUFFER_SIZE The buffer pointer provided as input is not long enough to be parsed correctly.
Definition at line 994 of file MpamParser.c.
STATIC VOID EFIAPI PrintBlockTitle | ( | IN UINT32 | Indent, |
IN CONST CHAR16 * | Title, | ||
IN CONST UINT32 | Index | ||
) |
PrintBlockTitle could be used to print the title of blocks that appear more than once in the MPAM ACPI table.
[in] | Indent | Number of spaces to add to the global table indent. The global table indent is 0 by default; however this value is updated on entry to the ParseAcpi() by adding the indent value provided to ParseAcpi() and restored back on exit. Therefore the total indent in the output is dependent on from where this function is called. |
[in] | Title | Title string to be used for the block. |
[in] | Index | Index of the block. |
Definition at line 766 of file MpamParser.c.
This function validates the MMIO size within the MSC node body for MPAM ACPI table. MPAM ACPI specification states that the MMIO size for an MSC having PCC type interface should be zero.
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this function, context holds the parent/double pointer to a variable holding the interface type. Make sure to call the function accordingly. |
Definition at line 143 of file MpamParser.c.
This function validates reserved fields. Any reserved field within the MPAM specification must be 0.
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this particular function, context holds the size of the reserved field that needs to be validated. |
Definition at line 86 of file MpamParser.c.
This function validates bit-length reserved fields. Any reserved field within the MPAM specification must be 0.
[in] | Ptr | Pointer to the start of the field data. |
[in] | Length | Length of the field. |
[in] | Context | Pointer to context specific information. For this particular function, context holds the size of the reserved field that needs to be validated. |
Definition at line 116 of file MpamParser.c.
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo |
Definition at line 35 of file MpamParser.c.
Definition at line 34 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamInterconnectDescriptorParser[] |
ACPI_PARSER array describing the interconnect descriptor associated with the interconnect locator type.
Definition at line 739 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamInterconnectDescriptorTableParser[] |
ACPI_PARSER array describing the interconnect descriptor table associated with the interconnect locator type.
Definition at line 728 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamMscAcpiDeviceLocatorParser[] |
ACPI_PARSER array describing the MPAM MSC ACPI device locator field.
Definition at line 514 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamMscFunctionalDependencyParser[] |
ACPI_PARSER array describing the MPAM MSC resource's functional dependencies.
Definition at line 718 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamMscGenericLocatorParser[] |
STATIC CONST ACPI_PARSER MpamMscInterconnectLocatorParser[] |
ACPI_PARSER array describing the MPAM MSC interconnect locator field.
Definition at line 523 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamMscInterruptFlagParser[] |
ACPI_PARSER array describing MPAM MSC interrupt flags.
Definition at line 432 of file MpamParser.c.
Definition at line 39 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamMscMemoryCacheLocatorParser[] |
ACPI_PARSER array describing the MPAM MSC memory cache locator field.
Definition at line 504 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamMscMemoryLocatorParser[] |
ACPI_PARSER array describing the MPAM MSC memory locator field.
Definition at line 486 of file MpamParser.c.
Definition at line 30 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamMscNodeParser[] |
ACPI_PARSER array describing the MPAM MSC node object.
Definition at line 654 of file MpamParser.c.
STATIC UINT32 MpamMscNodeStart |
Definition at line 29 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamMscProcessorCacheLocatorParser[] |
ACPI_PARSER array describing the MPAM MSC processor cache locator field.
Definition at line 477 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamMscResourceParser[] |
ACPI_PARSER array describing the MPAM MSC resource.
Definition at line 699 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamMscSMMULocatorParser[] |
ACPI_PARSER array describing the MPAM MSC SMMU locator field.
Definition at line 495 of file MpamParser.c.
STATIC CONST ACPI_PARSER MpamParser[] |
ACPI_PARSER array describing the Generic ACPI MPAM table header.
Definition at line 647 of file MpamParser.c.
Definition at line 27 of file MpamParser.c.
Definition at line 32 of file MpamParser.c.
Definition at line 33 of file MpamParser.c.
Definition at line 31 of file MpamParser.c.
Definition at line 28 of file MpamParser.c.