summaryrefslogtreecommitdiff
path: root/src/core/hle/service/jit
diff options
context:
space:
mode:
authorGravatar Liam2022-04-06 14:46:21 -0400
committerGravatar Liam2022-04-06 20:07:01 -0400
commit0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca (patch)
tree635c360c4efe908dc0e2187b054b3aa0fbd8d5f6 /src/core/hle/service/jit
parentMerge pull request #8162 from german77/bombslinger (diff)
downloadyuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.tar.gz
yuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.tar.xz
yuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.zip
service: jit: stub JIT service
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 @@
1// Copyright 2022 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/ipc_helpers.h"
6#include "core/hle/result.h"
7#include "core/hle/service/jit/jit.h"
8#include "core/hle/service/service.h"
9
10namespace Service::JIT {
11
12class IJitEnvironment final : public ServiceFramework<IJitEnvironment> {
13public:
14 explicit IJitEnvironment(Core::System& system_) : ServiceFramework{system_, "IJitEnvironment"} {
15 // clang-format off
16 static const FunctionInfo functions[] = {
17 {0, nullptr, "GenerateCode"},
18 {1, nullptr, "Control"},
19 {1000, nullptr, "LoadPlugin"},
20 {1001, nullptr, "GetCodeAddress"},
21 };
22 // clang-format on
23
24 RegisterHandlers(functions);
25 }
26};
27
28class JITU final : public ServiceFramework<JITU> {
29public:
30 explicit JITU(Core::System& system_) : ServiceFramework{system_, "jit:u"} {
31 // clang-format off
32 static const FunctionInfo functions[] = {
33 {0, &JITU::CreateJitEnvironment, "CreateJitEnvironment"},
34 };
35 // clang-format on
36
37 RegisterHandlers(functions);
38 }
39
40 void CreateJitEnvironment(Kernel::HLERequestContext& ctx) {
41 LOG_DEBUG(Service_JIT, "called");
42
43 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
44 rb.Push(ResultSuccess);
45 rb.PushIpcInterface<IJitEnvironment>(system);
46 }
47};
48
49void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
50 std::make_shared<JITU>(system)->InstallAsService(sm);
51}
52
53} // 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 @@
1// Copyright 2022 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Core {
8class System;
9}
10
11namespace Service::SM {
12class ServiceManager;
13}
14
15namespace Service::JIT {
16
17/// Registers all JIT services with the specified service manager.
18void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);
19
20} // namespace Service::JIT