From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=45.249.212.191; helo=huawei.com; envelope-from=guoheyi@huawei.com; receiver=edk2-devel@lists.01.org Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9BDC8201B0439 for ; Thu, 28 Feb 2019 00:06:43 -0800 (PST) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id CC78BF20B6374895B82F; Thu, 28 Feb 2019 16:06:37 +0800 (CST) Received: from linux-fhAnjn.huawei.com (10.175.104.222) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.408.0; Thu, 28 Feb 2019 16:06:29 +0800 From: Heyi Guo To: CC: , Jian J Wang , Hao Wu , Heyi Guo Date: Thu, 28 Feb 2019 16:05:10 +0800 Message-ID: <1551341112-21645-2-git-send-email-guoheyi@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551341112-21645-1-git-send-email-guoheyi@huawei.com> References: <1551341112-21645-1-git-send-email-guoheyi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.104.222] X-CFilter-Loop: Reflected Subject: [RFC 1/3] MdeModulePkg/StatusCode: Add PCD to enable runtime serial debug X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 X-List-Received-Date: Thu, 28 Feb 2019 08:06:43 -0000 Content-Type: text/plain 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 Cc: Hao Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo Signed-off-by: Heyi Guo --- 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

+ # TRUE - Reports StatusCode via Serial port at runtime.
+ # FALSE - Does not report StatusCode via Serial port at runtime.
+ # @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.

# TRUE - Stores StatusCode in memory.
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.
\n" "FALSE - Does not report StatusCode via Serial port.
" +#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.

\n" + "TRUE - Reports StatusCode via Serial port at runtime.
\n" + "FALSE - Does not report StatusCode via Serial port at runtime.
" + #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.

\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