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

Go to the source code of this file.

Functions

VOID EFIAPI DumpHpetPageProtectionFlag (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
 
VOID EFIAPI DumpHpetFlag (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
 
VOID EFIAPI DumpCounterSize (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
 
STATIC VOID EFIAPI ValidateHpetRevId (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
VOID EFIAPI DumpHpetEventTimerBlockId (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
 
VOID EFIAPI ParseAcpiHpet (IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
 

Variables

STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo
 
STATIC CONST ACPI_PARSER DumpHpetFlagParser []
 
STATIC CONST ACPI_PARSER HpetEventTimerBlockIdFlagParser []
 
STATIC CONST ACPI_PARSER HpetParser []
 

Detailed Description

HPET table parser

Copyright (c) 2024, Arm Limited. All rights reserved. Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Reference(s):
  • HPET spec, version 1.0a

Definition in file HpetParser.c.

Function Documentation

◆ DumpCounterSize()

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

This function prints HPET Counter size fields. If no format string is specified the Format must be NULL.

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

Definition at line 105 of file HpetParser.c.

◆ DumpHpetEventTimerBlockId()

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

This function prints Hardware ID of HPET Event timer block. If no format string is specified the Format must be NULL.

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

Definition at line 170 of file HpetParser.c.

◆ DumpHpetFlag()

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

This function prints HPET Flags fields. If no format string is specified the Format must be NULL.

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

Definition at line 74 of file HpetParser.c.

◆ DumpHpetPageProtectionFlag()

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

This function prints HPET page protection flags. If no format string is specified the Format must be NULL.

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

Definition at line 26 of file HpetParser.c.

◆ ParseAcpiHpet()

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

This function parses the ACPI HPET table.

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 214 of file HpetParser.c.

◆ ValidateHpetRevId()

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

This function validates the flags.

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 135 of file HpetParser.c.

Variable Documentation

◆ AcpiHdrInfo

Definition at line 15 of file HpetParser.c.

◆ DumpHpetFlagParser

STATIC CONST ACPI_PARSER DumpHpetFlagParser[]
Initial value:
= {
{ L"Page Protection Flag", 4, 0, NULL, DumpHpetPageProtectionFlag, NULL, NULL, NULL },
{ L"OEM Attributes", 4, 4, L"0x%x", NULL, NULL, NULL, NULL }
}
VOID EFIAPI DumpHpetPageProtectionFlag(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: HpetParser.c:26
#define NULL
Definition: Base.h:319

An ACPI_PARSER array describing the ACPI HPET flags.

Definition at line 60 of file HpetParser.c.

◆ HpetEventTimerBlockIdFlagParser

STATIC CONST ACPI_PARSER HpetEventTimerBlockIdFlagParser[]
Initial value:
= {
{ L"Hardware Rev ID", 8, 0, L"0x%x", NULL, NULL, ValidateHpetRevId, NULL },
{ L"Comparators in 1st Timer Block", 5, 8, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Counter max size", 1, 13, NULL, DumpCounterSize, NULL, NULL, NULL },
{ L"Reserved", 1, 14, L"%d", NULL, NULL, NULL, NULL },
{ L"LegacyReplacement IRQ Routing", 1, 15, L"%d", NULL, NULL, NULL, NULL },
{ L"PCI Vendor ID of 1st Timer Block", 16, 16, L"0x%x", NULL, NULL, NULL, NULL }
}
VOID EFIAPI DumpCounterSize(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: HpetParser.c:105
STATIC VOID EFIAPI ValidateHpetRevId(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: HpetParser.c:135

An ACPI_PARSER array describing the ACPI HPET Event Timer Block ID.

Definition at line 152 of file HpetParser.c.

◆ HpetParser

STATIC CONST ACPI_PARSER HpetParser[]
Initial value:
= {
PARSE_ACPI_HEADER (&AcpiHdrInfo),
{ L"Event Timer Block ID", 4, 36, NULL, DumpHpetEventTimerBlockId, NULL, NULL, NULL },
{ L"Base Address", 12, 40, NULL, DumpGas, NULL, NULL, NULL },
{ L"HPET Number", 1, 52, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Minimum Clock Ticks", 2, 53, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Page Protection and OEM Attributes",1, 55, NULL, DumpHpetFlag, NULL, NULL, NULL }
}
VOID EFIAPI DumpGas(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: AcpiParser.c:867
#define PARSE_ACPI_HEADER(Info)
Definition: AcpiParser.h:501
VOID EFIAPI DumpHpetFlag(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: HpetParser.c:74
VOID EFIAPI DumpHpetEventTimerBlockId(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: HpetParser.c:170

An ACPI_PARSER array describing the ACPI HPET Table.

Definition at line 195 of file HpetParser.c.