Fix crashes in Single Core mode on Dolphin Win64.

Cherry-picked from 6209067daa.
This commit is contained in:
Pierre Bourdon
2013-09-22 14:29:35 -04:00
parent c25be031fc
commit 4e43ecb28d
5 changed files with 28 additions and 28 deletions

View File

@ -15,9 +15,9 @@ unsigned int XEmitter::ABI_GetAlignedFrameSize(unsigned int frameSize, bool noPr
// the stack pointer is 4/8 bytes less than a multiple of 16; however, the
// function prolog immediately subtracts an appropriate amount to align
// it, so no alignment is required around a call.
// In the functions generated by ThunkManager::ProtectFunction, we add the
// necessary subtraction (and 0x20 bytes shadow space for Win64) into this
// rather than having a separate prolog.
// In the functions generated by ThunkManager::ProtectFunction and some
// others, we add the necessary subtraction (and 0x20 bytes shadow space
// for Win64) into this rather than having a separate prolog.
// On Windows 32-bit, the required alignment is only 4 bytes, so we just
// ensure that the frame size isn't misaligned.
#ifdef _M_X64
@ -142,13 +142,13 @@ void XEmitter::ABI_CallFunctionR(void *func, X64Reg reg1) {
}
// Pass two registers as parameters.
void XEmitter::ABI_CallFunctionRR(void *func, Gen::X64Reg reg1, Gen::X64Reg reg2)
void XEmitter::ABI_CallFunctionRR(void *func, Gen::X64Reg reg1, Gen::X64Reg reg2, bool noProlog)
{
ABI_AlignStack(2 * 4);
ABI_AlignStack(2 * 4, noProlog);
PUSH(32, R(reg2));
PUSH(32, R(reg1));
CALL(func);
ABI_RestoreStack(2 * 4);
ABI_RestoreStack(2 * 4, noProlog);
}
void XEmitter::ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2)
@ -351,8 +351,8 @@ void XEmitter::ABI_CallFunctionR(void *func, X64Reg reg1) {
}
// Pass two registers as parameters.
void XEmitter::ABI_CallFunctionRR(void *func, X64Reg reg1, X64Reg reg2) {
ABI_AlignStack(0);
void XEmitter::ABI_CallFunctionRR(void *func, X64Reg reg1, X64Reg reg2, bool noProlog) {
ABI_AlignStack(0, noProlog);
if (reg2 != ABI_PARAM1) {
if (reg1 != ABI_PARAM1)
MOV(64, R(ABI_PARAM1), R(reg1));
@ -373,7 +373,7 @@ void XEmitter::ABI_CallFunctionRR(void *func, X64Reg reg1, X64Reg reg2) {
} else {
CALL(func);
}
ABI_RestoreStack(0);
ABI_RestoreStack(0, noProlog);
}
void XEmitter::ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2)