From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g4t3428.houston.hpe.com (g4t3428.houston.hpe.com [15.241.140.76]) (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 4030A1A1E89 for ; Mon, 3 Oct 2016 09:14:38 -0700 (PDT) Received: from SHIAC15.asiapacific.hpqcorp.net (unknown [16.169.129.227]) by g4t3428.houston.hpe.com (Postfix) with ESMTP id EE7775C; Mon, 3 Oct 2016 16:14:34 +0000 (UTC) From: Cinnamon Shia To: edk2-devel@lists.01.org Cc: jaben.carsey@intel.com, ruiyu.ni@intel.com, Cinnamon Shia Date: Tue, 4 Oct 2016 00:14:11 +0800 Message-Id: <20161003161411.7696-1-cinnamon.shia@hpe.com> X-Mailer: git-send-email 2.10.0.windows.1 Subject: [PATCH] ShellPkg/Shell: Update CRC32 in the EFI System Table header X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2016 16:14:38 -0000 Update CRC32 in the EFI System Table header after shell changes the value of gST->ConsoleOutHandle and gST->ConOut Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia --- ShellPkg/Application/Shell/ConsoleLogger.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c b/ShellPkg/Application/Shell/ConsoleLogger.c index 9b64303..07b3f81 100644 --- a/ShellPkg/Application/Shell/ConsoleLogger.c +++ b/ShellPkg/Application/Shell/ConsoleLogger.c @@ -3,6 +3,7 @@ (C) Copyright 2013 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+ (C) Copyright 2016 Hewlett-Packard Development Company, L.P.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -91,6 +92,16 @@ ConsoleLoggerInstall( gST->ConsoleOutHandle = gImageHandle; gST->ConOut = &(*ConsoleInfo)->OurConOut; + // + // Update the CRC32 in the EFI System Table header + // + CpuBreakpoint(); + gST->Hdr.CRC32 = 0; + gBS->CalculateCrc32 ( + (UINT8 *)&gST->Hdr, + gST->Hdr.HeaderSize, + &gST->Hdr.CRC32 + ); return (Status); } @@ -126,6 +137,16 @@ ConsoleLoggerUninstall( gST->ConsoleOutHandle = ConsoleInfo->OldConHandle; gST->ConOut = ConsoleInfo->OldConOut; + // + // Update the CRC32 in the EFI System Table header + // + gST->Hdr.CRC32 = 0; + gBS->CalculateCrc32 ( + (UINT8 *)&gST->Hdr, + gST->Hdr.HeaderSize, + &gST->Hdr.CRC32 + ); + return (gBS->UninstallProtocolInterface(gImageHandle, &gEfiSimpleTextOutProtocolGuid, (VOID*)&ConsoleInfo->OurConOut)); } -- 2.10.0.windows.1