From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4D53E1A1E89 for ; Mon, 3 Oct 2016 09:27:04 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP; 03 Oct 2016 09:27:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,438,1473145200"; d="scan'208";a="15705760" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 03 Oct 2016 09:27:03 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 3 Oct 2016 09:27:03 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.167]) by fmsmsx117.amr.corp.intel.com ([169.254.3.249]) with mapi id 14.03.0248.002; Mon, 3 Oct 2016 09:27:02 -0700 From: "Carsey, Jaben" To: Cinnamon Shia , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , "Carsey, Jaben" Thread-Topic: [PATCH] ShellPkg/Shell: Update CRC32 in the EFI System Table header Thread-Index: AQHSHZFFEUgyzVAJ60efhRnR/FjIt6CW6rug Date: Mon, 3 Oct 2016 16:27:02 +0000 Message-ID: References: <20161003161411.7696-1-cinnamon.shia@hpe.com> In-Reply-To: <20161003161411.7696-1-cinnamon.shia@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGJkMzIwNjAtYjAyNi00N2VmLWFiNmMtNDNlYWYxMDVjM2ExIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImhqVysyM3ZYNFBcLzBuSUhKYnI2dUlXdkEyd1RrQWNJRWFkTWxWUmxqbjdnPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: [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:27:04 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Why add a CpuBreakPoint()? > -----Original Message----- > From: Cinnamon Shia [mailto:cinnamon.shia@hpe.com] > Sent: Monday, October 03, 2016 9:14 AM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben ; Ni, Ruiyu > ; Cinnamon Shia > Subject: [PATCH] ShellPkg/Shell: Update CRC32 in the EFI System Table > header > Importance: High >=20 > Update CRC32 in the EFI System Table header after shell changes the > value of gST->ConsoleOutHandle and gST->ConOut >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Cinnamon Shia > --- > ShellPkg/Application/Shell/ConsoleLogger.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) >=20 > 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 @@ >=20 > (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 =3D gImageHandle; > gST->ConOut =3D &(*ConsoleInfo)->OurConOut; >=20 > + // > + // Update the CRC32 in the EFI System Table header > + // > + CpuBreakpoint(); > + gST->Hdr.CRC32 =3D 0; > + gBS->CalculateCrc32 ( > + (UINT8 *)&gST->Hdr, > + gST->Hdr.HeaderSize, > + &gST->Hdr.CRC32 > + ); > return (Status); > } >=20 > @@ -126,6 +137,16 @@ ConsoleLoggerUninstall( > gST->ConsoleOutHandle =3D ConsoleInfo->OldConHandle; > gST->ConOut =3D ConsoleInfo->OldConOut; >=20 > + // > + // Update the CRC32 in the EFI System Table header > + // > + gST->Hdr.CRC32 =3D 0; > + gBS->CalculateCrc32 ( > + (UINT8 *)&gST->Hdr, > + gST->Hdr.HeaderSize, > + &gST->Hdr.CRC32 > + ); > + > return (gBS->UninstallProtocolInterface(gImageHandle, > &gEfiSimpleTextOutProtocolGuid, (VOID*)&ConsoleInfo->OurConOut)); > } >=20 > -- > 2.10.0.windows.1