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

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
 

Detailed Description

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.

Macro Definition Documentation

◆ MAX_SERIAL_PORTS_SUPPORTED

#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.

◆ SERIAL_PORT_START_UID

#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.

◆ SSDT_SERIAL_GENERATOR_REVISION

#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.

Function Documentation

◆ AcpiSsdtSerialPortLibConstructor()

EFI_STATUS EFIAPI AcpiSsdtSerialPortLibConstructor ( 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 329 of file SsdtSerialPortGenerator.c.

◆ AcpiSsdtSerialPortLibDestructor()

EFI_STATUS EFIAPI AcpiSsdtSerialPortLibDestructor ( 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 358 of file SsdtSerialPortGenerator.c.

◆ BuildSsdtSerialPortTableEx()

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.

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 162 of file SsdtSerialPortGenerator.c.

◆ FreeSsdtSerialPortTableEx()

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.

Parameters
[in]ThisPointer to the ACPI table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in,out]TablePointer to an array of pointers to ACPI Table(s).
[in]TableCountNumber of ACPI table(s).
Return values
EFI_SUCCESSThe resources were freed successfully.
EFI_INVALID_PARAMETERThe table pointer is NULL or invalid.

Definition at line 78 of file SsdtSerialPortGenerator.c.

◆ GET_OBJECT_LIST()

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:

  • EArchCommonObjSerialPortInfo This macro expands to a function that retrieves the Serial-port information from the Configuration Manager.

Variable Documentation

◆ SsdtSerialPortGenerator

STATIC CONST ACPI_TABLE_GENERATOR SsdtSerialPortGenerator
Initial value:
= {
L"ACPI.STD.SSDT.SERIAL.PORT.GENERATOR",
0,
0,
}
#define EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE
Definition: Acpi63.h:2831
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdSsdtSerialPort
SSDT Serial-Port Generator.
#define NULL
Definition: Base.h:319
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)
#define SSDT_SERIAL_GENERATOR_REVISION

The interface for the SSDT Serial Port Table Generator.

Definition at line 292 of file SsdtSerialPortGenerator.c.