summaryrefslogtreecommitdiff
path: root/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h
diff options
context:
space:
mode:
authorAnderw Fish <afish@apple.com>2014-09-09 06:50:51 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2014-09-09 06:50:51 +0000
commit07da1ac8c46425cb401cc5f356ab77b9cc1c334d (patch)
treeebe576744f54efd059fd6b1bd2bafcc294f6c97a /UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h
parent19ee4a904982cfacdcb8c578c5d421162fa9488d (diff)
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
Diffstat (limited to 'UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h')
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h
index 1b899b302..efe77eb09 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
);
/**