summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2017-10-15 04:50:04 +0200
committerbunnei <bunneidev@gmail.com>2017-10-15 04:50:04 +0200
commit72eeca1f037261ca2802da79ff1feff813e26e48 (patch)
tree19c5b2e89cd832f8a87dcc82e415553dceb01060 /src/core
parenthle: Initial implementation of NX service framework and IPC. (diff)
downloadyuzu-72eeca1f037261ca2802da79ff1feff813e26e48.tar
yuzu-72eeca1f037261ca2802da79ff1feff813e26e48.tar.gz
yuzu-72eeca1f037261ca2802da79ff1feff813e26e48.tar.bz2
yuzu-72eeca1f037261ca2802da79ff1feff813e26e48.tar.lz
yuzu-72eeca1f037261ca2802da79ff1feff813e26e48.tar.xz
yuzu-72eeca1f037261ca2802da79ff1feff813e26e48.tar.zst
yuzu-72eeca1f037261ca2802da79ff1feff813e26e48.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CMakeLists.txt6
-rw-r--r--src/core/hle/service/am/am.cpp18
-rw-r--r--src/core/hle/service/am/am.h16
-rw-r--r--src/core/hle/service/am/applet_oe.cpp22
-rw-r--r--src/core/hle/service/am/applet_oe.h19
-rw-r--r--src/core/hle/service/apm/apm.cpp27
-rw-r--r--src/core/hle/service/apm/apm.h22
-rw-r--r--src/core/hle/service/lm/lm.cpp2
-rw-r--r--src/core/hle/service/service.cpp4
-rw-r--r--src/core/hle/service/sm/sm.cpp2
10 files changed, 136 insertions, 2 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 40083607e..4e9570424 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -48,6 +48,9 @@ set(SRCS
hle/kernel/wait_object.cpp
hle/lock.cpp
hle/romfs.cpp
+ hle/service/am/am.cpp
+ hle/service/am/applet_oe.cpp
+ hle/service/apm/apm.cpp
hle/service/dsp_dsp.cpp
hle/service/gsp_gpu.cpp
hle/service/hid/hid.cpp
@@ -137,6 +140,9 @@ set(HEADERS
hle/lock.h
hle/result.h
hle/romfs.h
+ hle/service/am/am.h
+ hle/service/am/applet_oe.h
+ hle/service/apm/apm.h
hle/service/dsp_dsp.h
hle/service/gsp_gpu.h
hle/service/hid/hid.h
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
new file mode 100644
index 000000000..482aa07ef
--- /dev/null
+++ b/src/core/hle/service/am/am.cpp
@@ -0,0 +1,18 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "common/logging/log.h"
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/am/am.h"
+#include "core/hle/service/am/applet_oe.h"
+
+namespace Service {
+namespace AM {
+
+void InstallInterfaces(SM::ServiceManager& service_manager) {
+ std::make_shared<AppletOE>()->InstallAsService(service_manager);
+}
+
+} // namespace AM
+} // namespace Service
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
new file mode 100644
index 000000000..0aab51bba
--- /dev/null
+++ b/src/core/hle/service/am/am.h
@@ -0,0 +1,16 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "core/hle/service/service.h"
+
+namespace Service {
+namespace AM {
+
+/// Registers all AM services with the specified service manager.
+void InstallInterfaces(SM::ServiceManager& service_manager);
+
+} // namespace AM
+} // namespace Service
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
new file mode 100644
index 000000000..a5d80f5c7
--- /dev/null
+++ b/src/core/hle/service/am/applet_oe.cpp
@@ -0,0 +1,22 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "common/logging/log.h"
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/am/applet_oe.h"
+
+namespace Service {
+namespace AM {
+
+AppletOE::AppletOE() : ServiceFramework("appletOE") {
+ static const FunctionInfo functions[] = {
+ {0x00000000, nullptr, "OpenApplicationProxy"},
+ };
+ RegisterHandlers(functions);
+}
+
+AppletOE::~AppletOE() = default;
+
+} // namespace AM
+} // namespace Service
diff --git a/src/core/hle/service/am/applet_oe.h b/src/core/hle/service/am/applet_oe.h
new file mode 100644
index 000000000..1385428b1
--- /dev/null
+++ b/src/core/hle/service/am/applet_oe.h
@@ -0,0 +1,19 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "core/hle/service/service.h"
+
+namespace Service {
+namespace AM {
+
+class AppletOE final : public ServiceFramework<AppletOE> {
+public:
+ explicit AppletOE();
+ ~AppletOE();
+};
+
+} // namespace AM
+} // namespace Service
diff --git a/src/core/hle/service/apm/apm.cpp b/src/core/hle/service/apm/apm.cpp
new file mode 100644
index 000000000..37b5bd647
--- /dev/null
+++ b/src/core/hle/service/apm/apm.cpp
@@ -0,0 +1,27 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "common/logging/log.h"
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/apm/apm.h"
+
+namespace Service {
+namespace APM {
+
+void InstallInterfaces(SM::ServiceManager& service_manager) {
+ std::make_shared<APM>()->InstallAsService(service_manager);
+}
+
+APM::APM() : ServiceFramework("apm") {
+ static const FunctionInfo functions[] = {
+ {0x00000000, nullptr, "OpenSession"},
+ {0x00000001, nullptr, "GetPerformanceMode"},
+ };
+ RegisterHandlers(functions);
+}
+
+APM::~APM() = default;
+
+} // namespace APM
+} // namespace Service
diff --git a/src/core/hle/service/apm/apm.h b/src/core/hle/service/apm/apm.h
new file mode 100644
index 000000000..ce6ac0f66
--- /dev/null
+++ b/src/core/hle/service/apm/apm.h
@@ -0,0 +1,22 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "core/hle/service/service.h"
+
+namespace Service {
+namespace APM {
+
+class APM final : public ServiceFramework<APM> {
+public:
+ explicit APM();
+ ~APM();
+};
+
+/// Registers all AM services with the specified service manager.
+void InstallInterfaces(SM::ServiceManager& service_manager);
+
+} // namespace APM
+} // namespace Service
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index 7296b531b..3c5fa7de3 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -14,7 +14,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
}
/**
- * SRV::Initialize service function
+ * LM::Initialize service function
* Inputs:
* 0: 0x00000000
* Outputs:
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 3141b71f5..153277681 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -15,6 +15,8 @@
#include "core/hle/kernel/server_session.h"
#include "core/hle/kernel/thread.h"
#include "core/hle/kernel/handle_table.h"
+#include "core/hle/service/am/am.h"
+#include "core/hle/service/apm/apm.h"
#include "core/hle/service/dsp_dsp.h"
#include "core/hle/service/gsp_gpu.h"
#include "core/hle/service/hid/hid.h"
@@ -157,6 +159,8 @@ void Init() {
SM::g_service_manager = std::make_shared<SM::ServiceManager>();
SM::ServiceManager::InstallInterfaces(SM::g_service_manager);
+ AM::InstallInterfaces(*SM::g_service_manager);
+ APM::InstallInterfaces(*SM::g_service_manager);
LM::InstallInterfaces(*SM::g_service_manager);
HID::Init();
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index 2068471f2..b027651d0 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -103,7 +103,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
u32 unk1 = rp.Pop<u32>();
u32 unk2 = rp.Pop<u32>();
- auto name_buf = rp.PopRaw<std::array<char, 6>>();
+ auto name_buf = rp.PopRaw<std::array<char, 9>>();
std::string name(name_buf.data());
// TODO(yuriks): Permission checks go here