Why add a CpuBreakPoint()?

> -----Original Message-----
> From: Cinnamon Shia [mailto:[email protected]]
> Sent: Monday, October 03, 2016 9:14 AM
> To: [email protected]
> Cc: Carsey, Jaben <[email protected]>; Ni, Ruiyu
> <[email protected]>; Cinnamon Shia <[email protected]>
> Subject: [PATCH] ShellPkg/Shell: Update CRC32 in the EFI System Table
> header
> Importance: High
> 
> 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 <[email protected]>
> ---
>  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.<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,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

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to