From 07da1ac8c46425cb401cc5f356ab77b9cc1c334d Mon Sep 17 00:00:00 2001 From: Anderw Fish Date: Tue, 9 Sep 2014 06:50:51 +0000 Subject: 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 Reviewed-by: Jeff Fan git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16068 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/CpuExceptionHandlerLib/CpuExceptionCommon.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h') diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h index 1b899b3024..efe77eb09f 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h @@ -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 ); /** -- cgit v1.2.3