From d91225cfad507219502086d0b6b670ae126d489d Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Tue, 24 May 2016 21:35:24 +0800 Subject: UefiCpuPkg/ExceptionLib: Move global variable location Move some global variables location from PeiDxeSmmCpuException.c to DxeCpuException.c and SmmCpuException.c. And remove some un-used global vairables. Cc: Michael Kinney Cc: Jiewen Yao Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Feng Tian --- .../Library/CpuExceptionHandlerLib/DxeException.c | 12 +++++++++--- .../CpuExceptionHandlerLib/PeiDxeSmmCpuException.c | 19 +------------------ .../Library/CpuExceptionHandlerLib/SmmException.c | 14 ++++++++++++-- 3 files changed, 22 insertions(+), 23 deletions(-) (limited to 'UefiCpuPkg') 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. -- cgit v1.2.3