public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "wenyi,xie" <xiewenyi2@huawei.com>
To: <devel@edk2.groups.io>, <jian.j.wang@intel.com>,
	<gaoliming@byosoft.com.cn>, <zhichao.gao@intel.com>,
	<ray.ni@intel.com>
Cc: <songdongkuang@huawei.com>, <xiewenyi2@huawei.com>
Subject: [PATCH EDK2 v1 1/1] MdeModulePkg/TerminalDxe:Adding a switch for Terminal
Date: Tue, 11 Oct 2022 19:12:52 +0800	[thread overview]
Message-ID: <20221011111252.3382816-2-xiewenyi2@huawei.com> (raw)
In-Reply-To: <20221011111252.3382816-1-xiewenyi2@huawei.com>

Adding a new PCD as switch to control Trlminal.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
---
 MdeModulePkg/MdeModulePkg.dec                              | 4 ++++
 MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 1 +
 MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c      | 4 ++++
 3 files changed, 9 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 58e6ab004882..c4cf7f474a43 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -2161,6 +2161,10 @@ [PcdsDynamic, PcdsDynamicEx]
   # @Prompt GHCB Pool Size
   gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize|0|UINT64|0x00030008
 
+  ## This dynamic PCD holds the Switch which decide whether to using Terminal or not.
+  # @Prompt Terminal Switch
+  gEfiMdeModulePkgTokenSpaceGuid.PcdTerminalSwitch|TRUE|BOOLEAN|0x01100002
+
 [PcdsDynamicEx]
   ## This dynamic PCD enables the default variable setting.
   #  Its value is the default store ID value. The default value is zero as Standard default.
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
index b2a8aeba8510..36f6875de61b 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
@@ -87,6 +87,7 @@ [Protocols]
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType           ## SOMETIMES_CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable    ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdTerminalSwitch          ## CONSUMES
 
 # [Event]
 # # Relative timer event set by UnicodeToEfiKey(), used to be one 2 seconds input timeout.
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
index e2d779c78378..c861eb00d6d2 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
@@ -1344,6 +1344,10 @@ InitializeTerminal (
 {
   EFI_STATUS  Status;
 
+  if (!PcdGetBool(PcdTerminalSwitch)) {
+    return EFI_UNSUPPORTED;
+  }
+
   //
   // Install driver model protocol(s).
   //
-- 
2.20.1.windows.1


  reply	other threads:[~2022-10-11 11:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11 11:12 [PATCH EDK2 v1 0/1] MdeModulePkg/TerminalDxe:Adding a switch for Terminal wenyi,xie
2022-10-11 11:12 ` wenyi,xie [this message]
2022-10-11 13:58 ` [edk2-devel] " Michael D Kinney
2022-10-12  9:24   ` wenyi,xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221011111252.3382816-2-xiewenyi2@huawei.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox