summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Liam2022-04-06 14:46:21 -0400
committerGravatar Liam2022-04-06 20:07:01 -0400
commit0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca (patch)
tree635c360c4efe908dc0e2187b054b3aa0fbd8d5f6
parentMerge pull request #8162 from german77/bombslinger (diff)
downloadyuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.tar.gz
yuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.tar.xz
yuzu-0cfcee95c7d13d6ea2d7c73c6f1b64a17ceb2aca.zip
service: jit: stub JIT service
-rw-r--r--src/common/logging/filter.cpp1
-rw-r--r--src/common/logging/types.h1
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/am/am.cpp9
-rw-r--r--src/core/hle/service/am/am.h1
-rw-r--r--src/core/hle/service/jit/jit.cpp53
-rw-r--r--src/core/hle/service/jit/jit.h20
-rw-r--r--src/core/hle/service/service.cpp2
8 files changed, 88 insertions, 1 deletions
diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp
index 9120cc178..4acbff649 100644
--- a/src/common/logging/filter.cpp
+++ b/src/common/logging/filter.cpp
@@ -101,6 +101,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
101 SUB(Service, GRC) \ 101 SUB(Service, GRC) \
102 SUB(Service, HID) \ 102 SUB(Service, HID) \
103 SUB(Service, IRS) \ 103 SUB(Service, IRS) \
104 SUB(Service, JIT) \
104 SUB(Service, LBL) \ 105 SUB(Service, LBL) \
105 SUB(Service, LDN) \ 106 SUB(Service, LDN) \
106 SUB(Service, LDR) \ 107 SUB(Service, LDR) \
diff --git a/src/common/logging/types.h b/src/common/logging/types.h
index f803ab796..99c15fa96 100644
--- a/src/common/logging/types.h
+++ b/src/common/logging/types.h
@@ -69,6 +69,7 @@ enum class Class : u8 {
69 Service_GRC, ///< The game recording service 69 Service_GRC, ///< The game recording service
70 Service_HID, ///< The HID (Human interface device) service 70 Service_HID, ///< The HID (Human interface device) service
71 Service_IRS, ///< The IRS service 71 Service_IRS, ///< The IRS service
72 Service_JIT, ///< The JIT service
72 Service_LBL, ///< The LBL (LCD backlight) service 73 Service_LBL, ///< The LBL (LCD backlight) service
73 Service_LDN, ///< The LDN (Local domain network) service 74 Service_LDN, ///< The LDN (Local domain network) service
74 Service_LDR, ///< The loader service 75 Service_LDR, ///< The loader service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 6536d0544..81eaf0942 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -458,6 +458,8 @@ add_library(core STATIC
458 hle/service/hid/controllers/touchscreen.h 458 hle/service/hid/controllers/touchscreen.h
459 hle/service/hid/controllers/xpad.cpp 459 hle/service/hid/controllers/xpad.cpp
460 hle/service/hid/controllers/xpad.h 460 hle/service/hid/controllers/xpad.h
461 hle/service/jit/jit.cpp
462 hle/service/jit/jit.h
461 hle/service/lbl/lbl.cpp 463 hle/service/lbl/lbl.cpp
462 hle/service/lbl/lbl.h 464 hle/service/lbl/lbl.h
463 hle/service/ldn/errors.h 465 hle/service/ldn/errors.h
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 420de3c54..4d7e5ecd3 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -1337,7 +1337,7 @@ IApplicationFunctions::IApplicationFunctions(Core::System& system_)
1337 {200, nullptr, "GetLastApplicationExitReason"}, 1337 {200, nullptr, "GetLastApplicationExitReason"},
1338 {500, nullptr, "StartContinuousRecordingFlushForDebug"}, 1338 {500, nullptr, "StartContinuousRecordingFlushForDebug"},
1339 {1000, nullptr, "CreateMovieMaker"}, 1339 {1000, nullptr, "CreateMovieMaker"},
1340 {1001, nullptr, "PrepareForJit"}, 1340 {1001, &IApplicationFunctions::PrepareForJit, "PrepareForJit"},
1341 }; 1341 };
1342 // clang-format on 1342 // clang-format on
1343 1343
@@ -1787,6 +1787,13 @@ void IApplicationFunctions::GetHealthWarningDisappearedSystemEvent(Kernel::HLERe
1787 rb.PushCopyObjects(health_warning_disappeared_system_event->GetReadableEvent()); 1787 rb.PushCopyObjects(health_warning_disappeared_system_event->GetReadableEvent());
1788} 1788}
1789 1789
1790void IApplicationFunctions::PrepareForJit(Kernel::HLERequestContext& ctx) {
1791 LOG_WARNING(Service_AM, "(STUBBED) called");
1792
1793 IPC::ResponseBuilder rb{ctx, 2};
1794 rb.Push(ResultSuccess);
1795}
1796
1790void InstallInterfaces(SM::ServiceManager& service_manager, NVFlinger::NVFlinger& nvflinger, 1797void InstallInterfaces(SM::ServiceManager& service_manager, NVFlinger::NVFlinger& nvflinger,
1791 Core::System& system) { 1798 Core::System& system) {
1792 auto message_queue = std::make_shared<AppletMessageQueue>(system); 1799 auto message_queue = std::make_shared<AppletMessageQueue>(system);
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index fdd937b82..11a3c0459 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -336,6 +336,7 @@ private:
336 void TryPopFromFriendInvitationStorageChannel(Kernel::HLERequestContext& ctx); 336 void TryPopFromFriendInvitationStorageChannel(Kernel::HLERequestContext& ctx);
337 void GetNotificationStorageChannelEvent(Kernel::HLERequestContext& ctx); 337 void GetNotificationStorageChannelEvent(Kernel::HLERequestContext& ctx);
338 void GetHealthWarningDisappearedSystemEvent(Kernel::HLERequestContext& ctx); 338 void GetHealthWarningDisappearedSystemEvent(Kernel::HLERequestContext& ctx);
339 void PrepareForJit(Kernel::HLERequestContext& ctx);
339 340
340 KernelHelpers::ServiceContext service_context; 341 KernelHelpers::ServiceContext service_context;
341 342
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
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index ab3286db9..edf69e33f 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -32,6 +32,7 @@
32#include "core/hle/service/glue/glue.h" 32#include "core/hle/service/glue/glue.h"
33#include "core/hle/service/grc/grc.h" 33#include "core/hle/service/grc/grc.h"
34#include "core/hle/service/hid/hid.h" 34#include "core/hle/service/hid/hid.h"
35#include "core/hle/service/jit/jit.h"
35#include "core/hle/service/lbl/lbl.h" 36#include "core/hle/service/lbl/lbl.h"
36#include "core/hle/service/ldn/ldn.h" 37#include "core/hle/service/ldn/ldn.h"
37#include "core/hle/service/ldr/ldr.h" 38#include "core/hle/service/ldr/ldr.h"
@@ -261,6 +262,7 @@ Services::Services(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system
261 Glue::InstallInterfaces(system); 262 Glue::InstallInterfaces(system);
262 GRC::InstallInterfaces(*sm, system); 263 GRC::InstallInterfaces(*sm, system);
263 HID::InstallInterfaces(*sm, system); 264 HID::InstallInterfaces(*sm, system);
265 JIT::InstallInterfaces(*sm, system);
264 LBL::InstallInterfaces(*sm, system); 266 LBL::InstallInterfaces(*sm, system);
265 LDN::InstallInterfaces(*sm, system); 267 LDN::InstallInterfaces(*sm, system);
266 LDR::InstallInterfaces(*sm, system); 268 LDR::InstallInterfaces(*sm, system);