/** @file\r
CPU exception handler library implemenation for SMM modules.\r
\r
- Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
CONST UINTN mDoFarReturnFlag = 1; \r
\r
+//\r
+// Spin lock for CPU information display\r
+//\r
+SPIN_LOCK mDisplayMessageSpinLock;\r
+\r
+//\r
+// Image align size for DXE/SMM\r
+//\r
+CONST UINTN mImageAlignSize = SIZE_4KB;\r
+\r
+RESERVED_VECTORS_DATA mReservedVectorsData[CPU_EXCEPTION_NUM];\r
+EFI_CPU_INTERRUPT_HANDLER mExternalInterruptHandlerTable[CPU_EXCEPTION_NUM];\r
+EXCEPTION_HANDLER_DATA mExceptionHandlerData;\r
+/**\r
+ Common exception handler.\r
+\r
+ @param ExceptionType Exception type.\r
+ @param SystemContext Pointer to EFI_SYSTEM_CONTEXT.\r
+**/\r
+VOID\r
+EFIAPI\r
+CommonExceptionHandler (\r
+ IN EFI_EXCEPTION_TYPE ExceptionType, \r
+ IN EFI_SYSTEM_CONTEXT SystemContext\r
+ )\r
+{\r
+ CommonExceptionHandlerWorker (ExceptionType, SystemContext, &mExceptionHandlerData);\r
+}\r
+\r
/**\r
Initializes all CPU exceptions entries and provides the default exception handlers.\r
\r
IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL\r
)\r
{\r
- return InitializeCpuExceptionHandlersWorker (VectorInfo);\r
+ mExceptionHandlerData.ReservedVectors = mReservedVectorsData;\r
+ mExceptionHandlerData.ExternalInterruptHandler = mExternalInterruptHandlerTable;\r
+ InitializeSpinLock (&mExceptionHandlerData.DisplayMessageSpinLock);\r
+ return InitializeCpuExceptionHandlersWorker (VectorInfo, &mExceptionHandlerData);\r
}\r
\r
/**\r
IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r
)\r
{\r
- return RegisterCpuInterruptHandlerWorker (InterruptType, InterruptHandler);\r
+ return RegisterCpuInterruptHandlerWorker (InterruptType, InterruptHandler, &mExceptionHandlerData);\r
}
\ No newline at end of file