summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/jit
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-04-06 20:46:21 +0200
committerLiam <byteslice@airmail.cc>2022-04-07 02:07:01 +0200
commit0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca (patch)
tree635c360c4efe908dc0e2187b054b3aa0fbd8d5f6 /src/core/hle/service/jit
parentMerge pull request #8162 from german77/bombslinger (diff)
downloadyuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.tar
yuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.tar.gz
yuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.tar.bz2
yuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.tar.lz
yuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.tar.xz
yuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.tar.zst
yuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.zip
Diffstat (limited to 'src/core/hle/service/jit')
-rw-r--r--src/core/hle/service/jit/jit.cpp53
-rw-r--r--src/core/hle/service/jit/jit.h20
2 files changed, 73 insertions, 0 deletions
diff --git a/src/core/hle/service/jit/jit.cpp b/src/core/hle/service/jit/jit.cpp
new file mode 100644
index 000000000..c8ebd2e3f
--- /dev/null
+++ b/src/core/hle/service/jit/jit.cpp
@@ -0,0 +1,53 @@
+// Copyright 2022 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/result.h"
+#include "core/hle/service/jit/jit.h"
+#include "core/hle/service/service.h"
+
+namespace Service::JIT {
+
+class IJitEnvironment final : public ServiceFramework<IJitEnvironment> {
+public:
+ explicit IJitEnvironment(Core::System& system_) : ServiceFramework{system_, "IJitEnvironment"} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "GenerateCode"},
+ {1, nullptr, "Control"},
+ {1000, nullptr, "LoadPlugin"},
+ {1001, nullptr, "GetCodeAddress"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+};
+
+class JITU final : public ServiceFramework<JITU> {
+public:
+ explicit JITU(Core::System& system_) : ServiceFramework{system_, "jit:u"} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, &JITU::CreateJitEnvironment, "CreateJitEnvironment"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+
+ void CreateJitEnvironment(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service_JIT, "called");
+
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+ rb.Push(ResultSuccess);
+ rb.PushIpcInterface<IJitEnvironment>(system);
+ }
+};
+
+void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
+ std::make_shared<JITU>(system)->InstallAsService(sm);
+}
+
+} // namespace Service::JIT
diff --git a/src/core/hle/service/jit/jit.h b/src/core/hle/service/jit/jit.h
new file mode 100644
index 000000000..8fbf504a1
--- /dev/null
+++ b/src/core/hle/service/jit/jit.h
@@ -0,0 +1,20 @@
+// Copyright 2022 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+namespace Core {
+class System;
+}
+
+namespace Service::SM {
+class ServiceManager;
+}
+
+namespace Service::JIT {
+
+/// Registers all JIT services with the specified service manager.
+void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);
+
+} // namespace Service::JIT