* [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI System Table header @ 2016-10-03 16:37 Cinnamon Shia 2016-10-03 16:39 ` Shah, Tapan 0 siblings, 1 reply; 3+ messages in thread From: Cinnamon Shia @ 2016-10-03 16:37 UTC (permalink / raw) To: edk2-devel; +Cc: jaben.carsey, ruiyu.ni, Cinnamon Shia 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 <cinnamon.shia@hpe.com> --- ShellPkg/Application/Shell/ConsoleLogger.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c b/ShellPkg/Application/Shell/ConsoleLogger.c index 9b64303..563e5e6 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.<BR> Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR> + (C) Copyright 2016 Hewlett-Packard Development Company, L.P.<BR> 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,15 @@ ConsoleLoggerInstall( gST->ConsoleOutHandle = gImageHandle; gST->ConOut = &(*ConsoleInfo)->OurConOut; + // + // 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 (Status); } @@ -126,6 +136,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 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI System Table header 2016-10-03 16:37 [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI System Table header Cinnamon Shia @ 2016-10-03 16:39 ` Shah, Tapan 2016-10-03 21:37 ` Carsey, Jaben 0 siblings, 1 reply; 3+ messages in thread From: Shah, Tapan @ 2016-10-03 16:39 UTC (permalink / raw) To: Shia, Cinnamon, edk2-devel@lists.01.org Cc: jaben.carsey@intel.com, ruiyu.ni@intel.com Reviewed-By: Tapan Shah <tapandshah@hpe.com> -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Shia, Cinnamon Sent: Monday, October 03, 2016 11:37 AM To: edk2-devel@lists.01.org Cc: jaben.carsey@intel.com; ruiyu.ni@intel.com Subject: [edk2] [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI System Table header 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 <cinnamon.shia@hpe.com> --- ShellPkg/Application/Shell/ConsoleLogger.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c b/ShellPkg/Application/Shell/ConsoleLogger.c index 9b64303..563e5e6 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.<BR> Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR> + (C) Copyright 2016 Hewlett-Packard Development Company, L.P.<BR> 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,15 @@ ConsoleLoggerInstall( gST->ConsoleOutHandle = gImageHandle; gST->ConOut = &(*ConsoleInfo)->OurConOut; + // + // 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 (Status); } @@ -126,6 +136,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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI System Table header 2016-10-03 16:39 ` Shah, Tapan @ 2016-10-03 21:37 ` Carsey, Jaben 0 siblings, 0 replies; 3+ messages in thread From: Carsey, Jaben @ 2016-10-03 21:37 UTC (permalink / raw) To: Shah, Tapan, Shia, Cinnamon, edk2-devel@lists.01.org Cc: Ni, Ruiyu, Carsey, Jaben Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> And pushed. > -----Original Message----- > From: Shah, Tapan [mailto:tapandshah@hpe.com] > Sent: Monday, October 03, 2016 9:39 AM > To: Shia, Cinnamon <cinnamon.shia@hpe.com>; edk2-devel@lists.01.org > Cc: Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com> > Subject: RE: [edk2] [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI > System Table header > Importance: High > > Reviewed-By: Tapan Shah <tapandshah@hpe.com> > > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Shia, Cinnamon > Sent: Monday, October 03, 2016 11:37 AM > To: edk2-devel@lists.01.org > Cc: jaben.carsey@intel.com; ruiyu.ni@intel.com > Subject: [edk2] [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI System > Table header > > 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 <cinnamon.shia@hpe.com> > --- > ShellPkg/Application/Shell/ConsoleLogger.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c > b/ShellPkg/Application/Shell/ConsoleLogger.c > index 9b64303..563e5e6 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.<BR> > Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR> > + (C) Copyright 2016 Hewlett-Packard Development Company, L.P.<BR> > 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,15 @@ ConsoleLoggerInstall( > gST->ConsoleOutHandle = gImageHandle; > gST->ConOut = &(*ConsoleInfo)->OurConOut; > > + // > + // 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 (Status); > } > > @@ -126,6 +136,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 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-03 21:37 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-10-03 16:37 [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI System Table header Cinnamon Shia 2016-10-03 16:39 ` Shah, Tapan 2016-10-03 21:37 ` Carsey, Jaben
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox