mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
UefiCpuPkg: Add ExceptionHandlerData for ArchRestoreExceptionContext()
mReservedVectors is not set, we could add parameter ExceptionHandlerData for ArchRestoreExceptionContext() that could use it instead of mReservedVectors. Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
This commit is contained in:
parent
81b21fc250
commit
368c54e718
@ -211,14 +211,15 @@ ArchSaveExceptionContext (
|
|||||||
/**
|
/**
|
||||||
Restore CPU exception context when handling EFI_VECTOR_HANDOFF_HOOK_AFTER case.
|
Restore CPU exception context when handling EFI_VECTOR_HANDOFF_HOOK_AFTER case.
|
||||||
|
|
||||||
@param[in] ExceptionType Exception type.
|
@param[in] ExceptionType Exception type.
|
||||||
@param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.
|
@param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.
|
||||||
|
@param[in] ExceptionHandlerData Pointer to exception handler data.
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
ArchRestoreExceptionContext (
|
ArchRestoreExceptionContext (
|
||||||
IN UINTN ExceptionType,
|
IN UINTN ExceptionType,
|
||||||
IN EFI_SYSTEM_CONTEXT SystemContext
|
IN EFI_SYSTEM_CONTEXT SystemContext,
|
||||||
|
IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,19 +87,24 @@ ArchSaveExceptionContext (
|
|||||||
/**
|
/**
|
||||||
Restore CPU exception context when handling EFI_VECTOR_HANDOFF_HOOK_AFTER case.
|
Restore CPU exception context when handling EFI_VECTOR_HANDOFF_HOOK_AFTER case.
|
||||||
|
|
||||||
@param ExceptionType Exception type.
|
@param[in] ExceptionType Exception type.
|
||||||
@param SystemContext Pointer to EFI_SYSTEM_CONTEXT.
|
@param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.
|
||||||
|
@param[in] ExceptionHandlerData Pointer to exception handler data.
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
ArchRestoreExceptionContext (
|
ArchRestoreExceptionContext (
|
||||||
IN UINTN ExceptionType,
|
IN UINTN ExceptionType,
|
||||||
IN EFI_SYSTEM_CONTEXT SystemContext
|
IN EFI_SYSTEM_CONTEXT SystemContext,
|
||||||
|
IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
SystemContext.SystemContextIa32->Eflags = mReservedVectors[ExceptionType].OldFlags;
|
RESERVED_VECTORS_DATA *ReservedVectors;
|
||||||
SystemContext.SystemContextIa32->Cs = mReservedVectors[ExceptionType].OldCs;
|
|
||||||
SystemContext.SystemContextIa32->Eip = mReservedVectors[ExceptionType].OldIp;
|
ReservedVectors = ExceptionHandlerData->ReservedVectors;
|
||||||
SystemContext.SystemContextIa32->ExceptionData = mReservedVectors[ExceptionType].ExceptionData;
|
SystemContext.SystemContextIa32->Eflags = ReservedVectors[ExceptionType].OldFlags;
|
||||||
|
SystemContext.SystemContextIa32->Cs = ReservedVectors[ExceptionType].OldCs;
|
||||||
|
SystemContext.SystemContextIa32->Eip = ReservedVectors[ExceptionType].OldIp;
|
||||||
|
SystemContext.SystemContextIa32->ExceptionData = ReservedVectors[ExceptionType].ExceptionData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,7 +68,7 @@ CommonExceptionHandlerWorker (
|
|||||||
// Old IDT handler has been executed, then restore CPU exception content to
|
// Old IDT handler has been executed, then restore CPU exception content to
|
||||||
// run new exception handler.
|
// run new exception handler.
|
||||||
//
|
//
|
||||||
ArchRestoreExceptionContext (ExceptionType, SystemContext);
|
ArchRestoreExceptionContext (ExceptionType, SystemContext, ExceptionHandlerData);
|
||||||
//
|
//
|
||||||
// Rlease spin lock for ApicId
|
// Rlease spin lock for ApicId
|
||||||
//
|
//
|
||||||
|
@ -90,21 +90,26 @@ ArchSaveExceptionContext (
|
|||||||
/**
|
/**
|
||||||
Restore CPU exception context when handling EFI_VECTOR_HANDOFF_HOOK_AFTER case.
|
Restore CPU exception context when handling EFI_VECTOR_HANDOFF_HOOK_AFTER case.
|
||||||
|
|
||||||
@param ExceptionType Exception type.
|
@param[in] ExceptionType Exception type.
|
||||||
@param SystemContext Pointer to EFI_SYSTEM_CONTEXT.
|
@param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.
|
||||||
|
@param[in] ExceptionHandlerData Pointer to exception handler data.
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
ArchRestoreExceptionContext (
|
ArchRestoreExceptionContext (
|
||||||
IN UINTN ExceptionType,
|
IN UINTN ExceptionType,
|
||||||
IN EFI_SYSTEM_CONTEXT SystemContext
|
IN EFI_SYSTEM_CONTEXT SystemContext,
|
||||||
|
IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
SystemContext.SystemContextX64->Ss = mReservedVectors[ExceptionType].OldSs;
|
RESERVED_VECTORS_DATA *ReservedVectors;
|
||||||
SystemContext.SystemContextX64->Rsp = mReservedVectors[ExceptionType].OldSp;
|
|
||||||
SystemContext.SystemContextX64->Rflags = mReservedVectors[ExceptionType].OldFlags;
|
ReservedVectors = ExceptionHandlerData->ReservedVectors;
|
||||||
SystemContext.SystemContextX64->Cs = mReservedVectors[ExceptionType].OldCs;
|
SystemContext.SystemContextX64->Ss = ReservedVectors[ExceptionType].OldSs;
|
||||||
SystemContext.SystemContextX64->Rip = mReservedVectors[ExceptionType].OldIp;
|
SystemContext.SystemContextX64->Rsp = ReservedVectors[ExceptionType].OldSp;
|
||||||
SystemContext.SystemContextX64->ExceptionData = mReservedVectors[ExceptionType].ExceptionData;
|
SystemContext.SystemContextX64->Rflags = ReservedVectors[ExceptionType].OldFlags;
|
||||||
|
SystemContext.SystemContextX64->Cs = ReservedVectors[ExceptionType].OldCs;
|
||||||
|
SystemContext.SystemContextX64->Rip = ReservedVectors[ExceptionType].OldIp;
|
||||||
|
SystemContext.SystemContextX64->ExceptionData = ReservedVectors[ExceptionType].ExceptionData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user