summaryrefslogtreecommitdiff
path: root/src/core/hle/service/jit
diff options
context:
space:
mode:
authorGravatar Liam2023-02-18 16:26:48 -0500
committerGravatar Liam2023-02-21 12:19:25 -0500
commita9369726147c7499e0016e183d5d56a7b44efe4b (patch)
treec1d1b4a9fdafd92863c0922b05d72c14de83ffa7 /src/core/hle/service/jit
parentcore: defer cpu shutdown (diff)
downloadyuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.gz
yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.xz
yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.zip
service: refactor server architecture
Converts services to have their own processes
Diffstat (limited to 'src/core/hle/service/jit')
-rw-r--r--src/core/hle/service/jit/jit.cpp12
-rw-r--r--src/core/hle/service/jit/jit.h7
2 files changed, 9 insertions, 10 deletions
diff --git a/src/core/hle/service/jit/jit.cpp b/src/core/hle/service/jit/jit.cpp
index 47a1277ea..005c212dc 100644
--- a/src/core/hle/service/jit/jit.cpp
+++ b/src/core/hle/service/jit/jit.cpp
@@ -9,6 +9,7 @@
9#include "core/hle/result.h" 9#include "core/hle/result.h"
10#include "core/hle/service/jit/jit.h" 10#include "core/hle/service/jit/jit.h"
11#include "core/hle/service/jit/jit_context.h" 11#include "core/hle/service/jit/jit_context.h"
12#include "core/hle/service/server_manager.h"
12#include "core/hle/service/service.h" 13#include "core/hle/service/service.h"
13#include "core/memory.h" 14#include "core/memory.h"
14 15
@@ -23,8 +24,8 @@ class IJitEnvironment final : public ServiceFramework<IJitEnvironment> {
23public: 24public:
24 explicit IJitEnvironment(Core::System& system_, Kernel::KProcess& process_, CodeRange user_rx, 25 explicit IJitEnvironment(Core::System& system_, Kernel::KProcess& process_, CodeRange user_rx,
25 CodeRange user_ro) 26 CodeRange user_ro)
26 : ServiceFramework{system_, "IJitEnvironment", ServiceThreadType::CreateNew}, 27 : ServiceFramework{system_, "IJitEnvironment"}, process{&process_}, context{
27 process{&process_}, context{system_.Memory()} { 28 system_.Memory()} {
28 // clang-format off 29 // clang-format off
29 static const FunctionInfo functions[] = { 30 static const FunctionInfo functions[] = {
30 {0, &IJitEnvironment::GenerateCode, "GenerateCode"}, 31 {0, &IJitEnvironment::GenerateCode, "GenerateCode"},
@@ -397,8 +398,11 @@ public:
397 } 398 }
398}; 399};
399 400
400void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { 401void LoopProcess(Core::System& system) {
401 std::make_shared<JITU>(system)->InstallAsService(sm); 402 auto server_manager = std::make_unique<ServerManager>(system);
403
404 server_manager->RegisterNamedService("jit:u", std::make_shared<JITU>(system));
405 ServerManager::RunServer(std::move(server_manager));
402} 406}
403 407
404} // namespace Service::JIT 408} // namespace Service::JIT
diff --git a/src/core/hle/service/jit/jit.h b/src/core/hle/service/jit/jit.h
index af0f5b4f3..19014c75a 100644
--- a/src/core/hle/service/jit/jit.h
+++ b/src/core/hle/service/jit/jit.h
@@ -7,13 +7,8 @@ namespace Core {
7class System; 7class System;
8} 8}
9 9
10namespace Service::SM {
11class ServiceManager;
12}
13
14namespace Service::JIT { 10namespace Service::JIT {
15 11
16/// Registers all JIT services with the specified service manager. 12void LoopProcess(Core::System& system);
17void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);
18 13
19} // namespace Service::JIT 14} // namespace Service::JIT