[edk2-devel] [PATCH 2/5] CpuException: Init global variables in-place

Wang, Jian J jian.j.wang at intel.com
Sun May 22 16:32:26 UTC 2022


Reviewed-by: Jian J Wang <jian.j.wang at intel.com>

Regards,
Jian

> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Ni, Ray
> Sent: Friday, May 20, 2022 10:16 PM
> To: devel at edk2.groups.io
> Cc: Dong, Eric <eric.dong at intel.com>
> Subject: [edk2-devel] [PATCH 2/5] CpuException: Init global variables in-place
> 
> Additionally removed two useless global variables:
> "SPIN_LOCK  mDisplayMessageSpinLock" from SMM instance.
> "UINTN mEnabledInterruptNum" from DXE instance.
> 
> Signed-off-by: Ray Ni <ray.ni at intel.com>
> Cc: Eric Dong <eric.dong at intel.com>
> ---
>  .../Library/CpuExceptionHandlerLib/DxeException.c  | 11 ++++++-----
>  .../Library/CpuExceptionHandlerLib/SmmException.c  | 14 ++++++--------
>  2 files changed, 12 insertions(+), 13 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
> index 5083c4b8e8..da5b96d6c6 100644
> --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
> +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
> @@ -16,9 +16,12 @@ CONST UINTN  mDoFarReturnFlag = 0;
> 
> 
>  RESERVED_VECTORS_DATA      mReservedVectorsData[CPU_EXCEPTION_NUM];
> 
>  EFI_CPU_INTERRUPT_HANDLER
> mExternalInterruptHandlerTable[CPU_EXCEPTION_NUM];
> 
> -UINTN                      mEnabledInterruptNum = 0;
> 
> -
> 
> -EXCEPTION_HANDLER_DATA  mExceptionHandlerData;
> 
> +EXCEPTION_HANDLER_DATA     mExceptionHandlerData = {
> 
> +  0,   // To be fixed
> 
> +  0,   // To be fixed
> 
> +  mReservedVectorsData,
> 
> +  mExternalInterruptHandlerTable
> 
> +};
> 
> 
> 
>  UINT8  mNewStack[CPU_STACK_SWITCH_EXCEPTION_NUMBER *
> 
>                   CPU_KNOWN_GOOD_STACK_SIZE];
> 
> @@ -62,8 +65,6 @@ InitializeCpuExceptionHandlers (
>    IN EFI_VECTOR_HANDOFF_INFO  *VectorInfo OPTIONAL
> 
>    )
> 
>  {
> 
> -  mExceptionHandlerData.ReservedVectors          = mReservedVectorsData;
> 
> -  mExceptionHandlerData.ExternalInterruptHandler =
> mExternalInterruptHandlerTable;
> 
>    InitializeSpinLock (&mExceptionHandlerData.DisplayMessageSpinLock);
> 
>    return InitializeCpuExceptionHandlersWorker (VectorInfo,
> &mExceptionHandlerData);
> 
>  }
> 
> diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c
> index 77ee74579f..9f0af4120a 100644
> --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c
> +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c
> @@ -11,14 +11,14 @@
> 
> 
>  CONST UINTN  mDoFarReturnFlag = 1;
> 
> 
> 
> -//
> 
> -// Spin lock for CPU information display
> 
> -//
> 
> -SPIN_LOCK  mDisplayMessageSpinLock;
> 
> -
> 
>  RESERVED_VECTORS_DATA      mReservedVectorsData[CPU_EXCEPTION_NUM];
> 
>  EFI_CPU_INTERRUPT_HANDLER
> mExternalInterruptHandlerTable[CPU_EXCEPTION_NUM];
> 
> -EXCEPTION_HANDLER_DATA     mExceptionHandlerData;
> 
> +EXCEPTION_HANDLER_DATA     mExceptionHandlerData = {
> 
> +  0,   // To be fixed
> 
> +  0,   // To be fixed
> 
> +  mReservedVectorsData,
> 
> +  mExternalInterruptHandlerTable
> 
> +};
> 
> 
> 
>  /**
> 
>    Common exception handler.
> 
> @@ -58,8 +58,6 @@ InitializeCpuExceptionHandlers (
>    IN EFI_VECTOR_HANDOFF_INFO  *VectorInfo OPTIONAL
> 
>    )
> 
>  {
> 
> -  mExceptionHandlerData.ReservedVectors          = mReservedVectorsData;
> 
> -  mExceptionHandlerData.ExternalInterruptHandler =
> mExternalInterruptHandlerTable;
> 
>    InitializeSpinLock (&mExceptionHandlerData.DisplayMessageSpinLock);
> 
>    return InitializeCpuExceptionHandlersWorker (VectorInfo,
> &mExceptionHandlerData);
> 
>  }
> 
> --
> 2.35.1.windows.2
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#89917): https://edk2.groups.io/g/devel/message/89917
> Mute This Topic: https://groups.io/mt/91231768/1768734
> Group Owner: devel+owner at edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [jian.j.wang at intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#89941): https://edk2.groups.io/g/devel/message/89941
Mute This Topic: https://groups.io/mt/91231768/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list