mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-18 08:22:04 +00:00
boot2: update for 10.0.0
This commit is contained in:
parent
353e27b9e2
commit
8547802904
1 changed files with 21 additions and 9 deletions
|
@ -39,6 +39,7 @@ namespace ams::boot2 {
|
|||
ncm::SystemProgramId::NvServices, /* nvservices */
|
||||
ncm::SystemProgramId::NvnFlinger, /* nvnflinger */
|
||||
ncm::SystemProgramId::Vi, /* vi */
|
||||
ncm::SystemProgramId::Pgl, /* pgl */
|
||||
ncm::SystemProgramId::Ns, /* ns */
|
||||
ncm::SystemProgramId::LogManager, /* lm */
|
||||
ncm::SystemProgramId::Ppc, /* ppc */
|
||||
|
@ -84,6 +85,7 @@ namespace ams::boot2 {
|
|||
ncm::SystemProgramId::NvServices, /* nvservices */
|
||||
ncm::SystemProgramId::NvnFlinger, /* nvnflinger */
|
||||
ncm::SystemProgramId::Vi, /* vi */
|
||||
ncm::SystemProgramId::Pgl, /* pgl */
|
||||
ncm::SystemProgramId::Ns, /* ns */
|
||||
ncm::SystemProgramId::LogManager, /* lm */
|
||||
ncm::SystemProgramId::Ppc, /* ppc */
|
||||
|
@ -133,19 +135,29 @@ namespace ams::boot2 {
|
|||
return c == '\r' || c == '\n';
|
||||
}
|
||||
|
||||
inline bool IsAllowedLaunchProgram(const ncm::ProgramLocation &loc) {
|
||||
if (loc.program_id == ncm::SystemProgramId::Pgl) {
|
||||
return hos::GetVersion() >= hos::Version_10_0_0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void LaunchProgram(os::ProcessId *out_process_id, const ncm::ProgramLocation &loc, u32 launch_flags) {
|
||||
os::ProcessId process_id = os::InvalidProcessId;
|
||||
|
||||
/* Launch, lightly validate result. */
|
||||
{
|
||||
const auto launch_result = pm::shell::LaunchProgram(&process_id, loc, launch_flags);
|
||||
AMS_ABORT_UNLESS(!(svc::ResultOutOfResource::Includes(launch_result)));
|
||||
AMS_ABORT_UNLESS(!(svc::ResultOutOfMemory::Includes(launch_result)));
|
||||
AMS_ABORT_UNLESS(!(svc::ResultLimitReached::Includes(launch_result)));
|
||||
}
|
||||
/* Only launch the process if we're allowed to. */
|
||||
if (IsAllowedLaunchProgram(loc)) {
|
||||
/* Launch, lightly validate result. */
|
||||
{
|
||||
const auto launch_result = pm::shell::LaunchProgram(&process_id, loc, launch_flags);
|
||||
AMS_ABORT_UNLESS(!(svc::ResultOutOfResource::Includes(launch_result)));
|
||||
AMS_ABORT_UNLESS(!(svc::ResultOutOfMemory::Includes(launch_result)));
|
||||
AMS_ABORT_UNLESS(!(svc::ResultLimitReached::Includes(launch_result)));
|
||||
}
|
||||
|
||||
if (out_process_id) {
|
||||
*out_process_id = process_id;
|
||||
if (out_process_id) {
|
||||
*out_process_id = process_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue