summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Liam2024-02-11 18:26:32 -0500
committerGravatar Liam2024-02-11 21:59:33 -0500
commitb2e140b03284fac8fecc7f5bd86f538b76dadc8b (patch)
treef841ce6517a97b2202021ab52e42626711c17af3 /src
parentMerge pull request #12756 from liamwhite/applet-multiprocess-hwc (diff)
downloadyuzu-b2e140b03284fac8fecc7f5bd86f538b76dadc8b.tar.gz
yuzu-b2e140b03284fac8fecc7f5bd86f538b76dadc8b.tar.xz
yuzu-b2e140b03284fac8fecc7f5bd86f538b76dadc8b.zip
am: rewrite appletAE, appletOE
Diffstat (limited to 'src')
-rw-r--r--src/android/app/src/main/jni/native.cpp2
-rw-r--r--src/core/CMakeLists.txt8
-rw-r--r--src/core/hle/service/am/am.cpp12
-rw-r--r--src/core/hle/service/am/am_types.h6
-rw-r--r--src/core/hle/service/am/applet_ae.cpp73
-rw-r--r--src/core/hle/service/am/applet_ae.h39
-rw-r--r--src/core/hle/service/am/applet_oe.cpp42
-rw-r--r--src/core/hle/service/am/applet_oe.h37
-rw-r--r--src/core/hle/service/am/frontend/applets.cpp3
-rw-r--r--src/core/hle/service/am/service/all_system_applet_proxies_service.cpp80
-rw-r--r--src/core/hle/service/am/service/all_system_applet_proxies_service.h47
-rw-r--r--src/core/hle/service/am/service/application_proxy_service.cpp42
-rw-r--r--src/core/hle/service/am/service/application_proxy_service.h35
-rw-r--r--src/yuzu/configuration/configure_input.cpp3
-rw-r--r--src/yuzu/main.cpp3
15 files changed, 220 insertions, 212 deletions
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp
index 4acc60956..a4d8454e8 100644
--- a/src/android/app/src/main/jni/native.cpp
+++ b/src/android/app/src/main/jni/native.cpp
@@ -49,9 +49,7 @@
49#include "core/frontend/applets/profile_select.h" 49#include "core/frontend/applets/profile_select.h"
50#include "core/frontend/applets/software_keyboard.h" 50#include "core/frontend/applets/software_keyboard.h"
51#include "core/frontend/applets/web_browser.h" 51#include "core/frontend/applets/web_browser.h"
52#include "core/hle/service/am/applet_ae.h"
53#include "core/hle/service/am/applet_manager.h" 52#include "core/hle/service/am/applet_manager.h"
54#include "core/hle/service/am/applet_oe.h"
55#include "core/hle/service/am/frontend/applets.h" 53#include "core/hle/service/am/frontend/applets.h"
56#include "core/hle/service/filesystem/filesystem.h" 54#include "core/hle/service/filesystem/filesystem.h"
57#include "core/loader/loader.h" 55#include "core/loader/loader.h"
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 2d5490968..5ae31932c 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -417,14 +417,10 @@ add_library(core STATIC
417 hle/service/am/am_types.h 417 hle/service/am/am_types.h
418 hle/service/am/applet.cpp 418 hle/service/am/applet.cpp
419 hle/service/am/applet.h 419 hle/service/am/applet.h
420 hle/service/am/applet_ae.cpp
421 hle/service/am/applet_ae.h
422 hle/service/am/applet_manager.cpp 420 hle/service/am/applet_manager.cpp
423 hle/service/am/applet_data_broker.cpp 421 hle/service/am/applet_data_broker.cpp
424 hle/service/am/applet_data_broker.h 422 hle/service/am/applet_data_broker.h
425 hle/service/am/applet_manager.h 423 hle/service/am/applet_manager.h
426 hle/service/am/applet_oe.cpp
427 hle/service/am/applet_oe.h
428 hle/service/am/applet_common_functions.cpp 424 hle/service/am/applet_common_functions.cpp
429 hle/service/am/applet_common_functions.h 425 hle/service/am/applet_common_functions.h
430 hle/service/am/applet_message_queue.cpp 426 hle/service/am/applet_message_queue.cpp
@@ -473,6 +469,10 @@ add_library(core STATIC
473 hle/service/am/process.h 469 hle/service/am/process.h
474 hle/service/am/self_controller.cpp 470 hle/service/am/self_controller.cpp
475 hle/service/am/self_controller.h 471 hle/service/am/self_controller.h
472 hle/service/am/service/all_system_applet_proxies_service.cpp
473 hle/service/am/service/all_system_applet_proxies_service.h
474 hle/service/am/service/application_proxy_service.cpp
475 hle/service/am/service/application_proxy_service.h
476 hle/service/am/system_applet_proxy.cpp 476 hle/service/am/system_applet_proxy.cpp
477 hle/service/am/system_applet_proxy.h 477 hle/service/am/system_applet_proxy.h
478 hle/service/am/system_buffer_manager.cpp 478 hle/service/am/system_buffer_manager.cpp
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 8f90eba34..da0f9e3df 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -2,10 +2,10 @@
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#include "core/hle/service/am/am.h" 4#include "core/hle/service/am/am.h"
5#include "core/hle/service/am/applet_ae.h"
6#include "core/hle/service/am/applet_oe.h"
7#include "core/hle/service/am/idle.h" 5#include "core/hle/service/am/idle.h"
8#include "core/hle/service/am/omm.h" 6#include "core/hle/service/am/omm.h"
7#include "core/hle/service/am/service/all_system_applet_proxies_service.h"
8#include "core/hle/service/am/service/application_proxy_service.h"
9#include "core/hle/service/am/spsm.h" 9#include "core/hle/service/am/spsm.h"
10#include "core/hle/service/server_manager.h" 10#include "core/hle/service/server_manager.h"
11 11
@@ -14,10 +14,10 @@ namespace Service::AM {
14void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system) { 14void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system) {
15 auto server_manager = std::make_unique<ServerManager>(system); 15 auto server_manager = std::make_unique<ServerManager>(system);
16 16
17 server_manager->RegisterNamedService("appletAE", 17 server_manager->RegisterNamedService(
18 std::make_shared<AppletAE>(nvnflinger, system)); 18 "appletAE", std::make_shared<IAllSystemAppletProxiesService>(system, nvnflinger));
19 server_manager->RegisterNamedService("appletOE", 19 server_manager->RegisterNamedService(
20 std::make_shared<AppletOE>(nvnflinger, system)); 20 "appletOE", std::make_shared<IApplicationProxyService>(system, nvnflinger));
21 server_manager->RegisterNamedService("idle:sys", std::make_shared<IdleSys>(system)); 21 server_manager->RegisterNamedService("idle:sys", std::make_shared<IdleSys>(system));
22 server_manager->RegisterNamedService("omm", std::make_shared<OMM>(system)); 22 server_manager->RegisterNamedService("omm", std::make_shared<OMM>(system));
23 server_manager->RegisterNamedService("spsm", std::make_shared<SPSM>(system)); 23 server_manager->RegisterNamedService("spsm", std::make_shared<SPSM>(system));
diff --git a/src/core/hle/service/am/am_types.h b/src/core/hle/service/am/am_types.h
index 8c33feb15..749081e3d 100644
--- a/src/core/hle/service/am/am_types.h
+++ b/src/core/hle/service/am/am_types.h
@@ -169,6 +169,12 @@ struct AppletIdentityInfo {
169}; 169};
170static_assert(sizeof(AppletIdentityInfo) == 0x10, "AppletIdentityInfo has incorrect size."); 170static_assert(sizeof(AppletIdentityInfo) == 0x10, "AppletIdentityInfo has incorrect size.");
171 171
172struct AppletAttribute {
173 u8 flag;
174 INSERT_PADDING_BYTES_NOINIT(0x7F);
175};
176static_assert(sizeof(AppletAttribute) == 0x80, "AppletAttribute has incorrect size.");
177
172using AppletResourceUserId = u64; 178using AppletResourceUserId = u64;
173using ProgramId = u64; 179using ProgramId = u64;
174 180
diff --git a/src/core/hle/service/am/applet_ae.cpp b/src/core/hle/service/am/applet_ae.cpp
deleted file mode 100644
index 1b715dea6..000000000
--- a/src/core/hle/service/am/applet_ae.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "core/hle/service/am/applet_ae.h"
5#include "core/hle/service/am/applet_manager.h"
6#include "core/hle/service/am/library_applet_proxy.h"
7#include "core/hle/service/am/system_applet_proxy.h"
8#include "core/hle/service/ipc_helpers.h"
9
10namespace Service::AM {
11
12AppletAE::AppletAE(Nvnflinger::Nvnflinger& nvnflinger_, Core::System& system_)
13 : ServiceFramework{system_, "appletAE"}, nvnflinger{nvnflinger_} {
14 // clang-format off
15 static const FunctionInfo functions[] = {
16 {100, &AppletAE::OpenSystemAppletProxy, "OpenSystemAppletProxy"},
17 {200, &AppletAE::OpenLibraryAppletProxyOld, "OpenLibraryAppletProxyOld"},
18 {201, &AppletAE::OpenLibraryAppletProxy, "OpenLibraryAppletProxy"},
19 {300, nullptr, "OpenOverlayAppletProxy"},
20 {350, nullptr, "OpenSystemApplicationProxy"},
21 {400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"},
22 {410, nullptr, "GetSystemAppletControllerForDebug"},
23 {1000, nullptr, "GetDebugFunctions"},
24 };
25 // clang-format on
26
27 RegisterHandlers(functions);
28}
29
30AppletAE::~AppletAE() = default;
31
32void AppletAE::OpenSystemAppletProxy(HLERequestContext& ctx) {
33 LOG_DEBUG(Service_AM, "called");
34
35 if (const auto applet = GetAppletFromContext(ctx)) {
36 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
37 rb.Push(ResultSuccess);
38 rb.PushIpcInterface<ISystemAppletProxy>(nvnflinger, applet, system);
39 } else {
40 UNIMPLEMENTED();
41
42 IPC::ResponseBuilder rb{ctx, 2};
43 rb.Push(ResultUnknown);
44 }
45}
46
47void AppletAE::OpenLibraryAppletProxy(HLERequestContext& ctx) {
48 LOG_DEBUG(Service_AM, "called");
49
50 if (const auto applet = GetAppletFromContext(ctx)) {
51 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
52 rb.Push(ResultSuccess);
53 rb.PushIpcInterface<ILibraryAppletProxy>(nvnflinger, applet, system);
54 } else {
55 UNIMPLEMENTED();
56
57 IPC::ResponseBuilder rb{ctx, 2};
58 rb.Push(ResultUnknown);
59 }
60}
61
62void AppletAE::OpenLibraryAppletProxyOld(HLERequestContext& ctx) {
63 LOG_DEBUG(Service_AM, "called");
64
65 return OpenLibraryAppletProxy(ctx);
66}
67
68std::shared_ptr<Applet> AppletAE::GetAppletFromContext(HLERequestContext& ctx) {
69 const auto aruid = ctx.GetPID();
70 return system.GetAppletManager().GetByAppletResourceUserId(aruid);
71}
72
73} // namespace Service::AM
diff --git a/src/core/hle/service/am/applet_ae.h b/src/core/hle/service/am/applet_ae.h
deleted file mode 100644
index 3d7961fa1..000000000
--- a/src/core/hle/service/am/applet_ae.h
+++ /dev/null
@@ -1,39 +0,0 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include <memory>
7
8#include "core/hle/service/service.h"
9
10namespace Service {
11namespace FileSystem {
12class FileSystemController;
13}
14
15namespace Nvnflinger {
16class Nvnflinger;
17}
18
19namespace AM {
20
21struct Applet;
22
23class AppletAE final : public ServiceFramework<AppletAE> {
24public:
25 explicit AppletAE(Nvnflinger::Nvnflinger& nvnflinger_, Core::System& system_);
26 ~AppletAE() override;
27
28private:
29 void OpenSystemAppletProxy(HLERequestContext& ctx);
30 void OpenLibraryAppletProxy(HLERequestContext& ctx);
31 void OpenLibraryAppletProxyOld(HLERequestContext& ctx);
32
33 std::shared_ptr<Applet> GetAppletFromContext(HLERequestContext& ctx);
34
35 Nvnflinger::Nvnflinger& nvnflinger;
36};
37
38} // namespace AM
39} // namespace Service
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
deleted file mode 100644
index 56bafd162..000000000
--- a/src/core/hle/service/am/applet_oe.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "core/hle/service/am/am.h"
5#include "core/hle/service/am/applet_manager.h"
6#include "core/hle/service/am/applet_oe.h"
7#include "core/hle/service/am/application_proxy.h"
8#include "core/hle/service/ipc_helpers.h"
9
10namespace Service::AM {
11
12AppletOE::AppletOE(Nvnflinger::Nvnflinger& nvnflinger_, Core::System& system_)
13 : ServiceFramework{system_, "appletOE"}, nvnflinger{nvnflinger_} {
14 static const FunctionInfo functions[] = {
15 {0, &AppletOE::OpenApplicationProxy, "OpenApplicationProxy"},
16 };
17 RegisterHandlers(functions);
18}
19
20AppletOE::~AppletOE() = default;
21
22void AppletOE::OpenApplicationProxy(HLERequestContext& ctx) {
23 LOG_DEBUG(Service_AM, "called");
24
25 if (const auto applet = GetAppletFromContext(ctx)) {
26 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
27 rb.Push(ResultSuccess);
28 rb.PushIpcInterface<IApplicationProxy>(nvnflinger, applet, system);
29 } else {
30 UNIMPLEMENTED();
31
32 IPC::ResponseBuilder rb{ctx, 2};
33 rb.Push(ResultUnknown);
34 }
35}
36
37std::shared_ptr<Applet> AppletOE::GetAppletFromContext(HLERequestContext& ctx) {
38 const auto aruid = ctx.GetPID();
39 return system.GetAppletManager().GetByAppletResourceUserId(aruid);
40}
41
42} // namespace Service::AM
diff --git a/src/core/hle/service/am/applet_oe.h b/src/core/hle/service/am/applet_oe.h
deleted file mode 100644
index f2ba1c924..000000000
--- a/src/core/hle/service/am/applet_oe.h
+++ /dev/null
@@ -1,37 +0,0 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include <memory>
7
8#include "core/hle/service/service.h"
9
10namespace Service {
11namespace FileSystem {
12class FileSystemController;
13}
14
15namespace Nvnflinger {
16class Nvnflinger;
17}
18
19namespace AM {
20
21struct Applet;
22
23class AppletOE final : public ServiceFramework<AppletOE> {
24public:
25 explicit AppletOE(Nvnflinger::Nvnflinger& nvnflinger_, Core::System& system_);
26 ~AppletOE() override;
27
28private:
29 void OpenApplicationProxy(HLERequestContext& ctx);
30
31 std::shared_ptr<Applet> GetAppletFromContext(HLERequestContext& ctx);
32
33 Nvnflinger::Nvnflinger& nvnflinger;
34};
35
36} // namespace AM
37} // namespace Service
diff --git a/src/core/hle/service/am/frontend/applets.cpp b/src/core/hle/service/am/frontend/applets.cpp
index db2b04575..944d8b105 100644
--- a/src/core/hle/service/am/frontend/applets.cpp
+++ b/src/core/hle/service/am/frontend/applets.cpp
@@ -15,11 +15,8 @@
15#include "core/frontend/applets/web_browser.h" 15#include "core/frontend/applets/web_browser.h"
16#include "core/hle/kernel/k_event.h" 16#include "core/hle/kernel/k_event.h"
17#include "core/hle/service/am/am.h" 17#include "core/hle/service/am/am.h"
18#include "core/hle/service/am/applet_ae.h"
19#include "core/hle/service/am/applet_data_broker.h" 18#include "core/hle/service/am/applet_data_broker.h"
20#include "core/hle/service/am/applet_manager.h" 19#include "core/hle/service/am/applet_manager.h"
21#include "core/hle/service/am/applet_message_queue.h"
22#include "core/hle/service/am/applet_oe.h"
23#include "core/hle/service/am/frontend/applet_cabinet.h" 20#include "core/hle/service/am/frontend/applet_cabinet.h"
24#include "core/hle/service/am/frontend/applet_controller.h" 21#include "core/hle/service/am/frontend/applet_controller.h"
25#include "core/hle/service/am/frontend/applet_error.h" 22#include "core/hle/service/am/frontend/applet_error.h"
diff --git a/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp b/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp
new file mode 100644
index 000000000..66c23a749
--- /dev/null
+++ b/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp
@@ -0,0 +1,80 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "core/core.h"
5#include "core/hle/service/am/applet_manager.h"
6#include "core/hle/service/am/library_applet_proxy.h"
7#include "core/hle/service/am/service/all_system_applet_proxies_service.h"
8#include "core/hle/service/am/system_applet_proxy.h"
9#include "core/hle/service/cmif_serialization.h"
10
11namespace Service::AM {
12
13IAllSystemAppletProxiesService::IAllSystemAppletProxiesService(Core::System& system_,
14 Nvnflinger::Nvnflinger& nvnflinger)
15 : ServiceFramework{system_, "appletAE"}, m_nvnflinger{nvnflinger} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {100, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxy"},
19 {200, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld>, "OpenLibraryAppletProxyOld"},
20 {201, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxy>, "OpenLibraryAppletProxy"},
21 {300, nullptr, "OpenOverlayAppletProxy"},
22 {350, nullptr, "OpenSystemApplicationProxy"},
23 {400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"},
24 {410, nullptr, "GetSystemAppletControllerForDebug"},
25 {1000, nullptr, "GetDebugFunctions"},
26 };
27 // clang-format on
28
29 RegisterHandlers(functions);
30}
31
32IAllSystemAppletProxiesService::~IAllSystemAppletProxiesService() = default;
33
34Result IAllSystemAppletProxiesService::OpenSystemAppletProxy(
35 Out<SharedPointer<ISystemAppletProxy>> out_system_applet_proxy, ClientProcessId pid,
36 InCopyHandle<Kernel::KProcess> process_handle) {
37 LOG_DEBUG(Service_AM, "called");
38
39 if (const auto applet = this->GetAppletFromProcessId(pid); applet) {
40 *out_system_applet_proxy =
41 std::make_shared<ISystemAppletProxy>(m_nvnflinger, applet, system);
42 R_SUCCEED();
43 } else {
44 UNIMPLEMENTED();
45 R_THROW(ResultUnknown);
46 }
47}
48
49Result IAllSystemAppletProxiesService::OpenLibraryAppletProxy(
50 Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy, ClientProcessId pid,
51 InCopyHandle<Kernel::KProcess> process_handle,
52 InLargeData<AppletAttribute, BufferAttr_HipcMapAlias> attribute) {
53 LOG_DEBUG(Service_AM, "called");
54
55 if (const auto applet = this->GetAppletFromProcessId(pid); applet) {
56 *out_library_applet_proxy =
57 std::make_shared<ILibraryAppletProxy>(m_nvnflinger, applet, system);
58 R_SUCCEED();
59 } else {
60 UNIMPLEMENTED();
61 R_THROW(ResultUnknown);
62 }
63}
64
65Result IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld(
66 Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy, ClientProcessId pid,
67 InCopyHandle<Kernel::KProcess> process_handle) {
68 LOG_DEBUG(Service_AM, "called");
69
70 AppletAttribute attribute{};
71 R_RETURN(
72 this->OpenLibraryAppletProxy(out_library_applet_proxy, pid, process_handle, attribute));
73}
74
75std::shared_ptr<Applet> IAllSystemAppletProxiesService::GetAppletFromProcessId(
76 ProcessId process_id) {
77 return system.GetAppletManager().GetByAppletResourceUserId(process_id.pid);
78}
79
80} // namespace Service::AM
diff --git a/src/core/hle/service/am/service/all_system_applet_proxies_service.h b/src/core/hle/service/am/service/all_system_applet_proxies_service.h
new file mode 100644
index 000000000..38b1ca2ea
--- /dev/null
+++ b/src/core/hle/service/am/service/all_system_applet_proxies_service.h
@@ -0,0 +1,47 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "core/hle/service/cmif_types.h"
7#include "core/hle/service/service.h"
8
9namespace Service {
10
11namespace Nvnflinger {
12class Nvnflinger;
13}
14
15namespace AM {
16
17struct Applet;
18struct AppletAttribute;
19class ILibraryAppletProxy;
20class ISystemAppletProxy;
21
22class IAllSystemAppletProxiesService final
23 : public ServiceFramework<IAllSystemAppletProxiesService> {
24public:
25 explicit IAllSystemAppletProxiesService(Core::System& system_,
26 Nvnflinger::Nvnflinger& nvnflinger);
27 ~IAllSystemAppletProxiesService() override;
28
29private:
30 Result OpenSystemAppletProxy(Out<SharedPointer<ISystemAppletProxy>> out_system_applet_proxy,
31 ClientProcessId pid,
32 InCopyHandle<Kernel::KProcess> process_handle);
33 Result OpenLibraryAppletProxy(Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy,
34 ClientProcessId pid,
35 InCopyHandle<Kernel::KProcess> process_handle,
36 InLargeData<AppletAttribute, BufferAttr_HipcMapAlias> attribute);
37 Result OpenLibraryAppletProxyOld(
38 Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy, ClientProcessId pid,
39 InCopyHandle<Kernel::KProcess> process_handle);
40
41private:
42 std::shared_ptr<Applet> GetAppletFromProcessId(ProcessId pid);
43 Nvnflinger::Nvnflinger& m_nvnflinger;
44};
45
46} // namespace AM
47} // namespace Service
diff --git a/src/core/hle/service/am/service/application_proxy_service.cpp b/src/core/hle/service/am/service/application_proxy_service.cpp
new file mode 100644
index 000000000..b8532d047
--- /dev/null
+++ b/src/core/hle/service/am/service/application_proxy_service.cpp
@@ -0,0 +1,42 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "core/core.h"
5#include "core/hle/service/am/am.h"
6#include "core/hle/service/am/applet_manager.h"
7#include "core/hle/service/am/application_proxy.h"
8#include "core/hle/service/am/service/application_proxy_service.h"
9#include "core/hle/service/cmif_serialization.h"
10
11namespace Service::AM {
12
13IApplicationProxyService::IApplicationProxyService(Core::System& system_,
14 Nvnflinger::Nvnflinger& nvnflinger)
15 : ServiceFramework{system_, "appletOE"}, m_nvnflinger{nvnflinger} {
16 static const FunctionInfo functions[] = {
17 {0, D<&IApplicationProxyService::OpenApplicationProxy>, "OpenApplicationProxy"},
18 };
19 RegisterHandlers(functions);
20}
21
22IApplicationProxyService::~IApplicationProxyService() = default;
23
24Result IApplicationProxyService::OpenApplicationProxy(
25 Out<SharedPointer<IApplicationProxy>> out_application_proxy, ClientProcessId pid,
26 InCopyHandle<Kernel::KProcess> process_handle) {
27 LOG_DEBUG(Service_AM, "called");
28
29 if (const auto applet = this->GetAppletFromProcessId(pid)) {
30 *out_application_proxy = std::make_shared<IApplicationProxy>(m_nvnflinger, applet, system);
31 R_SUCCEED();
32 } else {
33 UNIMPLEMENTED();
34 R_THROW(ResultUnknown);
35 }
36}
37
38std::shared_ptr<Applet> IApplicationProxyService::GetAppletFromProcessId(ProcessId process_id) {
39 return system.GetAppletManager().GetByAppletResourceUserId(process_id.pid);
40}
41
42} // namespace Service::AM
diff --git a/src/core/hle/service/am/service/application_proxy_service.h b/src/core/hle/service/am/service/application_proxy_service.h
new file mode 100644
index 000000000..1c1d32d0b
--- /dev/null
+++ b/src/core/hle/service/am/service/application_proxy_service.h
@@ -0,0 +1,35 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "core/hle/service/cmif_types.h"
7#include "core/hle/service/service.h"
8
9namespace Service {
10
11namespace Nvnflinger {
12class Nvnflinger;
13}
14
15namespace AM {
16
17struct Applet;
18class IApplicationProxy;
19
20class IApplicationProxyService final : public ServiceFramework<IApplicationProxyService> {
21public:
22 explicit IApplicationProxyService(Core::System& system_, Nvnflinger::Nvnflinger& nvnflinger);
23 ~IApplicationProxyService() override;
24
25private:
26 Result OpenApplicationProxy(Out<SharedPointer<IApplicationProxy>> out_application_proxy,
27 ClientProcessId pid, InCopyHandle<Kernel::KProcess> process_handle);
28
29private:
30 std::shared_ptr<Applet> GetAppletFromProcessId(ProcessId pid);
31 Nvnflinger::Nvnflinger& m_nvnflinger;
32};
33
34} // namespace AM
35} // namespace Service
diff --git a/src/yuzu/configuration/configure_input.cpp b/src/yuzu/configuration/configure_input.cpp
index e28df10bd..28c3baf08 100644
--- a/src/yuzu/configuration/configure_input.cpp
+++ b/src/yuzu/configuration/configure_input.cpp
@@ -8,10 +8,7 @@
8#include "common/settings_enums.h" 8#include "common/settings_enums.h"
9#include "core/core.h" 9#include "core/core.h"
10#include "core/hle/service/am/am.h" 10#include "core/hle/service/am/am.h"
11#include "core/hle/service/am/applet_ae.h"
12#include "core/hle/service/am/applet_manager.h" 11#include "core/hle/service/am/applet_manager.h"
13#include "core/hle/service/am/applet_message_queue.h"
14#include "core/hle/service/am/applet_oe.h"
15#include "core/hle/service/sm/sm.h" 12#include "core/hle/service/sm/sm.h"
16#include "hid_core/frontend/emulated_controller.h" 13#include "hid_core/frontend/emulated_controller.h"
17#include "hid_core/hid_core.h" 14#include "hid_core/hid_core.h"
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 13381fea8..dfa50006a 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -44,9 +44,6 @@
44#include "core/frontend/applets/mii_edit.h" 44#include "core/frontend/applets/mii_edit.h"
45#include "core/frontend/applets/software_keyboard.h" 45#include "core/frontend/applets/software_keyboard.h"
46#include "core/hle/service/acc/profile_manager.h" 46#include "core/hle/service/acc/profile_manager.h"
47#include "core/hle/service/am/applet_ae.h"
48#include "core/hle/service/am/applet_message_queue.h"
49#include "core/hle/service/am/applet_oe.h"
50#include "core/hle/service/am/frontend/applets.h" 47#include "core/hle/service/am/frontend/applets.h"
51#include "core/hle/service/set/system_settings_server.h" 48#include "core/hle/service/set/system_settings_server.h"
52#include "frontend_common/content_manager.h" 49#include "frontend_common/content_manager.h"