Line 1: |
Line 1: |
− | PGL (Program Loader) is a sysmodule designed for encapsulating all program loading logic. | + | PGL (Program Launcher) is a sysmodule designed for encapsulating all program launching / management logic. |
| + | |
| + | The core logic of this sysmodule was previously encapsulated by the ns:dev interface (and the nn.nssrv.ProcessLaunchControlTask thread in particular). |
| | | |
| = pgl = | | = pgl = |
Line 29: |
Line 31: |
| |- | | |- |
| | 20 || [[#GetShellEventObserver]] | | | 20 || [[#GetShellEventObserver]] |
− | |}
| |
− |
| |
− | = LaunchFlags =
| |
− |
| |
− | The LaunchFlags enum looks like this:
| |
− |
| |
− | {| class=wikitable
| |
− | ! Bit || Mask || Name
| |
− | |-
| |
− | | 0 || 1 || LaunchFlags_EnableDetailedCrashReport
| |
− | |-
| |
− | | 1 || 2 || LaunchFlags_EnableCrashReportScreenShotForProduction
| |
− | |-
| |
− | | 2 || 4 || LaunchFlags_EnableCrashReportScreenShotForDevelop
| |
| |- | | |- |
| + | | 21 || [11.0.0-11.0.1] |
| |} | | |} |
− |
| |
− | = SnapShotDumpType =
| |
− |
| |
− | The SnapShotDumpType enum looks like this:
| |
− |
| |
− | {| class=wikitable
| |
− | ! Value || Name
| |
− | |-
| |
− | | 0 || SnapShotDumpType_None
| |
− | |-
| |
− | | 1 || SnapShotDumpType_Auto
| |
− | |-
| |
− | | 2 || SnapShotDumpType_Full
| |
− | |-
| |
− | |}
| |
− |
| |
− | == ContentMetaInfo ==
| |
− | {| class="wikitable" border="1"
| |
− | |-
| |
− | ! Offset
| |
− | ! Size
| |
− | ! Description
| |
− | |-
| |
− | | 0x0
| |
− | | 0x8
| |
− | | [[NCM_services#ProgramId|ProgramId]]
| |
− | |-
| |
− | | 0x8
| |
− | | 0x4
| |
− | | Version
| |
− | |-
| |
− | | 0xC
| |
− | | 0x1
| |
− | | ContentType
| |
− | |-
| |
− | | 0xD
| |
− | | 0x1
| |
− | | ID Offset
| |
− | |-
| |
− | | 0xE
| |
− | | 0x2
| |
− | | Padding
| |
− | |}
| |
− |
| |
| | | |
| == LaunchProgram == | | == LaunchProgram == |
Line 104: |
Line 49: |
| This just calls pm:shell->TerminateProcess with the input process id. | | This just calls pm:shell->TerminateProcess with the input process id. |
| | | |
− | == GetEventObserver == | + | == GetShellEventObserver == |
| No input. Returns an [[#IEventObserver]]. | | No input. Returns an [[#IEventObserver]]. |
| | | |
| == LaunchProgramFromHost == | | == LaunchProgramFromHost == |
− |
| |
| This takes an input u32 [[Process_Manager_services#LaunchFlags]] pm launch_flags and a MapAlias input buffer "content path". | | This takes an input u32 [[Process_Manager_services#LaunchFlags]] pm launch_flags and a MapAlias input buffer "content path". |
| | | |
Line 122: |
Line 66: |
| | | |
| == GetHostContentMetaInfo == | | == GetHostContentMetaInfo == |
− |
| |
| This takes an input MapAlias buffer "content path", and does the same parsing as [[#LaunchProgramFromHost]]. | | This takes an input MapAlias buffer "content path", and does the same parsing as [[#LaunchProgramFromHost]]. |
| | | |
Line 128: |
Line 71: |
| | | |
| == GetApplicationProcessId == | | == GetApplicationProcessId == |
− |
| |
| This calls pm:shell->GetApplicationProcessIdForShell, and returns the output process id. | | This calls pm:shell->GetApplicationProcessIdForShell, and returns the output process id. |
| | | |
Line 134: |
Line 76: |
| | | |
| == BoostSystemMemoryResourceLimit == | | == BoostSystemMemoryResourceLimit == |
− |
| |
| This takes in a u64 mem_size, and uses it as input to pm:shell->BoostSystemMemoryResourceLimit | | This takes in a u64 mem_size, and uses it as input to pm:shell->BoostSystemMemoryResourceLimit |
| | | |
− | === EnableApplicationCrashReport ===
| + | == EnableApplicationCrashReport == |
− | | |
| Takes an input boolean "enable". | | Takes an input boolean "enable". |
| | | |
Line 149: |
Line 89: |
| Thus this command is only useful for disabling/toggling detailed crash reports for applications launched with LaunchFlags_EnableDetailedCrashReport, as processes without the launch flag will always send "0" for the creport argument. | | Thus this command is only useful for disabling/toggling detailed crash reports for applications launched with LaunchFlags_EnableDetailedCrashReport, as processes without the launch flag will always send "0" for the creport argument. |
| | | |
− | === IsApplicationCrashReportEnabled ===
| + | == IsApplicationCrashReportEnabled == |
− | | |
| This returns the value of the bit set or cleared by [[#EnableApplicationCrashReport]] | | This returns the value of the bit set or cleared by [[#EnableApplicationCrashReport]] |
| | | |
− | === EnableApplicationAllThreadDumpOnCrash ===
| + | == EnableApplicationAllThreadDumpOnCrash == |
− | | |
| Takes an input boolean "enable". | | Takes an input boolean "enable". |
| | | |
Line 167: |
Line 105: |
| Previously this functionality was controlled by ns:am2->EnableApplicationAllThreadDumpOnCrash, which is now a wrapper for this function. | | Previously this functionality was controlled by ns:am2->EnableApplicationAllThreadDumpOnCrash, which is now a wrapper for this function. |
| | | |
− | === TriggerSnapShotDumper ===
| + | == TriggerSnapShotDumper == |
− | | |
| This takes an input 32 "SnapShotDumpType" and an input MapAliasBuffer "argument". | | This takes an input 32 "SnapShotDumpType" and an input MapAliasBuffer "argument". |
| | | |
Line 188: |
Line 125: |
| |} | | |} |
| | | |
− | === GetProcessEventHandle ===
| + | == GetProcessEventHandle == |
− | | |
| This takes no input and returns an output copy event handle. | | This takes no input and returns an output copy event handle. |
| | | |
− | === GetProcessEventInfo ===
| + | == GetProcessEventInfo == |
| + | This takes no input and attempts to receive a [[Process_Manager_services#ProcessEventInfo]] from the observer's message queue. |
| | | |
− | This takes no input and attempts to receive a [[#ProcessEventInfo]] from the observer's message queue.
| + | Every time a process event occurs, pgl receives the event from PM (it does pm:shell->GetProcessEventHandle() during startup and has a thread looping pm:shell->GetProcessEventInfo() to track process events. |
| | | |
− | Every time a process event occurs, pgl receives the event from PM (it does pm:shell->GetProcessEventHandle() during startup and has a thread looping pm:shell->GetProcessEventInfo() to track process events.
| + | PGL sends to all observers' message queues a [[Process_Manager_services#ProcessEventInfo]] for each event it receives, thus allowing for multiple subscribers to process events. |
| | | |
− | PGL sends to all observers' message queues a [[#ProcessEventInfo]] for each event it receives, thus allowing for multiple subscribers to process events.
| + | = LaunchFlags = |
| + | {| class=wikitable |
| + | ! Bit || Mask || Name |
| + | |- |
| + | | 0 || 1 || EnableDetailedCrashReport |
| + | |- |
| + | | 1 || 2 || EnableCrashReportScreenShotForProduction |
| + | |- |
| + | | 2 || 4 || EnableCrashReportScreenShotForDevelop |
| + | |- |
| + | |} |
| | | |
| + | = SnapShotDumpType = |
| + | {| class=wikitable |
| + | ! Value || Name |
| + | |- |
| + | | 0 || None |
| + | |- |
| + | | 1 || Auto |
| + | |- |
| + | | 2 || Full |
| + | |- |
| + | |} |
| | | |
− | == ProcessEventInfo == | + | = ContentMetaInfo = |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
Line 210: |
Line 168: |
| | 0x0 | | | 0x0 |
| | 0x8 | | | 0x8 |
− | | ProcessId | + | | [[NCM_services#ProgramId|ProgramId]] |
| |- | | |- |
| | 0x8 | | | 0x8 |
| | 0x4 | | | 0x4 |
− | | ProcessEvent | + | | Version |
| |- | | |- |
| | 0xC | | | 0xC |
− | | 0x4 | + | | 0x1 |
− | | Padding/Reserved | + | | ContentType |
| + | |- |
| + | | 0xD |
| + | | 0x1 |
| + | | ID Offset |
| |- | | |- |
| + | | 0xE |
| + | | 0x2 |
| + | | Padding |
| |} | | |} |