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

Go to the source code of this file.

Functions

STATIC VOID EFIAPI ValidateInterruptType (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateIrq (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
VOID EFIAPI ParseAcpiSpcr (IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
 

Variables

STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo
 
STATIC CONST ACPI_PARSER SpcrParser []
 

Detailed Description

SPCR table parser

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

Reference(s):
  • Microsoft Serial Port Console Redirection Table Specification - Version 1.03 - August 10, 2015.

Definition in file SpcrParser.c.

Function Documentation

◆ ParseAcpiSpcr()

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

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

This function also performs validations 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 131 of file SpcrParser.c.

◆ ValidateInterruptType()

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

This function validates the Interrupt Type.

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 32 of file SpcrParser.c.

◆ ValidateIrq()

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

This function validates the Irq.

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 67 of file SpcrParser.c.

Variable Documentation

◆ AcpiHdrInfo

Definition at line 19 of file SpcrParser.c.

◆ SpcrParser

STATIC CONST ACPI_PARSER SpcrParser[]
Initial value:
= {
PARSE_ACPI_HEADER (&AcpiHdrInfo),
{ L"Interface Type", 1, 36, L"%d", NULL, NULL, NULL, NULL },
{ L"Reserved", 3, 37, L"%x %x %x", Dump3Chars, NULL, NULL, NULL },
{ L"Base Address", 12, 40, NULL, DumpGas, NULL, NULL, NULL },
{ L"Interrupt Type", 1, 52, L"%d", NULL, NULL, ValidateInterruptType, NULL },
{ L"IRQ", 1, 53, L"%d", NULL, NULL, ValidateIrq, NULL },
{ L"Global System Interrupt", 4, 54, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Baud Rate", 1, 58, L"%d", NULL, NULL, NULL, NULL },
{ L"Parity", 1, 59, L"%d", NULL, NULL, NULL, NULL },
{ L"Stop Bits", 1, 60, L"%d", NULL, NULL, NULL, NULL },
{ L"Flow Control", 1, 61, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Terminal Type", 1, 62, L"%d", NULL, NULL, NULL, NULL },
{ L"Reserved", 1, 63, L"%x", NULL, NULL, NULL, NULL },
{ L"PCI Device ID", 2, 64, L"0x%x", NULL, NULL, NULL, NULL },
{ L"PCI Vendor ID", 2, 66, L"0x%x", NULL, NULL, NULL, NULL },
{ L"PCI Bus Number", 1, 68, L"0x%x", NULL, NULL, NULL, NULL },
{ L"PCI Device Number", 1, 69, L"0x%x", NULL, NULL, NULL, NULL },
{ L"PCI Function Number", 1, 70, L"0x%x", NULL, NULL, NULL, NULL },
{ L"PCI Flags", 4, 71, L"0x%x", NULL, NULL, NULL, NULL },
{ L"PCI Segment", 1, 75, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 4, 76, L"%x", NULL, NULL, NULL, NULL }
}
VOID EFIAPI DumpGas(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: AcpiParser.c:867
VOID EFIAPI Dump3Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: AcpiParser.c:326
#define PARSE_ACPI_HEADER(Info)
Definition: AcpiParser.h:501
#define NULL
Definition: Base.h:319
STATIC VOID EFIAPI ValidateInterruptType(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: SpcrParser.c:32
STATIC VOID EFIAPI ValidateIrq(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: SpcrParser.c:67

An ACPI_PARSER array describing the ACPI SPCR Table.

Definition at line 92 of file SpcrParser.c.