public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Heyi Guo <guoheyi@huawei.com>
To: <edk2-devel@lists.01.org>
Cc: <wanghaibin.wang@huawei.com>, Jian J Wang <jian.j.wang@intel.com>,
	Hao Wu <hao.a.wu@intel.com>, Heyi Guo <heyi.guo@linaro.org>
Subject: [RFC 1/3] MdeModulePkg/StatusCode: Add PCD to enable runtime serial debug
Date: Thu, 28 Feb 2019 16:05:10 +0800	[thread overview]
Message-ID: <1551341112-21645-2-git-send-email-guoheyi@huawei.com> (raw)
In-Reply-To: <1551341112-21645-1-git-send-email-guoheyi@huawei.com>

Serial port message is useful when we are debugging UEFI runtime
services, so add a feature PCD to enable runtime serial debug.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Heyi Guo <guoheyi@huawei.com>
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
---
 MdeModulePkg/MdeModulePkg.dec                                                       | 6 ++++++
 MdeModulePkg/MdeModulePkg.uni                                                       | 6 ++++++
 MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c   | 2 +-
 MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf | 7 ++++---
 4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index a2130bc..19953cc 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -777,6 +777,12 @@
   # @Prompt Enable StatusCode via Serial port.
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE|BOOLEAN|0x00010022
 
+  ## Indicates if StatusCode is reported via Serial port at runtime; mainly for debug purpose<BR><BR>
+  #   TRUE  - Reports StatusCode via Serial port at runtime.<BR>
+  #   FALSE - Does not report StatusCode via Serial port at runtime.<BR>
+  # @Prompt Enable StatusCode via Serial port at runtime
+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerialRuntime|FALSE|BOOLEAN|0x00010024
+
   ## Indicates if StatusCode is stored in memory.
   #  The memory is boot time memory in PEI Phase and is runtime memory in DXE Phase.<BR><BR>
   #   TRUE  - Stores StatusCode in memory.<BR>
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index 787fdf2..122fc44 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -759,6 +759,12 @@
                                                                                         "TRUE  - Reports StatusCode via Serial port.<BR>\n"
                                                                                         "FALSE - Does not report StatusCode via Serial port.<BR>"
 
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdStatusCodeUseSerialRuntime_PROMPT  #language en-US "Enable StatusCode via Serial port at runtime"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdStatusCodeUseSerialRuntime_HELP  #language en-US "Indicates if StatusCode is reported via Serial port at runtime.<BR><BR>\n"
+                                                                                        "TRUE  - Reports StatusCode via Serial port at runtime.<BR>\n"
+                                                                                        "FALSE - Does not report StatusCode via Serial port at runtime.<BR>"
+
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdStatusCodeUseMemory_PROMPT  #language en-US "Enable StatusCode via memory"
 
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdStatusCodeUseMemory_HELP  #language en-US "Indicates if StatusCode is stored in memory. The memory is boot time memory in PEI Phase and is runtime memory in DXE Phase.<BR><BR>\n"
diff --git a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c
index e47e083..2142cfc 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c
+++ b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c
@@ -35,7 +35,7 @@ UnregisterBootTimeHandlers (
   IN VOID             *Context
   )
 {
-  if (FeaturePcdGet (PcdStatusCodeUseSerial)) {
+  if (FeaturePcdGet (PcdStatusCodeUseSerial) && !FeaturePcdGet (PcdStatusCodeUseSerialRuntime)) {
     mRscHandlerProtocol->Unregister (SerialStatusCodeReportWorker);
   }
 }
diff --git a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
index a0a37a4..cf25b22 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
+++ b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
@@ -64,9 +64,10 @@
   gEfiRscHandlerProtocolGuid                    ## CONSUMES
 
 [FeaturePcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeReplayIn  ## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeReplayIn         ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory        ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial        ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerialRuntime ## CONSUMES
 
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize |128| gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory   ## SOMETIMES_CONSUMES
-- 
1.8.3.1



  reply	other threads:[~2019-02-28  8:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28  8:05 [RFC 0/3] Enable runtime serial debug for ArmVirtQemu Heyi Guo
2019-02-28  8:05 ` Heyi Guo [this message]
2019-02-28  8:05 ` [RFC 2/3] ArmVirtPkg: add runtime instance of FdtPL011SerialPortLib Heyi Guo
2019-02-28  8:05 ` [RFC 3/3] ArmVirtQemu: enable runtime debug by build flag Heyi Guo
2019-02-28 12:10 ` [RFC 0/3] Enable runtime serial debug for ArmVirtQemu Ard Biesheuvel
2019-03-01 15:27   ` Laszlo Ersek
2019-03-04 13:52     ` Heyi Guo
2019-03-12  6:56     ` Heyi Guo
2019-03-12 17:05       ` Laszlo Ersek
2019-03-12 17:28         ` Andrew Fish
2019-03-12 19:42           ` Laszlo Ersek
2019-03-13 20:16           ` Brian J. Johnson
2019-03-14  3:52             ` Andrew Fish
2019-03-16  9:41         ` Heyi Guo
2019-03-20  9:55           ` Laszlo Ersek
2019-03-20 12:16             ` Heyi Guo
2019-03-20 17:47               ` Laszlo Ersek
2019-03-21  3:23                 ` Heyi Guo
2019-02-28 13:39 ` Laszlo Ersek
2019-03-01 12:24   ` Heyi Guo
2019-03-01 14:59     ` Laszlo Ersek
2019-03-01 15:14       ` Ard Biesheuvel
     [not found]       ` <CAFEAcA8AQjMJytpbXbBPH_YyuVW-PawhSgGeXaZGhVzRUPh9+A@mail.gmail.com>
2019-03-01 16:14         ` Laszlo Ersek

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=1551341112-21645-2-git-send-email-guoheyi@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