From 72eeca1f037261ca2802da79ff1feff813e26e48 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 14 Oct 2017 22:50:04 -0400 Subject: [PATCH] hle: Add service stubs for apm and appletOE. --- src/core/CMakeLists.txt | 6 ++++++ src/core/hle/service/am/am.cpp | 18 ++++++++++++++++++ src/core/hle/service/am/am.h | 16 ++++++++++++++++ src/core/hle/service/am/applet_oe.cpp | 22 ++++++++++++++++++++++ src/core/hle/service/am/applet_oe.h | 19 +++++++++++++++++++ src/core/hle/service/apm/apm.cpp | 27 +++++++++++++++++++++++++++ src/core/hle/service/apm/apm.h | 22 ++++++++++++++++++++++ src/core/hle/service/lm/lm.cpp | 2 +- src/core/hle/service/service.cpp | 4 ++++ src/core/hle/service/sm/sm.cpp | 2 +- 10 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 src/core/hle/service/am/am.cpp create mode 100644 src/core/hle/service/am/am.h create mode 100644 src/core/hle/service/am/applet_oe.cpp create mode 100644 src/core/hle/service/am/applet_oe.h create mode 100644 src/core/hle/service/apm/apm.cpp create mode 100644 src/core/hle/service/apm/apm.h diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 40083607e7..4e95704244 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 0000000000..482aa07ef4 --- /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()->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 0000000000..0aab51bbaf --- /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 0000000000..a5d80f5c7e --- /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 0000000000..1385428b18 --- /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 { +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 0000000000..37b5bd6471 --- /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()->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 0000000000..ce6ac0f66e --- /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 { +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 7296b531ba..3c5fa7de30 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 3141b71f50..1532776814 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::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 2068471f2c..b027651d00 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 unk2 = rp.Pop(); - auto name_buf = rp.PopRaw>(); + auto name_buf = rp.PopRaw>(); std::string name(name_buf.data()); // TODO(yuriks): Permission checks go here