- for (Index = 0; Index < IdtSize; Index ++) {\r
- InterruptHandler = TemplateMap.ExceptionStart + Index * TemplateMap.ExceptionStubHeaderSize;\r
- IdtEntry[Index].Bits.OffsetLow = (UINT16)(UINTN)InterruptHandler;\r
- IdtEntry[Index].Bits.OffsetHigh = (UINT16)((UINTN)InterruptHandler >> 16);\r
- IdtEntry[Index].Bits.Selector = CodeSegment;\r
- IdtEntry[Index].Bits.GateType = IA32_IDT_GATE_TYPE_INTERRUPT_32;\r
- }\r
+ @param ExceptionType Exception type.\r
+ @param SystemContext Pointer to EFI_SYSTEM_CONTEXT.\r
+**/\r
+VOID\r
+ArchRestoreExceptionContext (\r
+ IN UINTN ExceptionType,\r
+ IN EFI_SYSTEM_CONTEXT SystemContext \r
+ )\r
+{\r
+ SystemContext.SystemContextIa32->Eflags = mReservedVectors[ExceptionType].OldFlags;\r
+ SystemContext.SystemContextIa32->Cs = mReservedVectors[ExceptionType].OldCs;\r
+ SystemContext.SystemContextIa32->Eip = mReservedVectors[ExceptionType].OldIp;\r
+ SystemContext.SystemContextIa32->ExceptionData = mReservedVectors[ExceptionType].ExceptionData;\r