From bca698a17ae4b39106cd7f8c7eef06ccc7c8d6dd Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 11 Feb 2024 21:01:19 -0500 Subject: am: move out omm interfaces to new module --- src/core/CMakeLists.txt | 14 ++++--- src/core/hle/service/am/am.cpp | 6 --- src/core/hle/service/am/idle.cpp | 25 ----------- src/core/hle/service/am/idle.h | 20 --------- src/core/hle/service/am/omm.cpp | 48 --------------------- src/core/hle/service/am/omm.h | 20 --------- src/core/hle/service/am/spsm.cpp | 31 -------------- src/core/hle/service/am/spsm.h | 20 --------- src/core/hle/service/omm/omm.cpp | 22 ++++++++++ src/core/hle/service/omm/omm.h | 14 +++++++ .../hle/service/omm/operation_mode_manager.cpp | 49 ++++++++++++++++++++++ src/core/hle/service/omm/operation_mode_manager.h | 20 +++++++++ src/core/hle/service/omm/policy_manager_system.cpp | 26 ++++++++++++ src/core/hle/service/omm/policy_manager_system.h | 20 +++++++++ src/core/hle/service/omm/power_state_interface.cpp | 32 ++++++++++++++ src/core/hle/service/omm/power_state_interface.h | 20 +++++++++ src/core/hle/service/service.cpp | 2 + 17 files changed, 213 insertions(+), 176 deletions(-) delete mode 100644 src/core/hle/service/am/idle.cpp delete mode 100644 src/core/hle/service/am/idle.h delete mode 100644 src/core/hle/service/am/omm.cpp delete mode 100644 src/core/hle/service/am/omm.h delete mode 100644 src/core/hle/service/am/spsm.cpp delete mode 100644 src/core/hle/service/am/spsm.h create mode 100644 src/core/hle/service/omm/omm.cpp create mode 100644 src/core/hle/service/omm/omm.h create mode 100644 src/core/hle/service/omm/operation_mode_manager.cpp create mode 100644 src/core/hle/service/omm/operation_mode_manager.h create mode 100644 src/core/hle/service/omm/policy_manager_system.cpp create mode 100644 src/core/hle/service/omm/policy_manager_system.h create mode 100644 src/core/hle/service/omm/power_state_interface.cpp create mode 100644 src/core/hle/service/omm/power_state_interface.h (limited to 'src/core') diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 8fd99a5e9..5e2f4869e 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -425,14 +425,10 @@ add_library(core STATIC hle/service/am/applet_message_queue.h hle/service/am/hid_registration.cpp hle/service/am/hid_registration.h - hle/service/am/idle.cpp - hle/service/am/idle.h hle/service/am/library_applet_storage.cpp hle/service/am/library_applet_storage.h hle/service/am/managed_layer_holder.cpp hle/service/am/managed_layer_holder.h - hle/service/am/omm.cpp - hle/service/am/omm.h hle/service/am/process.cpp hle/service/am/process.h hle/service/am/service/all_system_applet_proxies_service.cpp @@ -487,8 +483,6 @@ add_library(core STATIC hle/service/am/service/window_controller.h hle/service/am/system_buffer_manager.cpp hle/service/am/system_buffer_manager.h - hle/service/am/spsm.cpp - hle/service/am/spsm.h hle/service/aoc/aoc_u.cpp hle/service/aoc/aoc_u.h hle/service/apm/apm.cpp @@ -815,6 +809,14 @@ add_library(core STATIC hle/service/nvnflinger/window.h hle/service/olsc/olsc.cpp hle/service/olsc/olsc.h + hle/service/omm/omm.cpp + hle/service/omm/omm.h + hle/service/omm/operation_mode_manager.cpp + hle/service/omm/operation_mode_manager.h + hle/service/omm/policy_manager_system.cpp + hle/service/omm/policy_manager_system.h + hle/service/omm/power_state_interface.cpp + hle/service/omm/power_state_interface.h hle/service/os/event.cpp hle/service/os/event.h hle/service/os/multi_wait_holder.cpp diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index da0f9e3df..9dc710ba9 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -2,11 +2,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "core/hle/service/am/am.h" -#include "core/hle/service/am/idle.h" -#include "core/hle/service/am/omm.h" #include "core/hle/service/am/service/all_system_applet_proxies_service.h" #include "core/hle/service/am/service/application_proxy_service.h" -#include "core/hle/service/am/spsm.h" #include "core/hle/service/server_manager.h" namespace Service::AM { @@ -18,9 +15,6 @@ void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system) { "appletAE", std::make_shared(system, nvnflinger)); server_manager->RegisterNamedService( "appletOE", std::make_shared(system, nvnflinger)); - server_manager->RegisterNamedService("idle:sys", std::make_shared(system)); - server_manager->RegisterNamedService("omm", std::make_shared(system)); - server_manager->RegisterNamedService("spsm", std::make_shared(system)); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/am/idle.cpp b/src/core/hle/service/am/idle.cpp deleted file mode 100644 index 603515284..000000000 --- a/src/core/hle/service/am/idle.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/am/idle.h" - -namespace Service::AM { - -IdleSys::IdleSys(Core::System& system_) : ServiceFramework{system_, "idle:sys"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetAutoPowerDownEvent"}, - {1, nullptr, "IsAutoPowerDownRequested"}, - {2, nullptr, "Unknown2"}, - {3, nullptr, "SetHandlingContext"}, - {4, nullptr, "LoadAndApplySettings"}, - {5, nullptr, "ReportUserIsActive"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IdleSys::~IdleSys() = default; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/idle.h b/src/core/hle/service/am/idle.h deleted file mode 100644 index 15b31f67e..000000000 --- a/src/core/hle/service/am/idle.h +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::AM { - -class IdleSys final : public ServiceFramework { -public: - explicit IdleSys(Core::System& system_); - ~IdleSys() override; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/omm.cpp b/src/core/hle/service/am/omm.cpp deleted file mode 100644 index 66824e495..000000000 --- a/src/core/hle/service/am/omm.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/am/omm.h" - -namespace Service::AM { - -OMM::OMM(Core::System& system_) : ServiceFramework{system_, "omm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetOperationMode"}, - {1, nullptr, "GetOperationModeChangeEvent"}, - {2, nullptr, "EnableAudioVisual"}, - {3, nullptr, "DisableAudioVisual"}, - {4, nullptr, "EnterSleepAndWait"}, - {5, nullptr, "GetCradleStatus"}, - {6, nullptr, "FadeInDisplay"}, - {7, nullptr, "FadeOutDisplay"}, - {8, nullptr, "GetCradleFwVersion"}, - {9, nullptr, "NotifyCecSettingsChanged"}, - {10, nullptr, "SetOperationModePolicy"}, - {11, nullptr, "GetDefaultDisplayResolution"}, - {12, nullptr, "GetDefaultDisplayResolutionChangeEvent"}, - {13, nullptr, "UpdateDefaultDisplayResolution"}, - {14, nullptr, "ShouldSleepOnBoot"}, - {15, nullptr, "NotifyHdcpApplicationExecutionStarted"}, - {16, nullptr, "NotifyHdcpApplicationExecutionFinished"}, - {17, nullptr, "NotifyHdcpApplicationDrawingStarted"}, - {18, nullptr, "NotifyHdcpApplicationDrawingFinished"}, - {19, nullptr, "GetHdcpAuthenticationFailedEvent"}, - {20, nullptr, "GetHdcpAuthenticationFailedEmulationEnabled"}, - {21, nullptr, "SetHdcpAuthenticationFailedEmulation"}, - {22, nullptr, "GetHdcpStateChangeEvent"}, - {23, nullptr, "GetHdcpState"}, - {24, nullptr, "ShowCardUpdateProcessing"}, - {25, nullptr, "SetApplicationCecSettingsAndNotifyChanged"}, - {26, nullptr, "GetOperationModeSystemInfo"}, - {27, nullptr, "GetAppletFullAwakingSystemEvent"}, - {28, nullptr, "CreateCradleFirmwareUpdater"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -OMM::~OMM() = default; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/omm.h b/src/core/hle/service/am/omm.h deleted file mode 100644 index 73d0c82d5..000000000 --- a/src/core/hle/service/am/omm.h +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::AM { - -class OMM final : public ServiceFramework { -public: - explicit OMM(Core::System& system_); - ~OMM() override; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/spsm.cpp b/src/core/hle/service/am/spsm.cpp deleted file mode 100644 index ec581e32b..000000000 --- a/src/core/hle/service/am/spsm.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/am/spsm.h" - -namespace Service::AM { - -SPSM::SPSM(Core::System& system_) : ServiceFramework{system_, "spsm"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetState"}, - {1, nullptr, "EnterSleep"}, - {2, nullptr, "GetLastWakeReason"}, - {3, nullptr, "Shutdown"}, - {4, nullptr, "GetNotificationMessageEventHandle"}, - {5, nullptr, "ReceiveNotificationMessage"}, - {6, nullptr, "AnalyzeLogForLastSleepWakeSequence"}, - {7, nullptr, "ResetEventLog"}, - {8, nullptr, "AnalyzePerformanceLogForLastSleepWakeSequence"}, - {9, nullptr, "ChangeHomeButtonLongPressingTime"}, - {10, nullptr, "PutErrorState"}, - {11, nullptr, "InvalidateCurrentHomeButtonPressing"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -SPSM::~SPSM() = default; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/spsm.h b/src/core/hle/service/am/spsm.h deleted file mode 100644 index 922f8863e..000000000 --- a/src/core/hle/service/am/spsm.h +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::AM { - -class SPSM final : public ServiceFramework { -public: - explicit SPSM(Core::System& system_); - ~SPSM() override; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/omm/omm.cpp b/src/core/hle/service/omm/omm.cpp new file mode 100644 index 000000000..b95319e26 --- /dev/null +++ b/src/core/hle/service/omm/omm.cpp @@ -0,0 +1,22 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/omm/omm.h" +#include "core/hle/service/omm/operation_mode_manager.h" +#include "core/hle/service/omm/policy_manager_system.h" +#include "core/hle/service/omm/power_state_interface.h" +#include "core/hle/service/server_manager.h" + +namespace Service::OMM { + +void LoopProcess(Core::System& system) { + auto server_manager = std::make_unique(system); + + server_manager->RegisterNamedService("idle:sys", + std::make_shared(system)); + server_manager->RegisterNamedService("omm", std::make_shared(system)); + server_manager->RegisterNamedService("spsm", std::make_shared(system)); + ServerManager::RunServer(std::move(server_manager)); +} + +} // namespace Service::OMM diff --git a/src/core/hle/service/omm/omm.h b/src/core/hle/service/omm/omm.h new file mode 100644 index 000000000..7bf04688a --- /dev/null +++ b/src/core/hle/service/omm/omm.h @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +namespace Core { +class System; +} + +namespace Service::OMM { + +void LoopProcess(Core::System& system); + +} // namespace Service::OMM diff --git a/src/core/hle/service/omm/operation_mode_manager.cpp b/src/core/hle/service/omm/operation_mode_manager.cpp new file mode 100644 index 000000000..fe7ed84a7 --- /dev/null +++ b/src/core/hle/service/omm/operation_mode_manager.cpp @@ -0,0 +1,49 @@ +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/omm/operation_mode_manager.h" + +namespace Service::OMM { + +IOperationModeManager::IOperationModeManager(Core::System& system_) + : ServiceFramework{system_, "omm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetOperationMode"}, + {1, nullptr, "GetOperationModeChangeEvent"}, + {2, nullptr, "EnableAudioVisual"}, + {3, nullptr, "DisableAudioVisual"}, + {4, nullptr, "EnterSleepAndWait"}, + {5, nullptr, "GetCradleStatus"}, + {6, nullptr, "FadeInDisplay"}, + {7, nullptr, "FadeOutDisplay"}, + {8, nullptr, "GetCradleFwVersion"}, + {9, nullptr, "NotifyCecSettingsChanged"}, + {10, nullptr, "SetOperationModePolicy"}, + {11, nullptr, "GetDefaultDisplayResolution"}, + {12, nullptr, "GetDefaultDisplayResolutionChangeEvent"}, + {13, nullptr, "UpdateDefaultDisplayResolution"}, + {14, nullptr, "ShouldSleepOnBoot"}, + {15, nullptr, "NotifyHdcpApplicationExecutionStarted"}, + {16, nullptr, "NotifyHdcpApplicationExecutionFinished"}, + {17, nullptr, "NotifyHdcpApplicationDrawingStarted"}, + {18, nullptr, "NotifyHdcpApplicationDrawingFinished"}, + {19, nullptr, "GetHdcpAuthenticationFailedEvent"}, + {20, nullptr, "GetHdcpAuthenticationFailedEmulationEnabled"}, + {21, nullptr, "SetHdcpAuthenticationFailedEmulation"}, + {22, nullptr, "GetHdcpStateChangeEvent"}, + {23, nullptr, "GetHdcpState"}, + {24, nullptr, "ShowCardUpdateProcessing"}, + {25, nullptr, "SetApplicationCecSettingsAndNotifyChanged"}, + {26, nullptr, "GetOperationModeSystemInfo"}, + {27, nullptr, "GetAppletFullAwakingSystemEvent"}, + {28, nullptr, "CreateCradleFirmwareUpdater"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IOperationModeManager::~IOperationModeManager() = default; + +} // namespace Service::OMM diff --git a/src/core/hle/service/omm/operation_mode_manager.h b/src/core/hle/service/omm/operation_mode_manager.h new file mode 100644 index 000000000..32bc7b2f9 --- /dev/null +++ b/src/core/hle/service/omm/operation_mode_manager.h @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::OMM { + +class IOperationModeManager final : public ServiceFramework { +public: + explicit IOperationModeManager(Core::System& system_); + ~IOperationModeManager() override; +}; + +} // namespace Service::OMM diff --git a/src/core/hle/service/omm/policy_manager_system.cpp b/src/core/hle/service/omm/policy_manager_system.cpp new file mode 100644 index 000000000..1cd6fd807 --- /dev/null +++ b/src/core/hle/service/omm/policy_manager_system.cpp @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/omm/policy_manager_system.h" + +namespace Service::OMM { + +IPolicyManagerSystem::IPolicyManagerSystem(Core::System& system_) + : ServiceFramework{system_, "idle:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetAutoPowerDownEvent"}, + {1, nullptr, "IsAutoPowerDownRequested"}, + {2, nullptr, "Unknown2"}, + {3, nullptr, "SetHandlingContext"}, + {4, nullptr, "LoadAndApplySettings"}, + {5, nullptr, "ReportUserIsActive"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IPolicyManagerSystem::~IPolicyManagerSystem() = default; + +} // namespace Service::OMM diff --git a/src/core/hle/service/omm/policy_manager_system.h b/src/core/hle/service/omm/policy_manager_system.h new file mode 100644 index 000000000..151ca0d2e --- /dev/null +++ b/src/core/hle/service/omm/policy_manager_system.h @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::OMM { + +class IPolicyManagerSystem final : public ServiceFramework { +public: + explicit IPolicyManagerSystem(Core::System& system_); + ~IPolicyManagerSystem() override; +}; + +} // namespace Service::OMM diff --git a/src/core/hle/service/omm/power_state_interface.cpp b/src/core/hle/service/omm/power_state_interface.cpp new file mode 100644 index 000000000..22cac8259 --- /dev/null +++ b/src/core/hle/service/omm/power_state_interface.cpp @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/omm/power_state_interface.h" + +namespace Service::OMM { + +IPowerStateInterface::IPowerStateInterface(Core::System& system_) + : ServiceFramework{system_, "spsm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetState"}, + {1, nullptr, "EnterSleep"}, + {2, nullptr, "GetLastWakeReason"}, + {3, nullptr, "Shutdown"}, + {4, nullptr, "GetNotificationMessageEventHandle"}, + {5, nullptr, "ReceiveNotificationMessage"}, + {6, nullptr, "AnalyzeLogForLastSleepWakeSequence"}, + {7, nullptr, "ResetEventLog"}, + {8, nullptr, "AnalyzePerformanceLogForLastSleepWakeSequence"}, + {9, nullptr, "ChangeHomeButtonLongPressingTime"}, + {10, nullptr, "PutErrorState"}, + {11, nullptr, "InvalidateCurrentHomeButtonPressing"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IPowerStateInterface::~IPowerStateInterface() = default; + +} // namespace Service::OMM diff --git a/src/core/hle/service/omm/power_state_interface.h b/src/core/hle/service/omm/power_state_interface.h new file mode 100644 index 000000000..825a6512d --- /dev/null +++ b/src/core/hle/service/omm/power_state_interface.h @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::OMM { + +class IPowerStateInterface final : public ServiceFramework { +public: + explicit IPowerStateInterface(Core::System& system_); + ~IPowerStateInterface() override; +}; + +} // namespace Service::OMM diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index f68c3c686..fbdf217ba 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -52,6 +52,7 @@ #include "core/hle/service/nvnflinger/hos_binder_driver_server.h" #include "core/hle/service/nvnflinger/nvnflinger.h" #include "core/hle/service/olsc/olsc.h" +#include "core/hle/service/omm/omm.h" #include "core/hle/service/pcie/pcie.h" #include "core/hle/service/pctl/pctl_module.h" #include "core/hle/service/pcv/pcv.h" @@ -266,6 +267,7 @@ Services::Services(std::shared_ptr& sm, Core::System& system kernel.RunOnGuestCoreProcess("npns", [&] { NPNS::LoopProcess(system); }); kernel.RunOnGuestCoreProcess("ns", [&] { NS::LoopProcess(system); }); kernel.RunOnGuestCoreProcess("olsc", [&] { OLSC::LoopProcess(system); }); + kernel.RunOnGuestCoreProcess("omm", [&] { OMM::LoopProcess(system); }); kernel.RunOnGuestCoreProcess("pcie", [&] { PCIe::LoopProcess(system); }); kernel.RunOnGuestCoreProcess("pctl", [&] { PCTL::LoopProcess(system); }); kernel.RunOnGuestCoreProcess("pcv", [&] { PCV::LoopProcess(system); }); -- cgit v1.2.3