Skip to content

Commit 58e4a21

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

File tree

11 files changed

+102
-0
lines changed

11 files changed

+102
-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 },
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/** @file
2+
GUID definition for TtyTerm terminal type. The TtyTerm terminal aims to
3+
provide support for modern *nix terminals.
4+
5+
6+
Copyright (c) 2015 Linaro Ltd.
7+
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
8+
SPDX-License-Identifier: BSD-2-Clause-Patent
9+
10+
**/
11+
12+
#ifndef __TTYTERM_H__
13+
#define __TTYTERM_H__
14+
15+
#define EFI_TTY_TERM_GUID \
16+
{0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 } }
17+
18+
#define EDKII_LINUX_TERM_GUID \
19+
{0xe4364a7f, 0xf825, 0x430e, {0x9d, 0x3a, 0x9c, 0x9b, 0xe6, 0x81, 0x7c, 0xa5 } }
20+
21+
#define EDKII_XTERM_R6_GUID \
22+
{0xfbfca56b, 0xbb36, 0x4b78, {0xaa, 0xab, 0xbe, 0x1b, 0x97, 0xec, 0x7c, 0xcb } }
23+
24+
#define EDKII_VT400_GUID \
25+
{0x8e46dddd, 0x3d49, 0x4a9d, {0xb8, 0x75, 0x3c, 0x08, 0x6f, 0x6a, 0xa2, 0xbd } }
26+
27+
#define EDKII_SCO_TERM_GUID \
28+
{0xfc7dd6e0, 0x813c, 0x434d, {0xb4, 0xda, 0x3b, 0xd6, 0x49, 0xe9, 0xe1, 0x5a } }
29+
30+
extern EFI_GUID gEfiTtyTermGuid;
31+
extern EFI_GUID gEdkiiLinuxTermGuid;
32+
extern EFI_GUID gEdkiiXtermR6Guid;
33+
extern EFI_GUID gEdkiiVT400Guid;
34+
extern EFI_GUID gEdkiiSCOTermGuid;
35+
36+
#endif

BaseTools/Source/C/Include/Protocol/DevicePath.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
1414
#define __EFI_DEVICE_PATH_H__
1515

1616
#include <Guid/PcAnsi.h>
17+
#include <Guid/TtyTerm.h>
1718
#include <IndustryStandard/Acpi30.h>
1819
#include <IndustryStandard/Bluetooth.h>
1920

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)