49#define SERIAL_PORT_START_UID 2
60#define MAX_SERIAL_PORTS_SUPPORTED 14
90 ASSERT (This !=
NULL);
91 ASSERT (AcpiTableInfo !=
NULL);
92 ASSERT (CfgMgrProtocol !=
NULL);
93 ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
94 ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
96 if ((Table ==
NULL) ||
100 DEBUG ((DEBUG_ERROR,
"ERROR: SSDT-SERIAL-PORT: Invalid Table Pointer\n"));
101 return EFI_INVALID_PARAMETER;
106 for (Index = 0; Index < TableCount; Index++) {
107 if ((TableList[Index] !=
NULL) &&
108 (TableList[Index]->Signature ==
113 Status = EFI_INVALID_PARAMETER;
116 if (EFI_ERROR (Status)) {
119 "ERROR: SSDT-SERIAL-PORT: Could not free SSDT table at index %d."
172 UINT32 SerialPortCount;
174 CHAR8 NewName[AML_NAME_SEG_SIZE + 1];
178 ASSERT (This !=
NULL);
179 ASSERT (AcpiTableInfo !=
NULL);
180 ASSERT (CfgMgrProtocol !=
NULL);
181 ASSERT (Table !=
NULL);
182 ASSERT (TableCount !=
NULL);
183 ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
184 ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
188 Status = GetEArchCommonObjSerialPortInfo (
194 if (EFI_ERROR (Status)) {
197 "ERROR: SSDT-SERIAL-PORT: Failed to get serial port information."
207 "ERROR: SSDT-SERIAL-PORT: Too many serial ports: %d."
208 " Maximum serial ports supported = %d.\n",
212 return EFI_INVALID_PARAMETER;
217 if (EFI_ERROR (Status)) {
220 "ERROR: SSDT-SERIAL-PORT: Invalid serial port information. Status = %r\n",
231 if (TableList ==
NULL) {
232 Status = EFI_OUT_OF_RESOURCES;
235 "ERROR: SSDT-SERIAL-PORT: Failed to allocate memory for Table List."
250 for (Index = 0; Index < SerialPortCount; Index++) {
257 &SerialPortInfo[Index],
262 if (EFI_ERROR (Status)) {
265 "ERROR: SSDT-SERIAL-PORT: Failed to build associated SSDT table."
286#define SSDT_SERIAL_GENERATOR_REVISION CREATE_REVISION (1, 0)
296 L
"ACPI.STD.SSDT.SERIAL.PORT.GENERATOR",
339 "SSDT-SERIAL-PORT: Register Generator. Status = %r\n",
368 "SSDT-SERIAL-PORT: Deregister Generator. Status = %r\n",
#define EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE
UINT8 EFIAPI AsciiFromHex(IN UINT8 Hex)
EFI_STATUS EFIAPI RegisterAcpiTableGenerator(IN CONST ACPI_TABLE_GENERATOR *CONST Generator)
EFI_STATUS EFIAPI DeregisterAcpiTableGenerator(IN CONST ACPI_TABLE_GENERATOR *CONST Generator)
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdSsdtSerialPort
SSDT Serial-Port Generator.
@ EArchCommonObjSerialPortInfo
2 - Generic Serial Port Info
#define GET_OBJECT_LIST(CmObjectNameSpace, CmObjectId, Type)
@ EObjNameSpaceArchCommon
Arch Common Objects Namespace.
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
EFI_STATUS EFIAPI ValidateSerialPortInfo(IN CONST CM_ARCH_COMMON_SERIAL_PORT_INFO *SerialPortInfoTable, IN UINT32 SerialPortCount)
EFI_STATUS EFIAPI FreeSsdtSerialPortTable(IN EFI_ACPI_DESCRIPTION_HEADER *Table)
EFI_STATUS EFIAPI BuildSsdtSerialPortTable(IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *AcpiTableInfo, IN CONST CM_ARCH_COMMON_SERIAL_PORT_INFO *SerialPortInfo, IN CONST CHAR8 *Name, IN CONST UINT64 Uid, OUT EFI_ACPI_DESCRIPTION_HEADER **Table)
STATIC CONST ACPI_TABLE_GENERATOR SsdtSerialPortGenerator
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)
#define SERIAL_PORT_START_UID
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)
#define MAX_SERIAL_PORTS_SUPPORTED
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