/**\r
Save CPU exception context when handling EFI_VECTOR_HANDOFF_HOOK_AFTER case.\r
\r
- @param[in] ExceptionType Exception type.\r
- @param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.\r
-\r
+ @param[in] ExceptionType Exception type.\r
+ @param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.\r
+ @param[in] ExceptionHandlerData Pointer to exception handler data.\r
**/\r
VOID\r
ArchSaveExceptionContext (\r
- IN UINTN ExceptionType,\r
- IN EFI_SYSTEM_CONTEXT SystemContext \r
+ IN UINTN ExceptionType,\r
+ IN EFI_SYSTEM_CONTEXT SystemContext,\r
+ IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData\r
);\r
\r
/**\r
/** @file\r
IA32 CPU Exception Handler functons.\r
\r
- Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2012 - 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
Save CPU exception context when handling EFI_VECTOR_HANDOFF_HOOK_AFTER case.\r
\r
- @param ExceptionType Exception type.\r
- @param SystemContext Pointer to EFI_SYSTEM_CONTEXT.\r
-\r
+ @param[in] ExceptionType Exception type.\r
+ @param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.\r
+ @param[in] ExceptionHandlerData Pointer to exception handler data.\r
**/\r
VOID\r
ArchSaveExceptionContext (\r
- IN UINTN ExceptionType,\r
- IN EFI_SYSTEM_CONTEXT SystemContext \r
+ IN UINTN ExceptionType,\r
+ IN EFI_SYSTEM_CONTEXT SystemContext,\r
+ IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData\r
)\r
{\r
IA32_EFLAGS32 Eflags;\r
+ RESERVED_VECTORS_DATA *ReservedVectors;\r
+\r
+ ReservedVectors = ExceptionHandlerData->ReservedVectors;\r
//\r
// Save Exception context in global variable\r
//\r
- mReservedVectors[ExceptionType].OldFlags = SystemContext.SystemContextIa32->Eflags;\r
- mReservedVectors[ExceptionType].OldCs = SystemContext.SystemContextIa32->Cs;\r
- mReservedVectors[ExceptionType].OldIp = SystemContext.SystemContextIa32->Eip;\r
- mReservedVectors[ExceptionType].ExceptionData = SystemContext.SystemContextIa32->ExceptionData;\r
+ ReservedVectors[ExceptionType].OldFlags = SystemContext.SystemContextIa32->Eflags;\r
+ ReservedVectors[ExceptionType].OldCs = SystemContext.SystemContextIa32->Cs;\r
+ ReservedVectors[ExceptionType].OldIp = SystemContext.SystemContextIa32->Eip;\r
+ ReservedVectors[ExceptionType].ExceptionData = SystemContext.SystemContextIa32->ExceptionData;\r
//\r
// Clear IF flag to avoid old IDT handler enable interrupt by IRET\r
//\r
//\r
// Modify the EIP in stack, then old IDT handler will return to the stub code\r
//\r
- SystemContext.SystemContextIa32->Eip = (UINTN) mReservedVectors[ExceptionType].HookAfterStubHeaderCode;\r
+ SystemContext.SystemContextIa32->Eip = (UINTN) ReservedVectors[ExceptionType].HookAfterStubHeaderCode;\r
}\r
\r
/**\r
// Need to execute old IDT handler before running this exception handler\r
//\r
ReservedVectors[ExceptionType].ApicId = GetApicId ();\r
- ArchSaveExceptionContext (ExceptionType, SystemContext);\r
+ ArchSaveExceptionContext (ExceptionType, SystemContext, ExceptionHandlerData);\r
ExceptionHandlerContext->ExceptionDataFlag = (mErrorCodeFlag & (1 << ExceptionType)) ? TRUE : FALSE;\r
ExceptionHandlerContext->OldIdtHandler = ReservedVectors[ExceptionType].ExceptonHandler;\r
return;\r
/** @file\r
x64 CPU Exception Handler.\r
\r
- Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2012 - 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
Save CPU exception context when handling EFI_VECTOR_HANDOFF_HOOK_AFTER case.\r
\r
- @param ExceptionType Exception type.\r
- @param SystemContext Pointer to EFI_SYSTEM_CONTEXT.\r
+ @param[in] ExceptionType Exception type.\r
+ @param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.\r
+ @param[in] ExceptionHandlerData Pointer to exception handler data.\r
**/\r
VOID\r
ArchSaveExceptionContext (\r
- IN UINTN ExceptionType,\r
- IN EFI_SYSTEM_CONTEXT SystemContext \r
+ IN UINTN ExceptionType,\r
+ IN EFI_SYSTEM_CONTEXT SystemContext,\r
+ IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData\r
)\r
{\r
IA32_EFLAGS32 Eflags;\r
+ RESERVED_VECTORS_DATA *ReservedVectors;\r
+\r
+ ReservedVectors = ExceptionHandlerData->ReservedVectors;\r
//\r
// Save Exception context in global variable\r
//\r
- mReservedVectors[ExceptionType].OldSs = SystemContext.SystemContextX64->Ss;\r
- mReservedVectors[ExceptionType].OldSp = SystemContext.SystemContextX64->Rsp;\r
- mReservedVectors[ExceptionType].OldFlags = SystemContext.SystemContextX64->Rflags;\r
- mReservedVectors[ExceptionType].OldCs = SystemContext.SystemContextX64->Cs;\r
- mReservedVectors[ExceptionType].OldIp = SystemContext.SystemContextX64->Rip;\r
- mReservedVectors[ExceptionType].ExceptionData = SystemContext.SystemContextX64->ExceptionData;\r
+ ReservedVectors[ExceptionType].OldSs = SystemContext.SystemContextX64->Ss;\r
+ ReservedVectors[ExceptionType].OldSp = SystemContext.SystemContextX64->Rsp;\r
+ ReservedVectors[ExceptionType].OldFlags = SystemContext.SystemContextX64->Rflags;\r
+ ReservedVectors[ExceptionType].OldCs = SystemContext.SystemContextX64->Cs;\r
+ ReservedVectors[ExceptionType].OldIp = SystemContext.SystemContextX64->Rip;\r
+ ReservedVectors[ExceptionType].ExceptionData = SystemContext.SystemContextX64->ExceptionData;\r
//\r
// Clear IF flag to avoid old IDT handler enable interrupt by IRET\r
//\r
//\r
// Modify the EIP in stack, then old IDT handler will return to the stub code\r
//\r
- SystemContext.SystemContextX64->Rip = (UINTN) mReservedVectors[ExceptionType].HookAfterStubHeaderCode;\r
+ SystemContext.SystemContextX64->Rip = (UINTN) ReservedVectors[ExceptionType].HookAfterStubHeaderCode;\r
}\r
\r
/**\r