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

Go to the source code of this file.

Macros

#define NAME_STR_SPCR_PORT   "COM1"
 
#define UID_SPCR_PORT   1
 
#define SPCR_FLOW_CONTROL_NONE   0
 
#define SPCR_GENERATOR_REVISION   CREATE_REVISION (1, 0)
 

Functions

 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjConsolePortInfo, CM_ARCH_COMMON_SERIAL_PORT_INFO)
 
STATIC EFI_STATUS EFIAPI BuildSpcrTableEx (IN CONST ACPI_TABLE_GENERATOR *This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER ***Table, OUT UINTN *CONST TableCount)
 
EFI_STATUS EFIAPI AcpiSpcrLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI AcpiSpcrLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE AcpiSpcr
 
STATIC CONST ACPI_TABLE_GENERATOR SpcrGenerator
 

Detailed Description

SPCR Table Generator

Copyright (c) 2017 - 2021, 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 SpcrGenerator.c.

Macro Definition Documentation

◆ NAME_STR_SPCR_PORT

#define NAME_STR_SPCR_PORT   "COM1"

Standard SPCR Table Generator

Constructs the SPCR table for PL011 or SBSA UART peripherals.

Requirements: The following Configuration Manager Object(s) are required by this Generator:

  • EArchCommonObjConsolePortInfo

NOTE: This implementation ignores the possibility that the Serial settings may be modified from the UEFI Shell. A more complex handler would be needed to (e.g.) recover serial port settings from the UART, or non-volatile storage. A string representing the name of the SPCR port.

Definition at line 48 of file SpcrGenerator.c.

◆ SPCR_FLOW_CONTROL_NONE

#define SPCR_FLOW_CONTROL_NONE   0

This macro defines the no flow control option.

Definition at line 56 of file SpcrGenerator.c.

◆ SPCR_GENERATOR_REVISION

#define SPCR_GENERATOR_REVISION   CREATE_REVISION (1, 0)

This macro defines the SPCR Table Generator revision.

Definition at line 404 of file SpcrGenerator.c.

◆ UID_SPCR_PORT

#define UID_SPCR_PORT   1

An UID representing the SPCR port.

Definition at line 52 of file SpcrGenerator.c.

Function Documentation

◆ AcpiSpcrLibConstructor()

EFI_STATUS EFIAPI AcpiSpcrLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Register the Generator with the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is registered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_ALREADY_STARTEDThe Generator for the Table ID is already registered.

Definition at line 447 of file SpcrGenerator.c.

◆ AcpiSpcrLibDestructor()

EFI_STATUS EFIAPI AcpiSpcrLibDestructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Deregister the Generator from the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is deregistered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe Generator is not registered.

Definition at line 471 of file SpcrGenerator.c.

◆ BuildSpcrTableEx()

STATIC EFI_STATUS EFIAPI BuildSpcrTableEx ( IN CONST ACPI_TABLE_GENERATOR This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST  AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
OUT EFI_ACPI_DESCRIPTION_HEADER ***  Table,
OUT UINTN *CONST  TableCount 
)

Construct the SPCR ACPI table and its associated SSDT table.

This function invokes the Configuration Manager protocol interface to get the required hardware information for generating the ACPI table.

If this function allocates any resources then they must be freed in the FreeXXXXTableResourcesEx function.

Parameters
[in]ThisPointer to the ACPI table generator.
[in]AcpiTableInfoPointer to the ACPI table information.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol interface.
[out]TablePointer to a list of generated ACPI table(s).
[out]TableCountNumber of generated ACPI table(s).
Return values
EFI_SUCCESSTable generated successfully.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDCould not find information.
EFI_OUT_OF_RESOURCESCould not allocate memory.
EFI_UNSUPPORTEDUnsupported configuration.

Definition at line 195 of file SpcrGenerator.c.

◆ GET_OBJECT_LIST()

This macro expands to a function that retrieves the Serial Port Information from the Configuration Manager.

Definition at line 100 of file SpcrGenerator.c.

Variable Documentation

◆ AcpiSpcr

A template for generating the SPCR Table.

Note: fields marked "{Template}" will be updated dynamically.

Definition at line 63 of file SpcrGenerator.c.

◆ SpcrGenerator

Initial value:
= {
L"ACPI.STD.SPCR.GENERATOR",
FreeSpcrTableEx
}
#define EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE
Definition: Acpi63.h:2936
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdSpcr
SPCR Generator.
#define NULL
Definition: Base.h:319
#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION
#define SPCR_GENERATOR_REVISION
STATIC EFI_STATUS EFIAPI BuildSpcrTableEx(IN CONST ACPI_TABLE_GENERATOR *This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER ***Table, OUT UINTN *CONST TableCount)

The interface for the SPCR Table Generator.

Definition at line 410 of file SpcrGenerator.c.