TianoCore EDK2 master
Loading...
Searching...
No Matches
GtdtParser.c File Reference
#include <IndustryStandard/Acpi.h>
#include <Library/UefiLib.h>
#include "AcpiParser.h"
#include "AcpiTableParser.h"
#include "AcpiViewConfig.h"

Go to the source code of this file.

Macros

#define GT_BLOCK_TIMER_COUNT_MAX   8
 

Functions

STATIC VOID EFIAPI ValidateGtBlockTimerCount (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateGtFrameNumber (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID DumpGTBlock (IN UINT8 *Ptr, IN UINT16 Length)
 
STATIC VOID DumpWatchdogTimer (IN UINT8 *Ptr, IN UINT16 Length)
 
VOID EFIAPI ParseAcpiGtdt (IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
 

Variables

STATIC CONST UINT32 * GtdtPlatformTimerCount
 
STATIC CONST UINT32 * GtdtPlatformTimerOffset
 
STATIC CONST UINT8 * PlatformTimerType
 
STATIC CONST UINT16 * PlatformTimerLength
 
STATIC CONST UINT32 * GtBlockTimerCount
 
STATIC CONST UINT32 * GtBlockTimerOffset
 
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo
 
STATIC CONST ACPI_PARSER GtdtParser []
 
STATIC CONST ACPI_PARSER GtPlatformTimerHeaderParser []
 
STATIC CONST ACPI_PARSER GtBlockParser []
 
STATIC CONST ACPI_PARSER GtBlockTimerParser []
 
STATIC CONST ACPI_PARSER ArmGenericWatchdogParser []
 

Detailed Description

GTDT table parser

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

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

Definition in file GtdtParser.c.

Macro Definition Documentation

◆ GT_BLOCK_TIMER_COUNT_MAX

#define GT_BLOCK_TIMER_COUNT_MAX   8

Definition at line 18 of file GtdtParser.c.

Function Documentation

◆ DumpGTBlock()

STATIC VOID DumpGTBlock ( IN UINT8 *  Ptr,
IN UINT16  Length 
)

This function parses the Platform GT Block.

Parameters
[in]PtrPointer to the start of the GT Block data.
[in]LengthLength of the GT Block structure.

Definition at line 180 of file GtdtParser.c.

◆ DumpWatchdogTimer()

STATIC VOID DumpWatchdogTimer ( IN UINT8 *  Ptr,
IN UINT16  Length 
)

This function parses the Platform Watchdog timer.

Parameters
[in]PtrPointer to the start of the watchdog timer data.
[in]LengthLength of the watchdog timer structure.

Definition at line 237 of file GtdtParser.c.

◆ ParseAcpiGtdt()

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

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

This function also parses the following platform timer structures:

  • GT Block timer
  • Watchdog timer

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 270 of file GtdtParser.c.

◆ ValidateGtBlockTimerCount()

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

This function validates the GT Block timer count.

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 40 of file GtdtParser.c.

◆ ValidateGtFrameNumber()

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

This function validates the GT Frame Number.

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 71 of file GtdtParser.c.

Variable Documentation

◆ AcpiHdrInfo

Definition at line 27 of file GtdtParser.c.

◆ ArmGenericWatchdogParser

STATIC CONST ACPI_PARSER ArmGenericWatchdogParser[]
Initial value:
= {
{ L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL },
{ L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL },
{ L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL },
{ L"RefreshFrame Physical address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"ControlFrame Physical address", 8, 12, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Watchdog Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL }
}
#define NULL
Definition: Base.h:319

An ACPI_PARSER array describing the Platform Watchdog.

Definition at line 162 of file GtdtParser.c.

◆ GtBlockParser

STATIC CONST ACPI_PARSER GtBlockParser[]
Initial value:
= {
{ L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL },
{ L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL },
{ L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL },
{ L"Physical address (CntCtlBase)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Timer Count", 4, 12, L"%d", NULL, (VOID **)&GtBlockTimerCount,
{ L"Timer Offset", 4, 16, L"%d", NULL, (VOID **)&GtBlockTimerOffset, NULL,
NULL }
}
STATIC VOID EFIAPI ValidateGtBlockTimerCount(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: GtdtParser.c:40

An ACPI_PARSER array describing the Platform GT Block.

Definition at line 132 of file GtdtParser.c.

◆ GtBlockTimerCount

STATIC CONST UINT32* GtBlockTimerCount

Definition at line 25 of file GtdtParser.c.

◆ GtBlockTimerOffset

STATIC CONST UINT32* GtBlockTimerOffset

Definition at line 26 of file GtdtParser.c.

◆ GtBlockTimerParser

STATIC CONST ACPI_PARSER GtBlockTimerParser[]
Initial value:
= {
{ L"Frame Number", 1, 0, L"%d", NULL, NULL, ValidateGtFrameNumber, NULL },
{ L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL },
{ L"Physical address (CntBaseX)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },
{ L"Physical address (CntEL0BaseX)", 8, 12, L"0x%lx", NULL, NULL, NULL,
NULL },
{ L"Physical Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Physical Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Virtual Timer GSIV", 4, 28, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Virtual Timer Flags", 4, 32, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Common Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL }
}
VOID EFIAPI Dump3Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: AcpiParser.c:326
STATIC VOID EFIAPI ValidateGtFrameNumber(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: GtdtParser.c:71

An ACPI_PARSER array describing the GT Block timer.

Definition at line 146 of file GtdtParser.c.

◆ GtdtParser

STATIC CONST ACPI_PARSER GtdtParser[]
Initial value:
= {
PARSE_ACPI_HEADER (&AcpiHdrInfo),
{ L"CntControlBase Physical Address",8, 36, L"0x%lx", NULL, NULL,
NULL, NULL },
{ L"Reserved", 4, 44, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Secure EL1 timer GSIV", 4, 48, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Secure EL1 timer FLAGS", 4, 52, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Non-Secure EL1 timer GSIV", 4, 56, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Non-Secure EL1 timer FLAGS", 4, 60, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Virtual timer GSIV", 4, 64, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Virtual timer FLAGS", 4, 68, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Non-Secure EL2 timer GSIV", 4, 72, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Non-Secure EL2 timer FLAGS", 4, 76, L"0x%x", NULL, NULL,NULL, NULL },
{ L"CntReadBase Physical address", 8, 80, L"0x%lx", NULL, NULL,NULL, NULL },
{ L"Platform Timer Count", 4, 88, L"%d", NULL,
(VOID **)&GtdtPlatformTimerCount, NULL, NULL },
{ L"Platform Timer Offset", 4, 92, L"0x%x", NULL,
(VOID **)&GtdtPlatformTimerOffset,NULL, NULL },
{ L"Virtual EL2 Timer GSIV", 4, 96, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Virtual EL2 Timer Flags", 4, 100, L"0x%x", NULL, NULL,NULL, NULL }
}
#define PARSE_ACPI_HEADER(Info)
Definition: AcpiParser.h:501

An ACPI_PARSER array describing the ACPI GTDT Table.

Definition at line 94 of file GtdtParser.c.

◆ GtdtPlatformTimerCount

STATIC CONST UINT32* GtdtPlatformTimerCount

Definition at line 21 of file GtdtParser.c.

◆ GtdtPlatformTimerOffset

STATIC CONST UINT32* GtdtPlatformTimerOffset

Definition at line 22 of file GtdtParser.c.

◆ GtPlatformTimerHeaderParser

STATIC CONST ACPI_PARSER GtPlatformTimerHeaderParser[]
Initial value:
= {
{ L"Type", 1, 0, NULL, NULL, (VOID **)&PlatformTimerType, NULL, NULL },
{ L"Length", 2, 1, NULL, NULL, (VOID **)&PlatformTimerLength, NULL, NULL },
{ L"Reserved", 1, 3, NULL, NULL, NULL, NULL, NULL }
}

An ACPI_PARSER array describing the Platform timer header.

Definition at line 123 of file GtdtParser.c.

◆ PlatformTimerLength

STATIC CONST UINT16* PlatformTimerLength

Definition at line 24 of file GtdtParser.c.

◆ PlatformTimerType

STATIC CONST UINT8* PlatformTimerType

Definition at line 23 of file GtdtParser.c.