37 mExceptionType = ExceptionType;
38 SystemContext.SystemContextIa32->Eip += mFaultInstructionLength;
57 mActualContextInHandler.Edi = SystemContext.SystemContextIa32->Edi;
58 mActualContextInHandler.Esi = SystemContext.SystemContextIa32->Esi;
59 mActualContextInHandler.Ebx = SystemContext.SystemContextIa32->Ebx;
60 mActualContextInHandler.Edx = SystemContext.SystemContextIa32->Edx;
61 mActualContextInHandler.Ecx = SystemContext.SystemContextIa32->Ecx;
62 mActualContextInHandler.Eax = SystemContext.SystemContextIa32->Eax;
69 SystemContext.SystemContextIa32->Edi = mExpectedContextAfterException.Edi;
70 SystemContext.SystemContextIa32->Esi = mExpectedContextAfterException.Esi;
71 SystemContext.SystemContextIa32->Ebx = mExpectedContextAfterException.Ebx;
72 SystemContext.SystemContextIa32->Edx = mExpectedContextAfterException.Edx;
73 SystemContext.SystemContextIa32->Ecx = mExpectedContextAfterException.Ecx;
74 SystemContext.SystemContextIa32->Eax = mExpectedContextAfterException.Eax;
80 if ((ExceptionType == EXCEPT_IA32_PAGE_FAULT) || (ExceptionType == EXCEPT_IA32_GP_FAULT)) {
98 UT_ASSERT_EQUAL (mActualContextInHandler.Edi, mExpectedContextInHandler.Edi);
99 UT_ASSERT_EQUAL (mActualContextInHandler.Esi, mExpectedContextInHandler.Esi);
100 UT_ASSERT_EQUAL (mActualContextInHandler.Ebx, mExpectedContextInHandler.Ebx);
101 UT_ASSERT_EQUAL (mActualContextInHandler.Edx, mExpectedContextInHandler.Edx);
102 UT_ASSERT_EQUAL (mActualContextInHandler.Ecx, mExpectedContextInHandler.Ecx);
103 UT_ASSERT_EQUAL (mActualContextInHandler.Eax, mExpectedContextInHandler.Eax);
105 UT_ASSERT_EQUAL (mActualContextAfterException.Edi, mExpectedContextAfterException.Edi);
106 UT_ASSERT_EQUAL (mActualContextAfterException.Esi, mExpectedContextAfterException.Esi);
107 UT_ASSERT_EQUAL (mActualContextAfterException.Ebx, mExpectedContextAfterException.Ebx);
108 UT_ASSERT_EQUAL (mActualContextAfterException.Edx, mExpectedContextAfterException.Edx);
109 UT_ASSERT_EQUAL (mActualContextAfterException.Ecx, mExpectedContextAfterException.Ecx);
110 UT_ASSERT_EQUAL (mActualContextAfterException.Eax, mExpectedContextAfterException.Eax);
111 return UNIT_TEST_PASSED;
131 mRspAddress[0] = (
UINTN)SystemContext.SystemContextIa32->Esp;
132 mRspAddress[1] = (
UINTN)(&LocalVariable);
VOID EFIAPI AdjustCpuContextHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext)
VOID EFIAPI AdjustRipForFaultHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext)
VOID EFIAPI CpuStackGuardExceptionHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext)
UNIT_TEST_STATUS CompareCpuContext(VOID)
#define UT_ASSERT_EQUAL(ValueA, ValueB)