Skip to content

Commit ffd207b

Browse files
committed
MdePkg/Library/UefiDevicePathLib: add human-readable tag for gEfiTtyTermGuid
Signed-off-by: Filip Lewiński <[email protected]>
1 parent cf6a1f0 commit ffd207b

File tree

9 files changed

+68
-0
lines changed

9 files changed

+68
-0
lines changed

BaseTools/Source/C/DevicePath/DevicePath.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
2121

2222
EFI_GUID gEfiDebugPortProtocolGuid = DEVICE_PATH_MESSAGING_DEBUGPORT;
2323
EFI_GUID gEfiPcAnsiGuid = EFI_PC_ANSI_GUID;
24+
EFI_GUID gEfiTtyTermGuid = EFI_TTY_TERM_GUID;
2425
EFI_GUID gEfiVT100Guid = EFI_VT_100_GUID;
2526
EFI_GUID gEfiVT100PlusGuid = EFI_VT_100_PLUS_GUID;
2627
EFI_GUID gEfiVTUTF8Guid = EFI_VT_UTF8_GUID;

BaseTools/Source/C/DevicePath/DevicePathFromText.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,30 @@ DevPathFromTextVenUtf8 (
12411241
return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;
12421242
}
12431243

1244+
/**
1245+
Converts a text device path node to Vendor defined TtyTerm device path structure.
1246+
1247+
@param TextDeviceNode The input Text device path node.
1248+
1249+
@return A pointer to the newly-created Vendor defined TtyTerm device path structure.
1250+
1251+
**/
1252+
EFI_DEVICE_PATH_PROTOCOL *
1253+
DevPathFromTextVenTtyTerm (
1254+
CHAR16 *TextDeviceNode
1255+
)
1256+
{
1257+
VENDOR_DEVICE_PATH *Vendor;
1258+
1259+
Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode (
1260+
MESSAGING_DEVICE_PATH,
1261+
MSG_VENDOR_DP,
1262+
(UINT16) sizeof (VENDOR_DEVICE_PATH));
1263+
CopyGuid (&Vendor->Guid, &gEfiTtyTermGuid);
1264+
1265+
return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;
1266+
}
1267+
12441268
/**
12451269
Converts a text device path node to UART Flow Control device path structure.
12461270
@@ -3335,6 +3359,7 @@ DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevPathFromTextTable[] = {
33353359
{L"VenVt100", DevPathFromTextVenVt100 },
33363360
{L"VenVt100Plus", DevPathFromTextVenVt100Plus },
33373361
{L"VenUtf8", DevPathFromTextVenUtf8 },
3362+
{L"VenTtyTerm", DevPathFromTextVenTtyTerm },
33383363
{L"UartFlowCtrl", DevPathFromTextUartFlowCtrl },
33393364
{L"SAS", DevPathFromTextSAS },
33403365
{L"SasEx", DevPathFromTextSasEx },

BaseTools/Source/C/Include/Guid/PcAnsi.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
{ \
3232
0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \
3333
}
34+
35+
#define EFI_TTY_TERM_GUID \
36+
{ \
37+
0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 } \
38+
}
3439

3540
#define EFI_UART_DEVICE_PATH_GUID \
3641
{ \
@@ -46,6 +51,7 @@ extern EFI_GUID gEfiPcAnsiGuid;
4651
extern EFI_GUID gEfiVT100Guid;
4752
extern EFI_GUID gEfiVT100PlusGuid;
4853
extern EFI_GUID gEfiVTUTF8Guid;
54+
extern EFI_GUID gEfiTtyTermGuid;
4955
extern EFI_GUID gEfiUartDevicePathGuid;
5056
extern EFI_GUID gEfiSasDevicePathGuid;
5157

MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,30 @@ DevPathFromTextVenUtf8 (
14111411
return (EFI_DEVICE_PATH_PROTOCOL *)Vendor;
14121412
}
14131413

1414+
/**
1415+
Converts a text device path node to Vendor defined TtyTerm device path structure.
1416+
1417+
@param TextDeviceNode The input Text device path node.
1418+
1419+
@return A pointer to the newly-created Vendor defined TtyTerm device path structure.
1420+
1421+
**/
1422+
EFI_DEVICE_PATH_PROTOCOL *
1423+
DevPathFromTextVenTtyTerm (
1424+
CHAR16 *TextDeviceNode
1425+
)
1426+
{
1427+
VENDOR_DEVICE_PATH *Vendor;
1428+
1429+
Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode (
1430+
MESSAGING_DEVICE_PATH,
1431+
MSG_VENDOR_DP,
1432+
(UINT16) sizeof (VENDOR_DEVICE_PATH));
1433+
CopyGuid (&Vendor->Guid, &gEfiTtyTermGuid);
1434+
1435+
return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;
1436+
}
1437+
14141438
/**
14151439
Converts a text device path node to UART Flow Control device path structure.
14161440
@@ -3508,6 +3532,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDev
35083532
{ L"VenVt100", DevPathFromTextVenVt100 },
35093533
{ L"VenVt100Plus", DevPathFromTextVenVt100Plus },
35103534
{ L"VenUtf8", DevPathFromTextVenUtf8 },
3535+
{ L"VenTtyTerm", DevPathFromTextVenTtyTerm },
35113536
{ L"UartFlowCtrl", DevPathFromTextUartFlowCtrl },
35123537
{ L"SAS", DevPathFromTextSAS },
35133538
{ L"SasEx", DevPathFromTextSasEx },

MdePkg/Library/UefiDevicePathLib/DevicePathToText.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ DevPathToTextVendor (
192192
} else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {
193193
UefiDevicePathLibCatPrint (Str, L"VenUtf8()");
194194
return;
195+
} else if (CompareGuid (&Vendor->Guid, &gEfiTtyTermGuid)) {
196+
UefiDevicePathLibCatPrint (Str, L"TtyTerm()");
197+
return;
195198
} else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid)) {
196199
FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *)Vendor)->FlowControlMap);
197200
switch (FlowControlMap & 0x00000003) {

MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
## SOMETIMES_CONSUMES ## GUID
5555
gEfiPcAnsiGuid
5656
## SOMETIMES_CONSUMES ## GUID
57+
gEfiTtyTermGuid
58+
## SOMETIMES_CONSUMES ## GUID
5759
gEfiUartDevicePathGuid
5860
## SOMETIMES_CONSUMES ## GUID
5961
gEfiSasDevicePathGuid

MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibBase.inf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
## SOMETIMES_CONSUMES ## GUID
5656
gEfiPcAnsiGuid
5757
## SOMETIMES_CONSUMES ## GUID
58+
gEfiTtyTermGuid
59+
## SOMETIMES_CONSUMES ## GUID
5860
gEfiUartDevicePathGuid
5961
## SOMETIMES_CONSUMES ## GUID
6062
gEfiSasDevicePathGuid

MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
## SOMETIMES_CONSUMES ## GUID
5959
gEfiPcAnsiGuid
6060
## SOMETIMES_CONSUMES ## GUID
61+
gEfiTtyTermGuid
62+
## SOMETIMES_CONSUMES ## GUID
6163
gEfiUartDevicePathGuid
6264
## SOMETIMES_CONSUMES ## GUID
6365
gEfiSasDevicePathGuid

MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
## SOMETIMES_CONSUMES ## GUID
5959
gEfiPcAnsiGuid
6060
## SOMETIMES_CONSUMES ## GUID
61+
gEfiTtyTermGuid
62+
## SOMETIMES_CONSUMES ## GUID
6163
gEfiUartDevicePathGuid
6264
## SOMETIMES_CONSUMES ## GUID
6365
gEfiSasDevicePathGuid

0 commit comments

Comments
 (0)