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@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
This commit is contained in:
Ray Ni 2022-05-18 13:56:05 +08:00 committed by mergify[bot]
parent 21a9b605b8
commit 34d505123e
2 changed files with 12 additions and 13 deletions

View File

@ -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);
}

View File

@ -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);
}