TianoCore EDK2 master
|
#include <IndustryStandard/DebugPort2Table.h>
#include <IndustryStandard/SerialPortConsoleRedirectionTable.h>
#include <Library/AcpiLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Protocol/AcpiTable.h>
#include <AcpiTableGenerator.h>
#include <ConfigurationManagerObject.h>
#include <ConfigurationManagerHelper.h>
#include <Library/SsdtSerialPortFixupLib.h>
#include <Library/TableHelperLib.h>
#include <Protocol/ConfigurationManagerProtocol.h>
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 |
SPCR Table Generator
Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SpcrGenerator.c.
#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:
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.
#define SPCR_FLOW_CONTROL_NONE 0 |
This macro defines the no flow control option.
Definition at line 56 of file SpcrGenerator.c.
#define SPCR_GENERATOR_REVISION CREATE_REVISION (1, 0) |
This macro defines the SPCR Table Generator revision.
Definition at line 404 of file SpcrGenerator.c.
#define UID_SPCR_PORT 1 |
An UID representing the SPCR port.
Definition at line 52 of file SpcrGenerator.c.
EFI_STATUS EFIAPI AcpiSpcrLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Register the Generator with the ACPI Table Factory.
[in] | ImageHandle | The handle to the image. |
[in] | SystemTable | Pointer to the System Table. |
EFI_SUCCESS | The Generator is registered. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_ALREADY_STARTED | The Generator for the Table ID is already registered. |
Definition at line 447 of file SpcrGenerator.c.
EFI_STATUS EFIAPI AcpiSpcrLibDestructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Deregister the Generator from the ACPI Table Factory.
[in] | ImageHandle | The handle to the image. |
[in] | SystemTable | Pointer to the System Table. |
EFI_SUCCESS | The Generator is deregistered. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | The Generator is not registered. |
Definition at line 471 of file SpcrGenerator.c.
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.
[in] | This | Pointer to the ACPI table generator. |
[in] | AcpiTableInfo | Pointer to the ACPI table information. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol interface. |
[out] | Table | Pointer to a list of generated ACPI table(s). |
[out] | TableCount | Number of generated ACPI table(s). |
EFI_SUCCESS | Table generated successfully. |
EFI_BAD_BUFFER_SIZE | The size returned by the Configuration Manager is less than the Object size for the requested object. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | Could not find information. |
EFI_OUT_OF_RESOURCES | Could not allocate memory. |
EFI_UNSUPPORTED | Unsupported configuration. |
Definition at line 195 of file SpcrGenerator.c.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjConsolePortInfo | , | ||
CM_ARCH_COMMON_SERIAL_PORT_INFO | |||
) |
This macro expands to a function that retrieves the Serial Port Information from the Configuration Manager.
Definition at line 100 of file SpcrGenerator.c.
A template for generating the SPCR Table.
Note: fields marked "{Template}" will be updated dynamically.
Definition at line 63 of file SpcrGenerator.c.
STATIC CONST ACPI_TABLE_GENERATOR SpcrGenerator |
The interface for the SPCR Table Generator.
Definition at line 410 of file SpcrGenerator.c.