diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c index 3320066564..a61a52b19a 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c @@ -19,9 +19,15 @@ CONST UINTN mDoFarReturnFlag = 0; -extern EFI_CPU_INTERRUPT_HANDLER *mExternalInterruptHandler; -extern RESERVED_VECTORS_DATA mReservedVectorsData[CPU_EXCEPTION_NUM]; -extern EFI_CPU_INTERRUPT_HANDLER mExternalInterruptHandlerTable[CPU_EXCEPTION_NUM]; +// +// Image align size for DXE/SMM +// +CONST UINTN mImageAlignSize = SIZE_4KB; + +RESERVED_VECTORS_DATA mReservedVectorsData[CPU_EXCEPTION_NUM]; +EFI_CPU_INTERRUPT_HANDLER mExternalInterruptHandlerTable[CPU_EXCEPTION_NUM]; +UINTN mEnabledInterruptNum = 0; + EXCEPTION_HANDLER_DATA mExceptionHandlerData; /** diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c index d4bc293db0..02d56223c6 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c @@ -15,17 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "CpuExceptionCommon.h" #include - -// -// Image align size for DXE/SMM -// -CONST UINTN mImageAlignSize = SIZE_4KB; - -RESERVED_VECTORS_DATA mReservedVectorsData[CPU_EXCEPTION_NUM]; -EFI_CPU_INTERRUPT_HANDLER mExternalInterruptHandlerTable[CPU_EXCEPTION_NUM]; -EFI_CPU_INTERRUPT_HANDLER *mExternalInterruptHandler = NULL; -UINTN mEnabledInterruptNum = 0; - /** Internal worker function for common exception handler. @@ -196,11 +185,6 @@ UpdateIdtTable ( break; } } - - // - // Save Interrupt number to global variable used for RegisterCpuInterruptHandler () - // - mEnabledInterruptNum = ExceptionHandlerData->IdtEntryCount; } /** @@ -237,7 +221,6 @@ InitializeCpuExceptionHandlersWorker ( } } - mExternalInterruptHandler = mExternalInterruptHandlerTable; // // Read IDT descriptor and calculate IDT size // @@ -256,7 +239,7 @@ InitializeCpuExceptionHandlersWorker ( ExceptionHandlerData->IdtEntryCount = IdtEntryCount; UpdateIdtTable (IdtTable, &TemplateMap, ExceptionHandlerData); - mEnabledInterruptNum = IdtEntryCount; + return EFI_SUCCESS; } diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c index 3528c8cc75..7ad228c806 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c @@ -17,8 +17,18 @@ CONST UINTN mDoFarReturnFlag = 1; -extern RESERVED_VECTORS_DATA mReservedVectorsData[CPU_EXCEPTION_NUM]; -extern EFI_CPU_INTERRUPT_HANDLER mExternalInterruptHandlerTable[CPU_EXCEPTION_NUM]; +// +// Spin lock for CPU information display +// +SPIN_LOCK mDisplayMessageSpinLock; + +// +// Image align size for DXE/SMM +// +CONST UINTN mImageAlignSize = SIZE_4KB; + +RESERVED_VECTORS_DATA mReservedVectorsData[CPU_EXCEPTION_NUM]; +EFI_CPU_INTERRUPT_HANDLER mExternalInterruptHandlerTable[CPU_EXCEPTION_NUM]; EXCEPTION_HANDLER_DATA mExceptionHandlerData; /** Common exception handler.