From 3d2c3e1fe1167524556d33b1416e3b06073893b6 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 3 May 2018 04:10:05 -0600 Subject: [PATCH] ProcessManager: Stub ProcessTracking code. --- stratosphere/pm/source/pm_main.cpp | 7 +++++++ stratosphere/pm/source/pm_process_track.cpp | 15 +++++++++++++++ stratosphere/pm/source/pm_process_track.hpp | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 stratosphere/pm/source/pm_process_track.cpp create mode 100644 stratosphere/pm/source/pm_process_track.hpp diff --git a/stratosphere/pm/source/pm_main.cpp b/stratosphere/pm/source/pm_main.cpp index b7f4bfd4b..561cc1459 100644 --- a/stratosphere/pm/source/pm_main.cpp +++ b/stratosphere/pm/source/pm_main.cpp @@ -6,6 +6,9 @@ #include #include +#include "pm_boot_mode.hpp" +#include "pm_process_track.hpp" + extern "C" { extern u32 __start__; @@ -82,10 +85,14 @@ int main(int argc, char **argv) { consoleDebugInit(debugDevice_SVC); + /* Initialize and spawn the Process Tracking thread. */ + ProcessTracking::Initialize(); + /* TODO: What's a good timeout value to use here? */ WaitableManager *server_manager = new WaitableManager(U64_MAX); /* TODO: Create services. */ + server_manager->add_waitable(new ServiceServer("pm:bm", 4)); /* Loop forever, servicing our services. */ server_manager->process(); diff --git a/stratosphere/pm/source/pm_process_track.cpp b/stratosphere/pm/source/pm_process_track.cpp new file mode 100644 index 000000000..ec9f1890b --- /dev/null +++ b/stratosphere/pm/source/pm_process_track.cpp @@ -0,0 +1,15 @@ +#include +#include "pm_process_track.hpp" + +void ProcessTracking::Initialize() { + /* TODO: Setup ResourceLimit values, create MainLoop thread. */ +} + +void ProcessTracking::MainLoop() { + /* TODO */ + while (true) { + /* PM, as a sysmodule, is basically just a while loop. */ + + /* This is what while loop. */ + } +} \ No newline at end of file diff --git a/stratosphere/pm/source/pm_process_track.hpp b/stratosphere/pm/source/pm_process_track.hpp new file mode 100644 index 000000000..4f43ff0ac --- /dev/null +++ b/stratosphere/pm/source/pm_process_track.hpp @@ -0,0 +1,8 @@ +#pragma once +#include + +class ProcessTracking { + public: + static void Initialize(); + static void MainLoop(); +}; \ No newline at end of file