TianoCore EDK2 master
|
#include <Library/AcpiLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Protocol/AcpiTable.h>
#include <AcpiTableGenerator.h>
#include <ConfigurationManagerObject.h>
#include <ConfigurationManagerHelper.h>
#include <Library/AcpiHelperLib.h>
#include <Library/SsdtSerialPortFixupLib.h>
#include <Protocol/ConfigurationManagerProtocol.h>
Go to the source code of this file.
Macros | |
#define | SERIAL_PORT_START_UID 2 |
#define | MAX_SERIAL_PORTS_SUPPORTED 14 |
#define | SSDT_SERIAL_GENERATOR_REVISION CREATE_REVISION (1, 0) |
Functions | |
GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjSerialPortInfo, CM_ARCH_COMMON_SERIAL_PORT_INFO) | |
STATIC EFI_STATUS EFIAPI | FreeSsdtSerialPortTableEx (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT EFI_ACPI_DESCRIPTION_HEADER ***CONST Table, IN CONST UINTN TableCount) |
STATIC EFI_STATUS EFIAPI | BuildSsdtSerialPortTableEx (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 | AcpiSsdtSerialPortLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
EFI_STATUS EFIAPI | AcpiSsdtSerialPortLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
STATIC CONST ACPI_TABLE_GENERATOR | SsdtSerialPortGenerator |
SSDT Serial Port Table Generator.
Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SsdtSerialPortGenerator.c.
#define MAX_SERIAL_PORTS_SUPPORTED 14 |
Maximum serial ports supported by this generator. This generator supports a maximum of 14 (16 - 2) serial ports. The -2 here reflects the reservation for serial ports for the DBG2 and SPCR ports regardless of whether the DBG2 or SPCR port is enabled. Note: This is not a hard limitation and can be extended if needed. Corresponding changes would be needed to support the Name and UID fields describing the serial port.
Definition at line 60 of file SsdtSerialPortGenerator.c.
#define SERIAL_PORT_START_UID 2 |
Starting value for the UID to represent the serial ports. Note: The UID 0 and 1 are reserved for use by DBG2 port and SPCR respectively. So, the UIDs for serial ports for general use start at 2.
Definition at line 49 of file SsdtSerialPortGenerator.c.
#define SSDT_SERIAL_GENERATOR_REVISION CREATE_REVISION (1, 0) |
This macro defines the SSDT Serial Port Table Generator revision.
Definition at line 286 of file SsdtSerialPortGenerator.c.
EFI_STATUS EFIAPI AcpiSsdtSerialPortLibConstructor | ( | 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 329 of file SsdtSerialPortGenerator.c.
EFI_STATUS EFIAPI AcpiSsdtSerialPortLibDestructor | ( | 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 358 of file SsdtSerialPortGenerator.c.
STATIC EFI_STATUS EFIAPI BuildSsdtSerialPortTableEx | ( | 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 SSDT tables describing serial-ports.
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 162 of file SsdtSerialPortGenerator.c.
STATIC EFI_STATUS EFIAPI FreeSsdtSerialPortTableEx | ( | IN CONST ACPI_TABLE_GENERATOR *CONST | This, |
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST | AcpiTableInfo, | ||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol, | ||
IN OUT EFI_ACPI_DESCRIPTION_HEADER ***CONST | Table, | ||
IN CONST UINTN | TableCount | ||
) |
Free any resources allocated for constructing the tables.
[in] | This | Pointer to the ACPI table generator. |
[in] | AcpiTableInfo | Pointer to the ACPI Table Info. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in,out] | Table | Pointer to an array of pointers to ACPI Table(s). |
[in] | TableCount | Number of ACPI table(s). |
EFI_SUCCESS | The resources were freed successfully. |
EFI_INVALID_PARAMETER | The table pointer is NULL or invalid. |
Definition at line 78 of file SsdtSerialPortGenerator.c.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjSerialPortInfo | , | ||
CM_ARCH_COMMON_SERIAL_PORT_INFO | |||
) |
ARM standard SSDT Serial Port Table Generator
Constructs SSDT tables describing serial ports (other than the serial ports used by the SPCR or DBG2 tables).
Requirements: The following Configuration Manager Object(s) are required by this Generator:
STATIC CONST ACPI_TABLE_GENERATOR SsdtSerialPortGenerator |
The interface for the SSDT Serial Port Table Generator.
Definition at line 292 of file SsdtSerialPortGenerator.c.