UefiCpuPkg: CpuExceptionHandlerLib: Make self modifying code work with Xcode
CpuExceptionHandlerLib has code that contains absolute relocations, not supported by Xcode for X64, and it then copies this code to an alternate location in memory. It is very hard to write IP relative self-modifiying code. I had to update AsmVectorNumFixup() to also patch in the absolute addressess after the code was copied. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anderw Fish <afish@apple.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16068 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -204,17 +204,19 @@ ArchRestoreExceptionContext (
|
||||
);
|
||||
|
||||
/**
|
||||
Fix up the vector number in the vector code.
|
||||
Fix up the vector number and function address in the vector code.
|
||||
|
||||
@param[in] VectorBase Base address of the vector handler.
|
||||
@param[in] VectorNum Index of vector.
|
||||
@param[in] NewVectorAddr New vector handler address.
|
||||
@param[in] VectorNum Index of vector.
|
||||
@param[in] OldVectorAddr Old vector handler address.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
AsmVectorNumFixup (
|
||||
IN VOID *VectorBase,
|
||||
IN UINT8 VectorNum
|
||||
IN VOID *NewVectorAddr,
|
||||
IN UINT8 VectorNum,
|
||||
IN VOID *OldVectorAddr
|
||||
);
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user