From 4d36697080779746aa431e7d01e9321ff21e0d43 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 14 Jun 2018 23:32:01 -0600 Subject: [PATCH] Make PM Compile. Note: Currently broken. --- .../include/stratosphere/ievent.hpp | 2 +- stratosphere/pm/source/pm_boot_mode.hpp | 4 ++++ stratosphere/pm/source/pm_debug_monitor.hpp | 4 ++++ stratosphere/pm/source/pm_info.hpp | 4 ++++ stratosphere/pm/source/pm_process_wait.hpp | 15 --------------- stratosphere/pm/source/pm_registration.cpp | 10 +++++----- stratosphere/pm/source/pm_registration.hpp | 2 +- stratosphere/pm/source/pm_shell.hpp | 5 +++++ 8 files changed, 24 insertions(+), 22 deletions(-) diff --git a/stratosphere/libstratosphere/include/stratosphere/ievent.hpp b/stratosphere/libstratosphere/include/stratosphere/ievent.hpp index 5d30ce1ef..4d5b1582d 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ievent.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ievent.hpp @@ -46,7 +46,7 @@ class IEvent : public IWaitable { return this->callback(this->arg, this->handles.data(), this->handles.size(), timeout); } - static Result PanicCallback(Handle *handles, size_t num_handles, u64 timeout) { + static Result PanicCallback(void *arg, Handle *handles, size_t num_handles, u64 timeout) { /* TODO: Panic. */ return 0xCAFE; } diff --git a/stratosphere/pm/source/pm_boot_mode.hpp b/stratosphere/pm/source/pm_boot_mode.hpp index 00d1ef9d5..06bfcfa9e 100644 --- a/stratosphere/pm/source/pm_boot_mode.hpp +++ b/stratosphere/pm/source/pm_boot_mode.hpp @@ -12,6 +12,10 @@ class BootModeService final : public IServiceObject { Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override; Result handle_deferred() override; + BootModeService *clone() override { + return new BootModeService(*this); + } + private: /* Actual commands. */ std::tuple get_boot_mode(); diff --git a/stratosphere/pm/source/pm_debug_monitor.hpp b/stratosphere/pm/source/pm_debug_monitor.hpp index 191830e82..16c9c710e 100644 --- a/stratosphere/pm/source/pm_debug_monitor.hpp +++ b/stratosphere/pm/source/pm_debug_monitor.hpp @@ -32,6 +32,10 @@ class DebugMonitorService final : public IServiceObject { Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override; Result handle_deferred() override; + DebugMonitorService *clone() override { + return new DebugMonitorService(*this); + } + private: /* Actual commands. */ std::tuple get_unknown_stub(u64 unknown, OutBuffer out_unknown); diff --git a/stratosphere/pm/source/pm_info.hpp b/stratosphere/pm/source/pm_info.hpp index 3b6e76f35..8e2dcb938 100644 --- a/stratosphere/pm/source/pm_info.hpp +++ b/stratosphere/pm/source/pm_info.hpp @@ -12,6 +12,10 @@ class InformationService final : public IServiceObject { Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override; Result handle_deferred() override; + InformationService *clone() override { + return new InformationService(*this); + } + private: /* Actual commands. */ std::tuple get_title_id(u64 pid); diff --git a/stratosphere/pm/source/pm_process_wait.hpp b/stratosphere/pm/source/pm_process_wait.hpp index bcb41384d..15bd80af5 100644 --- a/stratosphere/pm/source/pm_process_wait.hpp +++ b/stratosphere/pm/source/pm_process_wait.hpp @@ -52,21 +52,6 @@ class ProcessList final : public IWaitable { } /* IWaitable */ - unsigned int get_num_waitables() override { - return process_waiters.size(); - } - - void get_waitables(IWaitable **dst) override { - Lock(); - for (unsigned int i = 0; i < process_waiters.size(); i++) { - dst[i] = process_waiters[i]; - } - Unlock(); - } - - void delete_child(IWaitable *child) override { - /* TODO: Panic, because we should never be asked to delete a child. */ - } Handle get_handle() override { /* TODO: Panic, because we don't have a handle. */ diff --git a/stratosphere/pm/source/pm_registration.cpp b/stratosphere/pm/source/pm_registration.cpp index 9c0d4b440..85e20db95 100644 --- a/stratosphere/pm/source/pm_registration.cpp +++ b/stratosphere/pm/source/pm_registration.cpp @@ -41,15 +41,15 @@ void Registration::AutoProcessListLock::Unlock() { } void Registration::InitializeSystemResources() { - g_process_event = new SystemEvent(&IEvent::PanicCallback); - g_debug_title_event = new SystemEvent(&IEvent::PanicCallback); - g_debug_application_event = new SystemEvent(&IEvent::PanicCallback); - g_process_launch_start_event = new SystemEvent(&Registration::ProcessLaunchStartCallback); + g_process_event = new SystemEvent(NULL, &IEvent::PanicCallback); + g_debug_title_event = new SystemEvent(NULL, &IEvent::PanicCallback); + g_debug_application_event = new SystemEvent(NULL, &IEvent::PanicCallback); + g_process_launch_start_event = new SystemEvent(NULL, &Registration::ProcessLaunchStartCallback); ResourceLimitUtils::InitializeLimits(); } -Result Registration::ProcessLaunchStartCallback(Handle *handles, size_t num_handles, u64 timeout) { +Result Registration::ProcessLaunchStartCallback(void *arg, Handle *handles, size_t num_handles, u64 timeout) { svcClearEvent(handles[0]); Registration::HandleProcessLaunch(); return 0; diff --git a/stratosphere/pm/source/pm_registration.hpp b/stratosphere/pm/source/pm_registration.hpp index 7be41dcde..6232b946b 100644 --- a/stratosphere/pm/source/pm_registration.hpp +++ b/stratosphere/pm/source/pm_registration.hpp @@ -42,7 +42,7 @@ class Registration { static void InitializeSystemResources(); static IWaitable *GetProcessLaunchStartEvent(); - static Result ProcessLaunchStartCallback(Handle *handles, size_t num_handles, u64 timeout); + static Result ProcessLaunchStartCallback(void *arg, Handle *handles, size_t num_handles, u64 timeout); static IWaitable *GetProcessList(); static void HandleSignaledProcess(Process *process); diff --git a/stratosphere/pm/source/pm_shell.hpp b/stratosphere/pm/source/pm_shell.hpp index d27f29bf0..47ef8b3c8 100644 --- a/stratosphere/pm/source/pm_shell.hpp +++ b/stratosphere/pm/source/pm_shell.hpp @@ -35,6 +35,11 @@ class ShellService final : public IServiceObject { Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override; Result handle_deferred() override; + ShellService *clone() override { + return new ShellService(*this); + } + + private: /* Actual commands. */ std::tuple launch_process(u64 launch_flags, Registration::TidSid tid_sid);