summaryrefslogtreecommitdiff
path: root/platform/linux/platform_linux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux/platform_linux.cpp')
-rw-r--r--platform/linux/platform_linux.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/platform/linux/platform_linux.cpp b/platform/linux/platform_linux.cpp
index e6f3ecb4..8377aad9 100644
--- a/platform/linux/platform_linux.cpp
+++ b/platform/linux/platform_linux.cpp
@@ -181,6 +181,28 @@ public:
}
};
+class LinuxMips64Platform: public Platform
+{
+public:
+ LinuxMips64Platform(Architecture* arch, const std::string& name): Platform(arch, name)
+ {
+ Ref<CallingConvention> cc;
+
+ cc = arch->GetCallingConventionByName("n64");
+ if (cc)
+ {
+ RegisterDefaultCallingConvention(cc);
+ RegisterCdeclCallingConvention(cc);
+ RegisterFastcallCallingConvention(cc);
+ RegisterStdcallCallingConvention(cc);
+ }
+
+ cc = arch->GetCallingConventionByName("linux-syscall");
+ if (cc)
+ SetSystemCallConvention(cc);
+ }
+};
+
class LinuxRiscVPlatform : public Platform
{
@@ -329,19 +351,29 @@ extern "C"
Ref<Architecture> mipsel = Architecture::GetByName("mipsel32");
Ref<Architecture> mipseb = Architecture::GetByName("mips32");
- if (mipsel && mipseb)
+ Ref<Architecture> mips64eb = Architecture::GetByName("mips64");
+ Ref<Architecture> cnmips64eb = Architecture::GetByName("cavium-mips64");
+ if (mipsel && mipseb && mips64eb && cnmips64eb)
{
- Ref<Platform> platformLE, platformBE;
+ Ref<Platform> platformLE, platformBE, platformBE64, platformBE64cn;
platformLE = new LinuxMipsPlatform(mipsel, "linux-mipsel");
platformBE = new LinuxMipsPlatform(mipseb, "linux-mips");
+ platformBE64 = new LinuxMips64Platform(mips64eb, "linux-mips64");
+ platformBE64cn = new LinuxMips64Platform(cnmips64eb, "linux-cnmips64");
Platform::Register("linux", platformLE);
Platform::Register("linux", platformBE);
+ Platform::Register("linux", platformBE64);
+ Platform::Register("linux", platformBE64cn);
// Linux binaries sometimes have an OS identifier of zero, even though 3 is the correct one
BinaryViewType::RegisterPlatform("ELF", 0, mipsel, platformLE);
BinaryViewType::RegisterPlatform("ELF", 0, mipseb, platformBE);
+ BinaryViewType::RegisterPlatform("ELF", 0, mips64eb, platformBE64);
+ BinaryViewType::RegisterPlatform("ELF", 0, cnmips64eb, platformBE64cn);
BinaryViewType::RegisterPlatform("ELF", 3, mipsel, platformLE);
BinaryViewType::RegisterPlatform("ELF", 3, mipseb, platformBE);
+ BinaryViewType::RegisterPlatform("ELF", 3, mips64eb, platformBE64);
+ BinaryViewType::RegisterPlatform("ELF", 3, cnmips64eb, platformBE64cn);
}
Ref<Architecture> rv32 = Architecture::GetByName("rv32gc");