From patchwork Wed May 13 23:53:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 48472 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C298621411 for ; Wed, 13 May 2015 23:54:38 +0000 (UTC) Received: by wivs14 with SMTP id s14sf15812272wiv.1 for ; Wed, 13 May 2015 16:54:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=anaMjF2JrNGrkSySqf0q07QzAv+WuzeSSRWLTIMw624=; b=CfrYe8DyTMa0kp/2W6ORzCGonuxDwvmtAmUU/r6b78PGlrb8bOHBSReoLWqYaYKLk9 FHUPfAMvW2Jzpuo9IQ5/XVktAQY5gnYuwcBSYbI3Bj2xvsKPd1GfboaU7nWcTA8kQc5P fsXWj9OMjhhF2d7MAhZbAwa5c5pz8mh3Yh5zivgZHbMMm3gKFvr6p1o90BuaxZueIjcc uXyRdOmbLDQKzmi17kMfbK+9TljQxhE68ZXiw5kUAXYxknCw6ZXmIGGtePkv5p8RMjoy phuOTR10a/QQaNP/pbSgN4aeufooFKKegVG3dYS6SI3hSbPbf94HjD1fnWY3VsOfT03d 8Huw== X-Gm-Message-State: ALoCoQnfLcn4UFVp6s3NswMIRuG95QnsFUfsbVZR1iz9GzhstaN9J3Pc2e7/hnb9lp/jarj5L2X5 X-Received: by 10.112.55.104 with SMTP id r8mr973388lbp.18.1431561278007; Wed, 13 May 2015 16:54:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.74 with SMTP id q10ls339751lah.35.gmail; Wed, 13 May 2015 16:54:37 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr1045922lbc.32.1431561277785; Wed, 13 May 2015 16:54:37 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id e5si13314572lbd.89.2015.05.13.16.54.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2015 16:54:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by laat2 with SMTP id t2so45103289laa.1 for ; Wed, 13 May 2015 16:54:37 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr986746lbc.19.1431561277639; Wed, 13 May 2015 16:54:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp844903lbb; Wed, 13 May 2015 16:54:36 -0700 (PDT) X-Received: by 10.50.64.243 with SMTP id r19mr13854782igs.5.1431561273323; Wed, 13 May 2015 16:54:33 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id x129si12034919iod.15.2015.05.13.16.54.32 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 13 May 2015 16:54:33 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YsgTl-00058l-Ev; Wed, 13 May 2015 23:54:21 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YsgTj-00058b-SB for edk2-devel@lists.sourceforge.net; Wed, 13 May 2015 23:54:19 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.223.172 as permitted sender) client-ip=209.85.223.172; envelope-from=roy.franz@linaro.org; helo=mail-ie0-f172.google.com; Received: from mail-ie0-f172.google.com ([209.85.223.172]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YsgTi-00055e-6M for edk2-devel@lists.sourceforge.net; Wed, 13 May 2015 23:54:19 +0000 Received: by iebpz10 with SMTP id pz10so47070609ieb.2 for ; Wed, 13 May 2015 16:54:13 -0700 (PDT) X-Received: by 10.43.63.76 with SMTP id xd12mr11880692icb.11.1431561252915; Wed, 13 May 2015 16:54:12 -0700 (PDT) Received: from rfranz-v430.caveonetworks.com (64.2.3.194.ptr.us.xo.net. [64.2.3.194]) by mx.google.com with ESMTPSA id b8sm15350575ioe.23.2015.05.13.16.54.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2015 16:54:11 -0700 (PDT) From: Roy Franz To: edk2-devel@lists.sourceforge.net, linaro-uefi@lists.linaro.org, feng.tian@intel.com Date: Wed, 13 May 2015 16:53:58 -0700 Message-Id: <1431561241-1411-2-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431561241-1411-1-git-send-email-roy.franz@linaro.org> References: <1431561241-1411-1-git-send-email-roy.franz@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1YsgTi-00055e-6M Subject: [edk2] [RFC 1/4] Add "LinuxTerm" terminal type to TerminalDxe X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: roy.franz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This patch adds new terminal type, LinuxTerm, to TerminalDxe. This terminal type provides a place to add support for various Linux terminals that don't behave like standard VT terminals. Signed-off-by: Roy Franz Contributed-under: TianoCore Contribution Agreement 1.0 --- BaseTools/Source/C/Include/Guid/PcAnsi.h | 6 +++ .../Foundation/Efi/Guid/PcAnsi/PcAnsi.c | 2 + .../Foundation/Efi/Guid/PcAnsi/PcAnsi.h | 6 +++ .../Universal/BdsDxe/BootMaint/BootMaint.h | 2 +- .../Universal/BdsDxe/BootMaint/Data.c | 5 ++- .../Universal/Console/TerminalDxe/Terminal.c | 44 ++++++++++++++++++---- .../Universal/Console/TerminalDxe/Terminal.h | 1 + .../Universal/Console/TerminalDxe/TerminalConIn.c | 4 +- .../Universal/Console/TerminalDxe/TerminalConOut.c | 2 + .../Universal/Console/TerminalDxe/TerminalDxe.inf | 1 + MdePkg/Include/Guid/PcAnsi.h | 6 +++ MdePkg/Include/Protocol/DevicePath.h | 1 + .../Library/UefiDevicePathLib/DevicePathFromText.c | 27 +++++++++++++ .../Library/UefiDevicePathLib/DevicePathToText.c | 3 ++ .../UefiDevicePathLib/UefiDevicePathLib.inf | 2 + ...UefiDevicePathLibOptionalDevicePathProtocol.inf | 4 +- MdePkg/MdePkg.dec | 3 ++ .../UefiHandleParsingLib/UefiHandleParsingLib.c | 1 + .../UefiHandleParsingLib/UefiHandleParsingLib.inf | 1 + 19 files changed, 109 insertions(+), 12 deletions(-) diff --git a/BaseTools/Source/C/Include/Guid/PcAnsi.h b/BaseTools/Source/C/Include/Guid/PcAnsi.h index 9f12ca2..188a9b1 100644 --- a/BaseTools/Source/C/Include/Guid/PcAnsi.h +++ b/BaseTools/Source/C/Include/Guid/PcAnsi.h @@ -38,6 +38,11 @@ 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \ } +#define EFI_LINUX_TERM_GUID \ + { \ + 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 } \ + } + #define EFI_UART_DEVICE_PATH_GUID \ { \ 0x37499a9d, 0x542f, 0x4c89, {0xa0, 0x26, 0x35, 0xda, 0x14, 0x20, 0x94, 0xe4 } \ @@ -52,6 +57,7 @@ extern EFI_GUID gEfiPcAnsiGuid; extern EFI_GUID gEfiVT100Guid; extern EFI_GUID gEfiVT100PlusGuid; extern EFI_GUID gEfiVTUTF8Guid; +extern EFI_GUID gEfiLinuxTermGuid; extern EFI_GUID gEfiUartDevicePathGuid; extern EFI_GUID gEfiSasDevicePathGuid; diff --git a/EdkCompatibilityPkg/Foundation/Efi/Guid/PcAnsi/PcAnsi.c b/EdkCompatibilityPkg/Foundation/Efi/Guid/PcAnsi/PcAnsi.c index 1f184e6..c6852b1 100644 --- a/EdkCompatibilityPkg/Foundation/Efi/Guid/PcAnsi/PcAnsi.c +++ b/EdkCompatibilityPkg/Foundation/Efi/Guid/PcAnsi/PcAnsi.c @@ -27,8 +27,10 @@ EFI_GUID gEfiPcAnsiGuid = EFI_PC_ANSI_GUID; EFI_GUID gEfiVT100Guid = EFI_VT_100_GUID; EFI_GUID gEfiVT100PlusGuid = EFI_VT_100_PLUS_GUID; EFI_GUID gEfiVTUTF8Guid = EFI_VT_UTF8_GUID; +EFI_GUID gEfiLinuxTermGuid = EFI_LINUX_TERM_GUID; EFI_GUID_STRING(&gEfiPcAnsiGuid, "Efi", "Efi PC ANSI Device Path Vendor GUID") EFI_GUID_STRING(&gEfiVT100Guid, "Efi", "Efi VT100 Device Path Vendor GUID") EFI_GUID_STRING(&gEfiVT100PlusGuid, "Efi", "Efi VT100Plus Device Path Vendor GUID") EFI_GUID_STRING(&gEfiVTUTF8Guid, "Efi", "Efi VTUTF8 Device Path Vendor GUID") +EFI_GUID_STRING(&gEfiLinuxTermGuid, "Efi", "Efi Linux Terminal Device Path Vendor GUID") diff --git a/EdkCompatibilityPkg/Foundation/Efi/Guid/PcAnsi/PcAnsi.h b/EdkCompatibilityPkg/Foundation/Efi/Guid/PcAnsi/PcAnsi.h index 7181020..9461a35 100644 --- a/EdkCompatibilityPkg/Foundation/Efi/Guid/PcAnsi/PcAnsi.h +++ b/EdkCompatibilityPkg/Foundation/Efi/Guid/PcAnsi/PcAnsi.h @@ -42,9 +42,15 @@ Abstract: 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} \ } +#define EFI_LINUX_TERM_GUID \ + { \ + 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 } \ + } + extern EFI_GUID gEfiPcAnsiGuid; extern EFI_GUID gEfiVT100Guid; extern EFI_GUID gEfiVT100PlusGuid; extern EFI_GUID gEfiVTUTF8Guid; +extern EFI_GUID gEfiLinuxTermGuid; #endif diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h index 098692f..bfa9b63 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h @@ -1657,7 +1657,7 @@ extern COM_ATTR BaudRateList[19]; extern COM_ATTR DataBitsList[4]; extern COM_ATTR ParityList[5]; extern COM_ATTR StopBitsList[3]; -extern EFI_GUID TerminalTypeGuid[4]; +extern EFI_GUID TerminalTypeGuid[5]; extern STRING_DEPOSITORY *FileOptionStrDepository; extern STRING_DEPOSITORY *ConsoleOptionStrDepository; extern STRING_DEPOSITORY *BootOptionStrDepository; diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c index 0a3ffbc..3f22efa 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c @@ -324,9 +324,10 @@ COM_ATTR StopBitsList[3] = { /// /// Guid for messaging path, used in Serial port setting. /// -EFI_GUID TerminalTypeGuid[4] = { +EFI_GUID TerminalTypeGuid[5] = { DEVICE_PATH_MESSAGING_PC_ANSI, DEVICE_PATH_MESSAGING_VT_100, DEVICE_PATH_MESSAGING_VT_100_PLUS, - DEVICE_PATH_MESSAGING_VT_UTF8 + DEVICE_PATH_MESSAGING_VT_UTF8, + DEVICE_PATH_MESSAGING_LINUX_TERM }; diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index 966fb79..3371dcc 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -33,7 +33,8 @@ EFI_GUID *gTerminalType[] = { &gEfiPcAnsiGuid, &gEfiVT100Guid, &gEfiVT100PlusGuid, - &gEfiVTUTF8Guid + &gEfiVTUTF8Guid, + &gEfiLinuxTermGuid }; @@ -152,12 +153,13 @@ TerminalDriverBindingSupported ( } // - // only supports PC ANSI, VT100, VT100+ and VT-UTF8 terminal types + // only supports PC ANSI, VT100, VT100+, VT-UTF8, and Linux terminal types // if (!CompareGuid (&Node->Guid, &gEfiPcAnsiGuid) && !CompareGuid (&Node->Guid, &gEfiVT100Guid) && !CompareGuid (&Node->Guid, &gEfiVT100PlusGuid) && - !CompareGuid (&Node->Guid, &gEfiVTUTF8Guid)) { + !CompareGuid (&Node->Guid, &gEfiVTUTF8Guid) && + !CompareGuid (&Node->Guid, &gEfiLinuxTermGuid)) { return EFI_UNSUPPORTED; } @@ -275,6 +277,10 @@ BuildTerminalDevpath ( TerminalType = VTUTF8TYPE; + } else if (CompareGuid (&Node->Guid, &gEfiLinuxTermGuid)) { + + TerminalType = LINUXTERMTYPE; + } else { return NULL; } @@ -708,9 +714,9 @@ TerminalDriverBindingStart ( TerminalType = PcdGet8 (PcdDefaultTerminalType); // - // Must be between PCANSITYPE (0) and VTUTF8TYPE (3) + // Must be between PCANSITYPE (0) and LINUXTERMTYPE (4) // - ASSERT (TerminalType <= VTUTF8TYPE); + ASSERT (TerminalType <= LINUXTERMTYPE); CopyMem (&DefaultNode->Guid, gTerminalType[TerminalType], sizeof (EFI_GUID)); RemainingDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DefaultNode; @@ -728,6 +734,8 @@ TerminalDriverBindingStart ( TerminalType = VT100PLUSTYPE; } else if (CompareGuid (&Node->Guid, &gEfiVTUTF8Guid)) { TerminalType = VTUTF8TYPE; + } else if (CompareGuid (&Node->Guid, &gEfiLinuxTermGuid)) { + TerminalType = LINUXTERMTYPE; } else { goto Error; } @@ -926,6 +934,24 @@ TerminalDriverBindingStart ( ); break; + + case LINUXTERMTYPE: + AddUnicodeString2 ( + "eng", + gTerminalComponentName.SupportedLanguages, + &TerminalDevice->ControllerNameTable, + (CHAR16 *)L"Linux Terminal Serial Console", + TRUE + ); + AddUnicodeString2 ( + "en", + gTerminalComponentName2.SupportedLanguages, + &TerminalDevice->ControllerNameTable, + (CHAR16 *)L"Linux Terminal Serial Console", + FALSE + ); + + break; } // @@ -1441,7 +1467,7 @@ TerminalUpdateConsoleDevVariable ( // // Append terminal device path onto the variable. // - for (TerminalType = PCANSITYPE; TerminalType <= VTUTF8TYPE; TerminalType++) { + for (TerminalType = PCANSITYPE; TerminalType <= LINUXTERMTYPE; TerminalType++) { SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath); NewVariable = AppendDevicePathInstance (Variable, TempDevicePath); ASSERT (NewVariable != NULL); @@ -1554,7 +1580,7 @@ TerminalRemoveConsoleDevVariable ( // Loop through all the terminal types that this driver supports // Match = FALSE; - for (TerminalType = PCANSITYPE; TerminalType <= VTUTF8TYPE; TerminalType++) { + for (TerminalType = PCANSITYPE; TerminalType <= LINUXTERMTYPE; TerminalType++) { SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath); @@ -1658,6 +1684,10 @@ SetTerminalDevicePath ( CopyGuid (&Node.Guid, &gEfiVTUTF8Guid); break; + case LINUXTERMTYPE: + CopyGuid (&Node.Guid, &gEfiLinuxTermGuid); + break; + default: return EFI_UNSUPPORTED; } diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h index d393acb..e0335db 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h @@ -136,6 +136,7 @@ typedef union { #define VT100TYPE 1 #define VT100PLUSTYPE 2 #define VTUTF8TYPE 3 +#define LINUXTERMTYPE 4 #define LEFTOPENBRACKET 0x5b // '[' #define ACAP 0x41 diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index 4a008c9..51492f3 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c @@ -454,6 +454,7 @@ TranslateRawDataToEfiKey ( case PCANSITYPE: case VT100TYPE: case VT100PLUSTYPE: + case LINUXTERMTYPE: AnsiRawDataToUnicode (TerminalDevice); UnicodeToEfiKey (TerminalDevice); break; @@ -1393,7 +1394,8 @@ UnicodeToEfiKey ( if (TerminalDevice->TerminalType == PCANSITYPE || TerminalDevice->TerminalType == VT100TYPE || TerminalDevice->TerminalType == VT100PLUSTYPE || - TerminalDevice->TerminalType == VTUTF8TYPE) { + TerminalDevice->TerminalType == VTUTF8TYPE || + TerminalDevice->TerminalType == LINUXTERMTYPE) { switch (UnicodeChar) { case 'A': Key.ScanCode = SCAN_UP; diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c index affb3ae..868a014 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c @@ -223,6 +223,7 @@ TerminalConOutOutputString ( case PCANSITYPE: case VT100TYPE: case VT100PLUSTYPE: + case LINUXTERMTYPE: if (!TerminalIsValidTextGraphics (*WString, &GraphicChar, &AsciiChar)) { // @@ -371,6 +372,7 @@ TerminalConOutTestString ( case PCANSITYPE: case VT100TYPE: case VT100PLUSTYPE: + case LINUXTERMTYPE: Status = AnsiTestString (TerminalDevice, WString); break; diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf index 1d86388..7c6e3d3 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf @@ -73,6 +73,7 @@ gEfiVT100Guid ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path gEfiVT100PlusGuid ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path gEfiPcAnsiGuid ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path + gEfiLinuxTermGuid ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path gEdkiiStatusCodeDataTypeVariableGuid ## SOMETIMES_CONSUMES ## GUID [Protocols] diff --git a/MdePkg/Include/Guid/PcAnsi.h b/MdePkg/Include/Guid/PcAnsi.h index e576fd3..61759f8 100644 --- a/MdePkg/Include/Guid/PcAnsi.h +++ b/MdePkg/Include/Guid/PcAnsi.h @@ -38,6 +38,11 @@ 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \ } +#define EFI_LINUX_TERM_GUID \ + { \ + 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 } \ + } + #define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL \ { \ 0x37499a9d, 0x542f, 0x4c89, {0xa0, 0x26, 0x35, 0xda, 0x14, 0x20, 0x94, 0xe4 } \ @@ -52,6 +57,7 @@ extern EFI_GUID gEfiPcAnsiGuid; extern EFI_GUID gEfiVT100Guid; extern EFI_GUID gEfiVT100PlusGuid; extern EFI_GUID gEfiVTUTF8Guid; +extern EFI_GUID gEfiLinuxTermGuid; extern EFI_GUID gEfiUartDevicePathGuid; extern EFI_GUID gEfiSasDevicePathGuid; diff --git a/MdePkg/Include/Protocol/DevicePath.h b/MdePkg/Include/Protocol/DevicePath.h index 7cf7113..a718bd4 100644 --- a/MdePkg/Include/Protocol/DevicePath.h +++ b/MdePkg/Include/Protocol/DevicePath.h @@ -706,6 +706,7 @@ typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH; #define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID #define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID #define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID +#define DEVICE_PATH_MESSAGING_LINUX_TERM EFI_LINUX_TERM_GUID /// /// A new device path node is defined to declare flow control characteristics. diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c index 6ec0a4c..f473b39 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c @@ -1545,6 +1545,32 @@ DevPathFromTextVenUtf8 ( } /** + Converts a text device path node to Vendor defined Linux terminal device + path structure. + + @param TextDeviceNode The input Text device path node. + + @return A pointer to the newly-created Vendor defined Linux terminal + device path structure. + +**/ +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextVenLinuxTerm ( + IN CHAR16 *TextDeviceNode + ) +{ + VENDOR_DEVICE_PATH *Vendor; + + Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_VENDOR_DP, + (UINT16) sizeof (VENDOR_DEVICE_PATH)); + CopyGuid (&Vendor->Guid, &gEfiLinuxTermGuid); + + return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; +} + +/** Converts a text device path node to UART Flow Control device path structure. @param TextDeviceNode The input Text device path node. @@ -3075,6 +3101,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP {L"VenVt100", DevPathFromTextVenVt100 }, {L"VenVt100Plus", DevPathFromTextVenVt100Plus }, {L"VenUtf8", DevPathFromTextVenUtf8 }, + {L"VenLinuxTerm", DevPathFromTextVenLinuxTerm }, {L"UartFlowCtrl", DevPathFromTextUartFlowCtrl }, {L"SAS", DevPathFromTextSAS }, {L"SasEx", DevPathFromTextSasEx }, diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c index 0300019..f7df807 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c @@ -194,6 +194,9 @@ DevPathToTextVendor ( } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) { UefiDevicePathLibCatPrint (Str, L"VenUft8()"); return ; + } else if (CompareGuid (&Vendor->Guid, &gEfiLinuxTermGuid)) { + UefiDevicePathLibCatPrint (Str, L"VenLinuxTerm()"); + return ; } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid)) { FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap); switch (FlowControlMap & 0x00000003) { diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf index f4ae91f..a1bad14 100644 --- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf @@ -58,6 +58,8 @@ ## SOMETIMES_CONSUMES ## GUID gEfiPcAnsiGuid ## SOMETIMES_CONSUMES ## GUID + gEfiLinuxTermGuid + ## SOMETIMES_CONSUMES ## GUID gEfiUartDevicePathGuid ## SOMETIMES_CONSUMES ## GUID gEfiSasDevicePathGuid diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf index 943ba2d..b529400 100644 --- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf @@ -62,6 +62,8 @@ ## SOMETIMES_CONSUMES ## GUID gEfiPcAnsiGuid ## SOMETIMES_CONSUMES ## GUID + gEfiLinuxTermGuid + ## SOMETIMES_CONSUMES ## GUID gEfiUartDevicePathGuid ## SOMETIMES_CONSUMES ## GUID gEfiSasDevicePathGuid @@ -78,4 +80,4 @@ [Depex.common.DXE_DRIVER, Depex.common.DXE_RUNTIME_DRIVER, Depex.common.DXE_SAL_DRIVER, Depex.common.DXE_SMM_DRIVER] gEfiDevicePathUtilitiesProtocolGuid - \ No newline at end of file + diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index f9c9d5f..b1b0038 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -269,6 +269,9 @@ gEfiVTUTF8Guid = { 0xAD15A0D6, 0x8BEC, 0x4ACF, { 0xA0, 0x73, 0xD0, 0x1D, 0xE7, 0x7E, 0x2D, 0x88 }} ## Include/Guid/PcAnsi.h + gEfiLinuxTermGuid = { 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 }} + + ## Include/Guid/PcAnsi.h gEfiUartDevicePathGuid = { 0x37499a9d, 0x542f, 0x4c89, { 0xa0, 0x26, 0x35, 0xda, 0x14, 0x20, 0x94, 0xe4 }} ## Include/Guid/PcAnsi.h diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c index 9a2daa9..9baaed7 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c @@ -848,6 +848,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = { {STRING_TOKEN(STR_DEVICE_PATH_VT100), &gEfiVT100Guid, NULL}, {STRING_TOKEN(STR_DEVICE_PATH_VT100P), &gEfiVT100PlusGuid, NULL}, {STRING_TOKEN(STR_DEVICE_PATH_VTUTF8), &gEfiVTUTF8Guid, NULL}, + {STRING_TOKEN(STR_DEVICE_PATH_LINUXTERM), &gEfiLinuxTermGuid, NULL}, {STRING_TOKEN(STR_DRIVER_BINDING), &gEfiDriverBindingProtocolGuid, NULL}, {STRING_TOKEN(STR_PLATFORM_OVERRIDE), &gEfiPlatformDriverOverrideProtocolGuid, NULL}, {STRING_TOKEN(STR_BUS_OVERRIDE), &gEfiBusSpecificDriverOverrideProtocolGuid, NULL}, diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf index c95f41b..716dbd7 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf @@ -181,6 +181,7 @@ gEfiVT100Guid ##UNDEFINED gEfiVT100PlusGuid ##UNDEFINED gEfiVTUTF8Guid ##UNDEFINED + gEfiLinuxTermGuid ##UNDEFINED gEfiStandardErrorDeviceGuid ##UNDEFINED gEfiConsoleInDeviceGuid ##UNDEFINED gEfiConsoleOutDeviceGuid ##UNDEFINED