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

Go to the source code of this file.

Functions

STATIC VOID EFIAPI ValidateInjectionFlags (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateInjectionAction (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateInstruction (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateRegisterRegion (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI DumpInjectionInstAction (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
 
STATIC VOID EFIAPI DumpInstruction (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
 
VOID EFIAPI ParseAcpiEinj (IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
 

Variables

STATIC ACPI_DESCRIPTION_HEADER_INFO mAcpiHdrInfo
 
STATIC UINT32 * mEinjInjectionHdrSize
 
STATIC UINT32 * mEinjInjectionEntryCnt
 
STATIC CONST CHAR16 * InstNameTable []
 
STATIC CONST ACPI_PARSER EinjParser []
 
STATIC CONST ACPI_PARSER EinjInjectionInstEntryParser []
 

Detailed Description

EINJ table parser

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

Specification Reference:
  • ACPI 6.5, Table 18.3.2 ACPI Error Source

Definition in file EinjParser.c.

Function Documentation

◆ DumpInjectionInstAction()

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

Dumps the injection action fields in injection instruction entry.

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

Definition at line 185 of file EinjParser.c.

◆ DumpInstruction()

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

Dumps the instruction fields in injection instruction entry.

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

Definition at line 254 of file EinjParser.c.

◆ ParseAcpiEinj()

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

This function parses the EINJ table. When trace is enabled this function parses the EINJ 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 305 of file EinjParser.c.

◆ ValidateInjectionAction()

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

This function validates the injection action field in the EINJ injection instruction entry.

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.

EFI_ACPI_6_5_EINJ_TRIGGER_ERROR is only used Trigger Action Table not used in Injection Action Table in EINJ. Cf ACPI 6.5 Table 18.24 - Error Injection Table Cf ACPI 6.5 Table 18.36 - Trigger Error Action

Definition at line 84 of file EinjParser.c.

◆ ValidateInjectionFlags()

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

This function validates the flags field in the EINJ injection header.

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 41 of file EinjParser.c.

◆ ValidateInstruction()

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

This function validates the instruction field in the EINJ injection instruction entry.

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 127 of file EinjParser.c.

◆ ValidateRegisterRegion()

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

This function validates the register region field in the EINJ injection instruction entry.

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 157 of file EinjParser.c.

Variable Documentation

◆ EinjInjectionInstEntryParser

STATIC CONST ACPI_PARSER EinjInjectionInstEntryParser[]
Initial value:
= {
{ L"Injection Action", 1, 0, NULL, DumpInjectionInstAction, NULL,
{ L"Instruction", 1, 1, NULL, DumpInstruction, NULL,
{ L"Flags", 1, 2, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Reserved", 1, 3, NULL, NULL, NULL,NULL, NULL },
{ L"Register Region", 12, 4, NULL, DumpGas, NULL,
{ L"Value", 8, 16, L"0x%x", NULL, NULL,NULL, NULL },
{ L"Mask", 8, 24, L"0x%x", NULL, NULL,NULL, NULL },
}
VOID EFIAPI DumpGas(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: AcpiParser.c:867
STATIC VOID EFIAPI ValidateInjectionAction(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: EinjParser.c:84
STATIC VOID EFIAPI DumpInjectionInstAction(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: EinjParser.c:185
STATIC VOID EFIAPI ValidateRegisterRegion(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: EinjParser.c:157
STATIC VOID EFIAPI ValidateInstruction(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: EinjParser.c:127
STATIC VOID EFIAPI DumpInstruction(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: EinjParser.c:254
#define NULL
Definition: Base.h:319

An ACPI_PARSER array describing the EINJ Injection instruction entry.

Definition at line 278 of file EinjParser.c.

◆ EinjParser

STATIC CONST ACPI_PARSER EinjParser[]
Initial value:
= {
PARSE_ACPI_HEADER (&mAcpiHdrInfo),
{ L"Injection Header Size", 4, 36, L"%d", NULL, (VOID **)&mEinjInjectionHdrSize,
NULL, NULL },
{ L"Injection Flags", 1, 40, L"0x%x", NULL, NULL, ValidateInjectionFlags,NULL },
{ L"Reserved", 3, 41, NULL, NULL, NULL, NULL, NULL },
{ L"Injection Entry Count", 4, 44, L"%d", NULL, (VOID **)&mEinjInjectionEntryCnt,
NULL, NULL },
}
#define PARSE_ACPI_HEADER(Info)
Definition: AcpiParser.h:501
STATIC VOID EFIAPI ValidateInjectionFlags(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: EinjParser.c:41

An ACPI_PARSER array describing the ACPI EINJ Table.

Definition at line 60 of file EinjParser.c.

◆ InstNameTable

STATIC CONST CHAR16* InstNameTable[]
Initial value:
= {
L"READ_REGISTER",
L"READ_REGISTER_VALUE",
L"WRITE_REGISTER",
L"WRITE_REGISTER_VALUE",
L"NOOP",
}

Definition at line 22 of file EinjParser.c.

◆ mAcpiHdrInfo

Definition at line 18 of file EinjParser.c.

◆ mEinjInjectionEntryCnt

STATIC UINT32* mEinjInjectionEntryCnt

Definition at line 20 of file EinjParser.c.

◆ mEinjInjectionHdrSize

STATIC UINT32* mEinjInjectionHdrSize

Definition at line 19 of file EinjParser.c.