mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
pgl: Implement pgl::srv::Initialize
This commit is contained in:
parent
25c392676b
commit
c2bf630c40
7 changed files with 73 additions and 3 deletions
|
@ -19,4 +19,5 @@
|
|||
#include <stratosphere/pgl/pgl_types.hpp>
|
||||
#include <stratosphere/pgl/pgl_event_observer.hpp>
|
||||
#include <stratosphere/pgl/pgl_shell_api.hpp>
|
||||
#include <stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp>
|
||||
#include <stratosphere/pgl/pgl_shell_api.hpp>
|
||||
#include <stratosphere/pgl/srv/pgl_srv_api.hpp>
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/pgl/pgl_types.hpp>
|
||||
#include <stratosphere/pgl/srv/pgl_srv_shell_interface.hpp>
|
||||
|
||||
namespace ams::pgl::srv {
|
||||
|
||||
void Initialize(ShellInterface *interface, MemoryResource *mr);
|
||||
|
||||
}
|
|
@ -14,7 +14,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
#include <stratosphere.hpp>
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/pgl/pgl_types.hpp>
|
||||
#include <stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp>
|
||||
|
||||
namespace ams::pgl::srv {
|
||||
|
|
@ -27,5 +27,6 @@ namespace ams::pm::shell {
|
|||
Result TerminateProcess(os::ProcessId process_id);
|
||||
Result GetApplicationProcessIdForShell(os::ProcessId *out);
|
||||
Result BoostSystemMemoryResourceLimit(u64 size);
|
||||
Result EnableApplicationExtraThread();
|
||||
|
||||
}
|
||||
|
|
38
libraries/libstratosphere/source/pgl/srv/pgl_srv_api.cpp
Normal file
38
libraries/libstratosphere/source/pgl/srv/pgl_srv_api.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stratosphere.hpp>
|
||||
#include "pgl_srv_shell.hpp"
|
||||
|
||||
namespace ams::pgl::srv {
|
||||
|
||||
void Initialize(ShellInterface *interface, MemoryResource *mr) {
|
||||
/* Set the memory resource for the interface. */
|
||||
interface->Initialize(mr);
|
||||
|
||||
/* Enable extra application threads, if we should. */
|
||||
u8 enable_application_extra_thread;
|
||||
const size_t sz = settings::fwdbg::GetSettingsItemValue(std::addressof(enable_application_extra_thread), sizeof(enable_application_extra_thread), "application_extra_thread", "enable_application_extra_thread");
|
||||
if (sz == sizeof(enable_application_extra_thread) && enable_application_extra_thread != 0) {
|
||||
/* NOTE: Nintendo does not check that this succeeds. */
|
||||
pm::shell::EnableApplicationExtraThread();
|
||||
}
|
||||
|
||||
/* Start the Process Tracking thread. */
|
||||
pgl::srv::InitializeProcessControlTask();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -14,7 +14,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stratosphere.hpp>
|
||||
#include "pgl_srv_shell_interface.hpp"
|
||||
#include "pgl_srv_shell.hpp"
|
||||
|
||||
namespace ams::pgl::srv {
|
||||
|
|
|
@ -37,4 +37,8 @@ namespace ams::pm::shell {
|
|||
return ::pmshellBoostSystemMemoryResourceLimit(size);
|
||||
}
|
||||
|
||||
Result EnableApplicationExtraThread() {
|
||||
return ::pmshellEnableApplicationExtraThread();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue