diff --git a/Source/Core/Common/Src/ABI.cpp b/Source/Core/Common/Src/ABI.cpp index 941a1e9ff8..0cc5083240 100644 --- a/Source/Core/Common/Src/ABI.cpp +++ b/Source/Core/Common/Src/ABI.cpp @@ -61,6 +61,12 @@ void XEmitter::ABI_EmitEpilogue(int maxCallParams) // Shared code between Win32 and Unix32 // ==================================== +void XEmitter::ABI_CallFunction(void *func) { + ABI_AlignStack(0); + CALL(func); + ABI_RestoreStack(0); +} + void XEmitter::ABI_CallFunctionC(void *func, u32 param1) { ABI_AlignStack(1 * 4); PUSH(32, Imm32(param1)); @@ -156,6 +162,10 @@ void XEmitter::ABI_RestoreStack(unsigned int frameSize) { #else +void XEmitter::ABI_CallFunction(void *func) { + CALL(func); +} + void XEmitter::ABI_CallFunctionC(void *func, u32 param1) { MOV(32, R(ABI_PARAM1), Imm32(param1)); CALL(func); diff --git a/Source/Core/Common/Src/x64Emitter.h b/Source/Core/Common/Src/x64Emitter.h index 5480fa1c8b..963ef7159c 100644 --- a/Source/Core/Common/Src/x64Emitter.h +++ b/Source/Core/Common/Src/x64Emitter.h @@ -574,6 +574,9 @@ public: void RTDSC(); // Utility functions + // The difference between this and CALL is that this aligns the stack + // where appropriate. + void ABI_CallFunction(void *func); // These only support u32 parameters, but that's enough for a lot of uses. // These will destroy the 1 or 2 first "parameter regs". void ABI_CallFunctionC(void *func, u32 param1);