TianoCore EDK2 master
Loading...
Searching...
No Matches
Dbg2Parser.c File Reference

Go to the source code of this file.

Functions

STATIC VOID EFIAPI ValidateNameSpaceStrLen (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI DumpDbgDeviceInfo (IN UINT8 *Ptr, IN UINT16 Length)
 
VOID EFIAPI ParseAcpiDbg2 (IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
 

Variables

STATIC CONST UINT32 * OffsetDbgDeviceInfo
 
STATIC CONST UINT32 * NumberDbgDeviceInfo
 
STATIC CONST UINT16 * DbgDevInfoLen
 
STATIC CONST UINT8 * GasCount
 
STATIC CONST UINT16 * NameSpaceStringLength
 
STATIC CONST UINT16 * NameSpaceStringOffset
 
STATIC CONST UINT16 * OEMDataLength
 
STATIC CONST UINT16 * OEMDataOffset
 
STATIC CONST UINT16 * BaseAddrRegOffset
 
STATIC CONST UINT16 * AddrSizeOffset
 
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo
 
STATIC CONST ACPI_PARSER Dbg2Parser []
 An ACPI_PARSER array describing the ACPI DBG2 table.
 
STATIC CONST ACPI_PARSER DbgDevInfoHeaderParser []
 
STATIC CONST ACPI_PARSER DbgDevInfoParser []
 An ACPI_PARSER array describing the debug device information.
 

Detailed Description

DBG2 table parser

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

Reference(s):
  • Microsoft Debug Port Table 2 (DBG2) Specification - December 10, 2015.

Definition in file Dbg2Parser.c.

Function Documentation

◆ DumpDbgDeviceInfo()

STATIC VOID EFIAPI DumpDbgDeviceInfo ( IN UINT8 *  Ptr,
IN UINT16  Length 
)

This function parses the debug device information structure.

Parameters
[in]PtrPointer to the start of the buffer.
[in]LengthLength of the debug device information structure.

Definition at line 111 of file Dbg2Parser.c.

◆ ParseAcpiDbg2()

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

This function parses the ACPI DBG2 table. When trace is enabled this function parses the DBG2 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 232 of file Dbg2Parser.c.

◆ ValidateNameSpaceStrLen()

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

This function validates the NameSpace string length.

Parameters
[in]PtrPointer to the start of the buffer.
[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 40 of file Dbg2Parser.c.

Variable Documentation

◆ AcpiHdrInfo

Definition at line 27 of file Dbg2Parser.c.

◆ AddrSizeOffset

STATIC CONST UINT16* AddrSizeOffset

Definition at line 26 of file Dbg2Parser.c.

◆ BaseAddrRegOffset

STATIC CONST UINT16* BaseAddrRegOffset

Definition at line 25 of file Dbg2Parser.c.

◆ Dbg2Parser

STATIC CONST ACPI_PARSER Dbg2Parser[]
Initial value:
= {
PARSE_ACPI_HEADER (&AcpiHdrInfo),
{ L"OffsetDbgDeviceInfo", 4, 36, L"0x%x", NULL,
(VOID **)&OffsetDbgDeviceInfo, NULL, NULL },
{ L"NumberDbgDeviceInfo", 4, 40, L"%d", NULL,
(VOID **)&NumberDbgDeviceInfo, NULL, NULL }
}
#define PARSE_ACPI_HEADER(Info)
Definition: AcpiParser.h:501
#define NULL
Definition: Base.h:319

An ACPI_PARSER array describing the ACPI DBG2 table.

Definition at line 61 of file Dbg2Parser.c.

◆ DbgDevInfoHeaderParser

STATIC CONST ACPI_PARSER DbgDevInfoHeaderParser[]
Initial value:
= {
{ L"Revision", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Length", 2, 1, L"%d", NULL, (VOID **)&DbgDevInfoLen, NULL, NULL }
}

An ACPI_PARSER array describing the debug device information structure header.

Definition at line 71 of file Dbg2Parser.c.

◆ DbgDevInfoLen

STATIC CONST UINT16* DbgDevInfoLen

Definition at line 19 of file Dbg2Parser.c.

◆ DbgDevInfoParser

STATIC CONST ACPI_PARSER DbgDevInfoParser[]
Initial value:
= {
{ L"Revision", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL },
{ L"Generic Address Registers Count", 1, 3, L"0x%x", NULL,
(VOID **)&GasCount, NULL, NULL },
{ L"NameSpace String Length", 2, 4, L"%d", NULL,
(VOID **)&NameSpaceStringLength, ValidateNameSpaceStrLen, NULL },
{ L"NameSpace String Offset", 2, 6, L"0x%x", NULL,
(VOID **)&NameSpaceStringOffset, NULL, NULL },
{ L"OEM Data Length", 2, 8, L"%d", NULL, (VOID **)&OEMDataLength,
NULL, NULL },
{ L"OEM Data Offset", 2, 10, L"0x%x", NULL, (VOID **)&OEMDataOffset,
NULL, NULL },
{ L"Port Type", 2, 12, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Port SubType", 2, 14, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 16, L"%x", NULL, NULL, NULL, NULL },
{ L"Base Address Register Offset", 2, 18, L"0x%x", NULL,
(VOID **)&BaseAddrRegOffset, NULL, NULL },
{ L"Address Size Offset", 2, 20, L"0x%x", NULL,
(VOID **)&AddrSizeOffset, NULL, NULL }
}
STATIC VOID EFIAPI ValidateNameSpaceStrLen(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: Dbg2Parser.c:40

An ACPI_PARSER array describing the debug device information.

Definition at line 77 of file Dbg2Parser.c.

◆ GasCount

STATIC CONST UINT8* GasCount

Definition at line 20 of file Dbg2Parser.c.

◆ NameSpaceStringLength

STATIC CONST UINT16* NameSpaceStringLength

Definition at line 21 of file Dbg2Parser.c.

◆ NameSpaceStringOffset

STATIC CONST UINT16* NameSpaceStringOffset

Definition at line 22 of file Dbg2Parser.c.

◆ NumberDbgDeviceInfo

STATIC CONST UINT32* NumberDbgDeviceInfo

Definition at line 18 of file Dbg2Parser.c.

◆ OEMDataLength

STATIC CONST UINT16* OEMDataLength

Definition at line 23 of file Dbg2Parser.c.

◆ OEMDataOffset

STATIC CONST UINT16* OEMDataOffset

Definition at line 24 of file Dbg2Parser.c.

◆ OffsetDbgDeviceInfo

STATIC CONST UINT32* OffsetDbgDeviceInfo

Definition at line 17 of file Dbg2Parser.c.