Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions arch/arm64/arch_arm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2692,15 +2692,15 @@ class WindowsArm64SystemCallConvention : public CallingConvention
virtual bool IsEligibleForHeuristics() override { return false; }
};

class MacosArm64SystemCallConvention : public CallingConvention
class AppleArm64SystemCallConvention : public CallingConvention
{
public:
MacosArm64SystemCallConvention(Architecture* arch) : CallingConvention(arch, "macos-syscall") {}
AppleArm64SystemCallConvention(Architecture* arch) : CallingConvention(arch, "apple-syscall") {}


virtual vector<uint32_t> GetIntegerArgumentRegisters() override
{
return vector<uint32_t> {REG_X16, REG_X0, REG_X1, REG_X2, REG_X3, REG_X4, REG_X5};
return vector<uint32_t> {REG_X16, REG_X0, REG_X1, REG_X2, REG_X3, REG_X4, REG_X5, REG_X6, REG_X7, REG_X8};
}


Expand Down Expand Up @@ -3500,6 +3500,9 @@ extern "C"
conv = new WindowsArm64SystemCallConvention(arm64);
arm64->RegisterCallingConvention(conv);

conv = new AppleArm64SystemCallConvention(arm64);
arm64->RegisterCallingConvention(conv);

conv = new AppleArm64CallingConvention(arm64);
arm64->RegisterCallingConvention(conv);

Expand Down
9 changes: 9 additions & 0 deletions platform/mac/platform_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ class MacArm64Platform: public Platform
RegisterFastcallCallingConvention(cc);
RegisterStdcallCallingConvention(cc);
}

cc = arch->GetCallingConventionByName("apple-syscall");
if (cc)
SetSystemCallConvention(cc);
}

virtual bool GetFallbackEnabled() override
Expand Down Expand Up @@ -232,6 +236,11 @@ class IOSArm64Platform: public Platform
RegisterFastcallCallingConvention(cc);
RegisterStdcallCallingConvention(cc);
}

cc = arch->GetCallingConventionByName("apple-syscall");
if (cc)
SetSystemCallConvention(cc);

}

virtual bool GetFallbackEnabled() override
Expand Down