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

Go to the source code of this file.

Functions

STATIC VOID EFIAPI ValidateRangeLength4 (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateRangeLength8 (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidatePccMemoryIoGas (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidatePccGas (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidatePccDoorbellGas (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidatePccIntAckGas (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidatePccErrStatusGas (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidatePlatInterrupt (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID DumpPccSubspaceType0 (IN UINT8 *Ptr, IN UINT8 Length)
 
STATIC VOID DumpPccSubspaceType1 (IN UINT8 *Ptr, IN UINT8 Length)
 
STATIC VOID DumpPccSubspaceType2 (IN UINT8 *Ptr, IN UINT8 Length)
 
STATIC VOID DumpPccSubspaceType3 (IN UINT8 *Ptr, IN UINT8 Length)
 
STATIC VOID DumpPccSubspaceType4 (IN UINT8 *Ptr, IN UINT8 Length)
 
STATIC VOID DumpPccSubspaceType5 (IN UINT8 *Ptr, IN UINT8 Length)
 
VOID EFIAPI ParseAcpiPcct (IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
 

Variables

STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo
 
STATIC UINT32 * PccGlobalFlags
 
STATIC UINT8 * PccSubspaceLength
 
STATIC UINT8 * PccSubspaceType
 
STATIC UINT8 * ExtendedPccSubspaceInterruptFlags
 
STATIC CONST ACPI_PARSER PcctParser []
 
STATIC CONST ACPI_PARSER PccSubspaceHeaderParser []
 
STATIC CONST ACPI_PARSER PccSubspaceType0Parser []
 
STATIC CONST ACPI_PARSER PccSubspaceType1Parser []
 
STATIC CONST ACPI_PARSER PccSubspaceType2Parser []
 
STATIC CONST ACPI_PARSER PccSubspaceType3Parser []
 
STATIC CONST ACPI_PARSER PccSubspaceType5Parser []
 

Detailed Description

PCCT table parser

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

Reference(s):
  • ACPI 6.4 Specification - January 2021

Definition in file PcctParser.c.

Function Documentation

◆ DumpPccSubspaceType0()

STATIC VOID DumpPccSubspaceType0 ( IN UINT8 *  Ptr,
IN UINT8  Length 
)

This function parses the PCC Subspace type 0.

Parameters
[in]PtrPointer to the start of Subspace Structure.
[in]LengthLength of the Subspace Structure.

Definition at line 421 of file PcctParser.c.

◆ DumpPccSubspaceType1()

STATIC VOID DumpPccSubspaceType1 ( IN UINT8 *  Ptr,
IN UINT8  Length 
)

This function parses the PCC Subspace type 1.

Parameters
[in]PtrPointer to the start of the Subspace Structure.
[in]LengthLength of the Subspace Structure.

Definition at line 444 of file PcctParser.c.

◆ DumpPccSubspaceType2()

STATIC VOID DumpPccSubspaceType2 ( IN UINT8 *  Ptr,
IN UINT8  Length 
)

This function parses the PCC Subspace type 2.

Parameters
[in]PtrPointer to the start of the Subspace Structure.
[in]LengthLength of the Subspace Structure.

Definition at line 467 of file PcctParser.c.

◆ DumpPccSubspaceType3()

STATIC VOID DumpPccSubspaceType3 ( IN UINT8 *  Ptr,
IN UINT8  Length 
)

This function parses the PCC Subspace type 3.

Parameters
[in]PtrPointer to the start of the Subspace Structure.
[in]LengthLength of the Subspace Structure.

Definition at line 490 of file PcctParser.c.

◆ DumpPccSubspaceType4()

STATIC VOID DumpPccSubspaceType4 ( IN UINT8 *  Ptr,
IN UINT8  Length 
)

This function parses the PCC Subspace type 4.

Parameters
[in]PtrPointer to the start of the Subspace Structure.
[in]LengthLength of the Subspace Structure.

Definition at line 513 of file PcctParser.c.

◆ DumpPccSubspaceType5()

STATIC VOID DumpPccSubspaceType5 ( IN UINT8 *  Ptr,
IN UINT8  Length 
)

This function parses the PCC Subspace type 5.

Parameters
[in]PtrPointer to the start of the Subspace Structure.
[in]LengthLength of the Subspace Structure.

Definition at line 536 of file PcctParser.c.

◆ ParseAcpiPcct()

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

This function parses the ACPI PCCT table including its sub-structures of type 0 through 4. When trace is enabled this function parses the PCCT table and traces the ACPI table fields.

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 566 of file PcctParser.c.

◆ ValidatePccDoorbellGas()

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

This function validates doorbell address space for type 4 structure.

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 153 of file PcctParser.c.

◆ ValidatePccErrStatusGas()

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

This function validates error status address space for type 4 structure.

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 225 of file PcctParser.c.

◆ ValidatePccGas()

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

This function validates address space for structures of types other than 0.

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 123 of file PcctParser.c.

◆ ValidatePccIntAckGas()

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

This function validates interrupt acknowledge address space for type 4 structure.

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 186 of file PcctParser.c.

◆ ValidatePccMemoryIoGas()

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

This function validates address space for Memory/IO GAS.

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 94 of file PcctParser.c.

◆ ValidatePlatInterrupt()

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

This function validates platform interrupt flags for type 4 structure.

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 250 of file PcctParser.c.

◆ ValidateRangeLength4()

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

This function validates the length coded on 4 bytes of a shared memory range

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 38 of file PcctParser.c.

◆ ValidateRangeLength8()

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

This function validates the length coded on 8 bytes of a shared memory range

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 66 of file PcctParser.c.

Variable Documentation

◆ AcpiHdrInfo

Definition at line 20 of file PcctParser.c.

◆ ExtendedPccSubspaceInterruptFlags

STATIC UINT8* ExtendedPccSubspaceInterruptFlags

Definition at line 25 of file PcctParser.c.

◆ PccGlobalFlags

STATIC UINT32* PccGlobalFlags

Definition at line 22 of file PcctParser.c.

◆ PccSubspaceHeaderParser

STATIC CONST ACPI_PARSER PccSubspaceHeaderParser[]
Initial value:
= {
}

An ACPI_PARSER array describing the platform communications channel subspace structure header.

Definition at line 283 of file PcctParser.c.

◆ PccSubspaceLength

STATIC UINT8* PccSubspaceLength

Definition at line 23 of file PcctParser.c.

◆ PccSubspaceType

STATIC UINT8* PccSubspaceType

Definition at line 24 of file PcctParser.c.

◆ PccSubspaceType0Parser

STATIC CONST ACPI_PARSER PccSubspaceType0Parser[]
Initial value:
= {
{ L"Reserved", 6, 2, L"%x %x %x %x %x %x", Dump6Chars, NULL, NULL, NULL },
{ L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Memory Range Length",8, 16, L"0x%lx", NULL, NULL, ValidateRangeLength8,
NULL },
{ L"Doorbell Register",12, 24, NULL, DumpGas, NULL, ValidatePccMemoryIoGas,
NULL },
{ L"Doorbell Preserve",8, 36, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Doorbell Write", 8, 44, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Nominal Latency", 4, 52, L"%u", NULL, NULL, NULL, NULL },
{ L"Maximum Periodic Access Rate",4, 56, L"%u", NULL, NULL, NULL, NULL },
{ L"Minimum Request Turnaround Time",2, 60, L"%u", NULL, NULL, NULL, NULL }
}
VOID EFIAPI DumpGas(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: AcpiParser.c:867
VOID EFIAPI Dump6Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: AcpiParser.c:379
#define NULL
Definition: Base.h:319
STATIC VOID EFIAPI ValidatePccMemoryIoGas(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: PcctParser.c:94
STATIC VOID EFIAPI ValidateRangeLength8(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: PcctParser.c:66
#define PCC_SUBSPACE_HEADER()
Definition: PcctParser.h:29

An ACPI_PARSER array describing the Generic Communications Subspace - Type 0

Definition at line 291 of file PcctParser.c.

◆ PccSubspaceType1Parser

STATIC CONST ACPI_PARSER PccSubspaceType1Parser[]
Initial value:
= {
{ L"Platform Interrupt",4, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Platform Interrupt Flags",1, 6, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 1, 7, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Memory Range Length",8, 16, L"0x%lx", NULL, NULL, ValidateRangeLength8,
NULL },
{ L"Doorbell Register",12, 24, NULL, DumpGas, NULL,
{ L"Doorbell Preserve",8, 36, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Doorbell Write", 8, 44, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Nominal Latency", 4, 52, L"%u", NULL, NULL, NULL, NULL },
{ L"Maximum Periodic Access Rate",4, 56, L"%u", NULL, NULL, NULL, NULL },
{ L"Minimum Request Turnaround Time",2, 60, L"%u", NULL, NULL, NULL, NULL }
}
STATIC VOID EFIAPI ValidatePccGas(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: PcctParser.c:123

An ACPI_PARSER array describing the HW-Reduced Communications Subspace

  • Type 1

Definition at line 310 of file PcctParser.c.

◆ PccSubspaceType2Parser

STATIC CONST ACPI_PARSER PccSubspaceType2Parser[]
Initial value:
= {
{ L"Platform Interrupt",4, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Platform Interrupt Flags",1, 6, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 1, 7, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Memory Range Length",8, 16, L"0x%lx", NULL, NULL, ValidateRangeLength8,
NULL },
{ L"Doorbell Register",12, 24, NULL, DumpGas, NULL,
{ L"Doorbell Preserve",8, 36, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Doorbell Write", 8, 44, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Nominal Latency", 4, 52, L"%u", NULL, NULL, NULL, NULL },
{ L"Maximum Periodic Access Rate",4, 56, L"%u", NULL, NULL, NULL, NULL },
{ L"Minimum Request Turnaround Time",2, 60, L"%u", NULL, NULL, NULL, NULL },
{ L"Platform Interrupt Ack Register",12, 62, NULL, DumpGas, NULL,
{ L"Platform Interrupt Ack Preserve",8, 74, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Platform Interrupt Ack Write",8, 82, L"0x%lx", NULL, NULL,
NULL, NULL },
}

An ACPI_PARSER array describing the HW-Reduced Communications Subspace

  • Type 2

Definition at line 331 of file PcctParser.c.

◆ PccSubspaceType3Parser

STATIC CONST ACPI_PARSER PccSubspaceType3Parser[]

An ACPI_PARSER array describing the Extended PCC Subspaces - Type 3/4

Definition at line 356 of file PcctParser.c.

◆ PccSubspaceType5Parser

STATIC CONST ACPI_PARSER PccSubspaceType5Parser[]
Initial value:
= {
{ L"Version", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Base Address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Shared Memory Range Length",8, 12, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Doorbell Register", 12, 20, NULL, DumpGas, NULL,
{ L"Doorbell Preserve", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Doorbell Write", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Command Complete Check Register",12, 48, NULL, DumpGas, NULL,
{ L"Command Complete Check Mask",8, 60, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Error Status Register",12, 68, NULL, DumpGas, NULL,
{ L"Error Status Mask", 8, 80, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Nominal Latency", 4, 88, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Minimum Request Turnaround Time",4, 92, L"0x%x", NULL, NULL, NULL, NULL }
}

An ACPI_PARSER array describing the HW Registers based Communications Subspace Structure - Type 5

Definition at line 394 of file PcctParser.c.

◆ PcctParser

STATIC CONST ACPI_PARSER PcctParser[]
Initial value:
= {
PARSE_ACPI_HEADER (&AcpiHdrInfo),
{ L"Flags", 4, 36, NULL, NULL, (VOID **)&PccGlobalFlags, NULL, NULL },
{ L"Reserved", 8, 40, NULL, NULL, NULL, NULL, NULL }
}
#define PARSE_ACPI_HEADER(Info)
Definition: AcpiParser.h:501

An ACPI_PARSER array describing the ACPI PCCT Table.

Definition at line 273 of file PcctParser.c.