2019-06-29 10:20:36 +01:00
|
|
|
/*
|
2021-10-04 20:59:10 +01:00
|
|
|
* Copyright (c) Atmosphère-NX
|
2019-06-29 10:20:36 +01:00
|
|
|
*
|
|
|
|
* 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 <stratosphere.hpp>
|
|
|
|
|
2019-10-24 10:30:10 +01:00
|
|
|
namespace ams::pm::impl {
|
2019-06-29 10:20:36 +01:00
|
|
|
|
|
|
|
/* Initialization. */
|
|
|
|
Result InitializeProcessManager();
|
|
|
|
|
|
|
|
/* Process Management. */
|
2019-10-28 04:43:01 +00:00
|
|
|
Result LaunchProgram(os::ProcessId *out_process_id, const ncm::ProgramLocation &loc, u32 flags);
|
2019-10-15 06:49:06 +01:00
|
|
|
Result StartProcess(os::ProcessId process_id);
|
|
|
|
Result TerminateProcess(os::ProcessId process_id);
|
2019-10-28 04:43:01 +00:00
|
|
|
Result TerminateProgram(ncm::ProgramId program_id);
|
2021-10-04 22:54:13 +01:00
|
|
|
Result GetProcessEventHandle(os::NativeHandle *out);
|
2019-06-29 10:20:36 +01:00
|
|
|
Result GetProcessEventInfo(ProcessEventInfo *out);
|
2019-10-15 06:49:06 +01:00
|
|
|
Result CleanupProcess(os::ProcessId process_id);
|
|
|
|
Result ClearExceptionOccurred(os::ProcessId process_id);
|
2019-06-29 10:20:36 +01:00
|
|
|
|
|
|
|
/* Information Getters. */
|
|
|
|
Result GetModuleIdList(u32 *out_count, u8 *out_buf, size_t max_out_count, u64 unused);
|
2019-10-15 06:49:06 +01:00
|
|
|
Result GetExceptionProcessIdList(u32 *out_count, os::ProcessId *out_process_ids, size_t max_out_count);
|
2019-10-28 04:43:01 +00:00
|
|
|
Result GetProcessId(os::ProcessId *out, ncm::ProgramId program_id);
|
|
|
|
Result GetProgramId(ncm::ProgramId *out, os::ProcessId process_id);
|
2019-10-15 06:49:06 +01:00
|
|
|
Result GetApplicationProcessId(os::ProcessId *out_process_id);
|
2021-10-04 22:54:13 +01:00
|
|
|
Result AtmosphereGetProcessInfo(os::NativeHandle *out_process_handle, ncm::ProgramLocation *out_loc, cfg::OverrideStatus *out_status, os::ProcessId process_id);
|
2019-06-29 10:20:36 +01:00
|
|
|
|
|
|
|
/* Hook API. */
|
2021-10-04 22:54:13 +01:00
|
|
|
Result HookToCreateProcess(os::NativeHandle *out_hook, ncm::ProgramId program_id);
|
|
|
|
Result HookToCreateApplicationProcess(os::NativeHandle *out_hook);
|
2019-06-29 10:20:36 +01:00
|
|
|
Result ClearHook(u32 which);
|
|
|
|
|
|
|
|
/* Boot API. */
|
|
|
|
Result NotifyBootFinished();
|
2021-10-04 22:54:13 +01:00
|
|
|
Result GetBootFinishedEventHandle(os::NativeHandle *out);
|
2019-06-29 10:20:36 +01:00
|
|
|
|
|
|
|
/* Resource Limit API. */
|
|
|
|
Result BoostSystemMemoryResourceLimit(u64 boost_size);
|
2019-07-03 05:27:53 +01:00
|
|
|
Result BoostApplicationThreadResourceLimit();
|
2022-03-22 06:52:16 +00:00
|
|
|
Result BoostSystemThreadResourceLimit();
|
|
|
|
Result GetAppletCurrentResourceLimitValues(pm::ResourceLimitValues *out);
|
|
|
|
Result GetAppletPeakResourceLimitValues(pm::ResourceLimitValues *out);
|
2020-03-29 23:24:40 +01:00
|
|
|
Result AtmosphereGetCurrentLimitInfo(s64 *out_cur_val, s64 *out_lim_val, u32 group, u32 resource);
|
2023-05-09 23:07:40 +01:00
|
|
|
Result BoostSystemMemoryResourceLimitForMitm(u64 boost_size);
|
2019-06-29 10:20:36 +01:00
|
|
|
|
|
|
|
}
|