mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
More linux prep
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@121 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -29,6 +29,14 @@ void ABI_CallFunctionR(void *func, X64Reg reg1) {
|
||||
ADD(32, R(ESP), Imm8(4));
|
||||
}
|
||||
|
||||
void ABI_CallFunctionRR(void *func, Gen::X64Reg reg1, Gen::X64Reg reg2)
|
||||
{
|
||||
PUSH(32, R(reg2));
|
||||
PUSH(32, R(reg1));
|
||||
CALL(func);
|
||||
ADD(32, R(ESP), Imm8(8));
|
||||
}
|
||||
|
||||
void ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2)
|
||||
{
|
||||
PUSH(32, arg1);
|
||||
@ -74,6 +82,15 @@ void ABI_CallFunctionR(void *func, X64Reg reg1) {
|
||||
CALL(func);
|
||||
}
|
||||
|
||||
// Pass a register as a paremeter.
|
||||
void ABI_CallFunctionRR(void *func, X64Reg reg1, X64Reg reg2) {
|
||||
if (reg1 != ABI_PARAM1)
|
||||
MOV(32, R(ABI_PARAM1), R(reg1));
|
||||
if (reg2 != ABI_PARAM2)
|
||||
MOV(32, R(ABI_PARAM2), R(reg2));
|
||||
CALL(func);
|
||||
}
|
||||
|
||||
void ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2)
|
||||
{
|
||||
if (!arg1.IsSimpleReg(ABI_PARAM1))
|
||||
|
@ -48,6 +48,11 @@
|
||||
#ifdef _M_IX86
|
||||
// 32 bit calling convention, shared by all
|
||||
|
||||
// 32-bit don't pass parameters in regs, but these are convenient to have anyway when we have to
|
||||
// choose regs to put stuff in.
|
||||
#define ABI_PARAM1 RCX
|
||||
#define ABI_PARAM2 RDX
|
||||
|
||||
// There are no ABI_PARAM* here, since args are pushed.
|
||||
|
||||
// === 32-bit bog standard cdecl, shared between linux and windows ============================
|
||||
@ -85,6 +90,7 @@ void ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2);
|
||||
|
||||
// Pass a register as a paremeter.
|
||||
void ABI_CallFunctionR(void *func, Gen::X64Reg reg1);
|
||||
void ABI_CallFunctionRR(void *func, Gen::X64Reg reg1, Gen::X64Reg reg2);
|
||||
|
||||
void ABI_PushAllCalleeSavedRegsAndAdjustStack();
|
||||
void ABI_PopAllCalleeSavedRegsAndAdjustStack();
|
||||
|
Reference in New Issue
Block a user