]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c
UefiCpuPkg: Add PEI/DXE Register CPU Features Library instances
[mirror_edk2.git] / UefiCpuPkg / Library / CpuExceptionHandlerLib / SmmException.c
index 40f12502668263aef1607253f7e7414b26ead323..7ad228c806ad83bc29f8f37a672273aa835891a4 100644 (file)
@@ -1,7 +1,7 @@
 /** @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
@@ -39,7 +68,10 @@ InitializeCpuExceptionHandlers (
   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
@@ -97,5 +129,5 @@ RegisterCpuInterruptHandler (
   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