PSC services: Difference between revisions
No edit summary |
|||
| (33 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
PSC (Power State Control) provides services related to power state changes in the system. | PSC (Power State Control) provides services related to power state changes in the system. | ||
= psc:c = | = psc:c = | ||
| Line 47: | Line 22: | ||
| 6 || [[#GetModuleInformation|GetModuleInformation]] | | 6 || [[#GetModuleInformation|GetModuleInformation]] | ||
|- | |- | ||
| 10 || [9.0.0+] [[# | | 7 || [17.0.0+] SetRandomDelay | ||
|- | |||
| 10 || [9.0.0+] [[#GetStateLockUpdateEvent|GetStateLockUpdateEvent]] | |||
|- | |- | ||
| 11 || [9.0.0+] [[# | | 11 || [9.0.0+] [[#IsStateLocked|IsStateLocked]] | ||
|} | |} | ||
| Line 73: | Line 50: | ||
Takes two type-0x6 output buffers '''DependencyInformationBefore''' and '''DependencyInformationAfter'''. Returns an output [[#PmModuleTransitionInformation]] and two output u32s '''DependencyInformationBeforeCount''' and '''DependencyInformationAfterCount'''. | Takes two type-0x6 output buffers '''DependencyInformationBefore''' and '''DependencyInformationAfter'''. Returns an output [[#PmModuleTransitionInformation]] and two output u32s '''DependencyInformationBeforeCount''' and '''DependencyInformationAfterCount'''. | ||
== | == GetStateLockUpdateEvent == | ||
No input. Returns an output readable Event handle. | No input. Returns an output readable Event handle. | ||
== | == IsStateLocked == | ||
Takes an input [[#PmState]]. Returns an output bool. | Takes an input [[#PmState]]. Returns an output bool. | ||
| Line 148: | Line 121: | ||
| 3 || [[#IsLocked|IsLocked]] | | 3 || [[#IsLocked|IsLocked]] | ||
|- | |- | ||
| 4 || [[# | | 4 || [[#GetRelatedState|GetRelatedState]] | ||
|} | |} | ||
== Initialize == | == Initialize == | ||
Takes an input [[#PmState]]. No output. | Takes an input [[#PmState]]. No output. | ||
== Lock == | == Lock == | ||
No input/output. | No input/output. | ||
== Unlock == | == Unlock == | ||
No input/output. | No input/output. | ||
== IsLocked == | == IsLocked == | ||
No input. Returns an output bool. | No input. Returns an output bool. | ||
== | == GetRelatedState == | ||
No input. Returns an output [[#PmState]]. | No input. Returns an output [[#PmState]]. | ||
| Line 187: | Line 150: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 10100 || | | 10100 || [[#SaveReport]] | ||
|- | |||
| 10101 || [6.0.0+] [[#SaveReportWithUser]] | |||
|- | |||
| 10200 || [6.0.0+] [[#SaveReportForAntiPiracy]] | |||
|- | |||
| 10201 || [6.0.0+] [[#SaveReportWithUserForAntiPiracy]] | |||
|- | |||
| 10300 || [15.0.0+] [[#SendReportWithUser]] | |||
|- | |- | ||
| | | 11000 || [6.0.0+] [[#NotifyUserList]] | ||
|- | |- | ||
| | | 11001 || [6.0.0+] [[#NotifyUserDeleted]] | ||
|- | |- | ||
| | | 11002 || [6.0.0+] [[#NotifyUserRegistered]] | ||
|- | |- | ||
| | | 11003 || [6.0.0-10.2.0] [[#NotifyUserClosed]] | ||
|- | |- | ||
| | | 11004 || [6.0.0-10.2.0] [[#NotifyUserOpened]] | ||
|- | |- | ||
| | | 11005 || [11.0.0+] [[#NotifyUserClosedWithApplicationId]] | ||
|- | |- | ||
| | | 11006 || [11.0.0+] [[#NotifyUserOpenedWithApplicationId]] | ||
|- | |- | ||
| | | 11100 || [6.0.0+] [[#NotifyCompletedNetworkRequestChanged]] | ||
|- | |- | ||
| | | 11200 || [6.0.0+] [[#NotifyFriendPresenceChanged]] | ||
|- | |- | ||
| | | 11300 || [6.0.0+] [[#NotifyNotificationConnectivityChanged]] | ||
|- | |- | ||
| | | 11400 || [6.0.0+] [[#NotifyDeviceOperationModeChanged]] | ||
|- | |- | ||
| | | 11500 || [6.0.0+] [[#NotifySystemPowerStateChanged]] | ||
|- | |- | ||
| | | 11600 || [6.0.0+] [[#NotifyAppletLaunched]] | ||
|- | |- | ||
| | | 11601 || [6.0.0+] [[#NotifyAppletExited]] | ||
|- | |- | ||
| | | 11602 || [6.0.0+] [[#NotifyForegroundAppletChanged]] | ||
|- | |- | ||
| | | 11700 || [6.0.0+] [[#NotifyControllerCountChanged]] | ||
|- | |- | ||
| | | 11800 || [6.0.0+] [[#NotifyAudioInStarted]] | ||
|- | |- | ||
| | | 11801 || [6.0.0+] [[#NotifyAudioInStopped]] | ||
|- | |- | ||
| | | 11810 || [8.0.0+] [[#NotifyLaunchApplicationStorage]] | ||
|- | |- | ||
| | | 11811 || [8.0.0+] [[#NotifyApplicationRightsInfo]] | ||
|- | |- | ||
| | | 12000 || [8.0.0+] [[#RegisterWatchdog]] | ||
|- | |- | ||
| | | 12001 || [8.0.0+] [[#UnregisterWatchdog]] | ||
|- | |- | ||
| | | 12010 || [20.0.0+] | ||
|- | |- | ||
| | | 13000 || [8.0.0+] [[#GetSyslogLogger]] | ||
|- | |- | ||
| | | 13001 || [8.0.0-19.0.1] [[#SaveSyslogReport]] | ||
|- | |- | ||
| | | 13002 || [19.0.0+] | ||
|- | |- | ||
| | | 13003 || [20.0.0+] | ||
|- | |- | ||
| | | 13004 || [20.0.0+] | ||
|- | |- | ||
| 20100 || | | 20100 || [[#PopReport]] | ||
|- | |- | ||
| 20200 || | | 20200 || [[#GetPushEventReadableHandle]] | ||
|- | |- | ||
| 20300 || [6.0.0+] | | 20300 || [6.0.0+] [[#Shutdown]] | ||
|- | |- | ||
| 20400 || [6.0.0+] | | 20400 || [6.0.0+] [[#PopLostByBufferShortageInfo]] | ||
|- | |- | ||
| 20401 || [6.0.0+] | | 20401 || [6.0.0+] [[#GetBufferUsageInfo]] | ||
|- | |- | ||
| 20402 || [7.0.0+] | | 20402 || [7.0.0+] [[#SetDurationReportChatteringDetectionThreshold]] | ||
|- | |- | ||
| 20500 || [8.0.0+] | | 20500 || [8.0.0+] [[#GetWatchdogStatistics]] | ||
|- | |- | ||
| 20600 || [15.0.0+] | | 20600 || [15.0.0+] [[#NotifyForegroundTransmissionResult]] | ||
|} | |} | ||
== | [20.0.0+] Cmd13002 now takes a total of 8-bytes of input. | ||
Takes a type-0x9 input buffer containing | |||
== SaveReport == | |||
Takes a type-0x9 input buffer containing the [[#EventId]], an input u64 '''ApplicationId''' and a type-0x5 input buffer containing the [[#SystemReport]]. No output. | |||
[21.0.0+] Now takes an additional 8-bytes of input. | |||
The | <code>nn::srepo::detail::VerifyEventId</code> is then used with the [[#EventId]], throwing error on failure. | ||
The [[#SystemReport]] is used with <code>nn::srepo::detail::VerifyReport</code> and with last param = 0x8000, throwing error on failure. | |||
Lastly, the actual processing func is called, returning the Result from here. Besides various cmd input being passed to this etc, this also passes the output from <code>nn::util::GenerateUuid()</code> to this. | Lastly, the actual processing func is called, returning the Result from here. Besides various cmd input being passed to this etc, this also passes the output from <code>nn::util::GenerateUuid()</code> to this. | ||
== | == SaveReportWithUser == | ||
Takes a type-0x9 input buffer containing an | Takes a type-0x9 input buffer containing the [[#EventId]], an input u64 '''ApplicationId''', a type-0x5 input buffer containing the [[#SystemReport]] and an input [[Account_services#Uid|Uid]]. No output. | ||
[21.0.0+] Now takes an additional 8-bytes of input. | |||
Same as [[#SaveReport]] except instead of calling the processing func with Uid=all-zero, the input Uid is passed instead (which must be non-zero). | |||
== SaveReportForAntiPiracy == | |||
Takes a type-0x9 input buffer containing the [[#EventId]], an input u64 '''ApplicationId''' and a type-0x5 input buffer containing the [[#SystemReport]]. No output. | |||
Same as [[#SaveReport]] except the [[#SystemReport]] Flags field is 1 instead of 0. | |||
== SaveReportWithUserForAntiPiracy == | |||
Takes a type-0x9 input buffer containing the [[#EventId]], an input u64 '''ApplicationId''', a type-0x5 input buffer containing the [[#SystemReport]] and an input [[Account_services#Uid|Uid]]. No output. | |||
== | Same as [[#SaveReportWithUser]] except the [[#SystemReport]] Flags field is 1 instead of 0. | ||
Takes | |||
== SendReportWithUser == | |||
Takes an input [[Account_services#Uid|Uid]], an input u64 '''ApplicationId''', an input bool (padded to u64), two input u32s, a type-0x9 input buffer and a TransferMemory handle. Returns an output [[#IAsyncContext]]. | |||
The mapped TransferMemory buffer is used with <code>nn::srepo::detail::VerifyReport</code>, returning an error on failure. | The mapped TransferMemory buffer is used with <code>nn::srepo::detail::VerifyReport</code>, returning an error on failure. | ||
== | == NotifyUserList == | ||
Takes a type-0x9 input buffer containing an array of | Takes a type-0x9 input buffer containing an array of [[Account_services#Uid|Uid]]. No output. | ||
The Sf handler code (func which calls the serv obj vfunc) will throw an error if the buffer size is >0x8F (that is, >8 entries). | The Sf handler code (func which calls the serv obj vfunc) will throw an error if the buffer size is >0x8F (that is, >8 entries). | ||
| Line 298: | Line 275: | ||
This gets data from a state list, then clears the is_initialized flag for each entry. Lastly when the input array count is non-zero, this loops through the input array writing each entry into the aforementioned state list. If this would run out of space, it would skip writing that entry and still continue - however this shouldn't be possible with the above Sf check. Then this returns 0. | This gets data from a state list, then clears the is_initialized flag for each entry. Lastly when the input array count is non-zero, this loops through the input array writing each entry into the aforementioned state list. If this would run out of space, it would skip writing that entry and still continue - however this shouldn't be possible with the above Sf check. Then this returns 0. | ||
== | == NotifyUserDeleted == | ||
Takes | Takes an input [[Account_services#Uid|Uid]]. No output. | ||
This calls the same state-reset func as [[#NotifyUserList]], except this passes the input Uid instead. Then this returns 0. | |||
== NotifyUserRegistered == | |||
Takes an input [[Account_services#Uid|Uid]]. No output. | |||
This calls the same state-writing func as [[#NotifyUserList]], except this passes the input Uid instead. Then this returns 0. | |||
== NotifyUserClosed == | |||
Takes an input [[Account_services#Uid|Uid]]. No output. | |||
== NotifyUserOpened == | |||
Takes an input [[Account_services#Uid|Uid]]. No output. | |||
== NotifyUserClosedWithApplicationId == | |||
Takes an input [[Account_services#Uid|Uid]] and an input u64 '''ApplicationId'''. No output. | |||
== NotifyUserOpenedWithApplicationId == | |||
Takes an input [[Account_services#Uid|Uid]] and an input u64 '''ApplicationId'''. No output. | |||
== NotifyCompletedNetworkRequestChanged == | |||
Takes an input s8 and an input bool. No output. | |||
== NotifyFriendPresenceChanged == | |||
Takes an input [[Account_services#Uid|Uid]] and an input s8 (padded to u64). No output. | |||
== NotifyNotificationConnectivityChanged == | |||
Takes an input s8. No output. | |||
== NotifyDeviceOperationModeChanged == | |||
Takes an input s8. No output. | |||
== | == NotifySystemPowerStateChanged == | ||
Takes | Takes an input s8. No output. | ||
== NotifyAppletLaunched == | |||
Takes an input [[#SfAppletIdentityInfo]]. No output. | |||
== | == NotifyAppletExited == | ||
Takes | Takes an input [[#SfAppletIdentityInfo]]. No output. | ||
== | == NotifyForegroundAppletChanged == | ||
Takes | Takes an input [[#SfAppletIdentityInfo]]. No output. | ||
== NotifyControllerCountChanged == | |||
Takes three input s8s. No output. | |||
== | == NotifyAudioInStarted == | ||
Takes a | Takes a type-0x5 input buffer and an input u64. No output. | ||
== NotifyAudioInStopped == | |||
Takes a type-0x5 input buffer and an input u64. No output. | |||
== | == NotifyLaunchApplicationStorage == | ||
Takes | Takes an input u64 '''ApplicationId''' and an input u8 (padded to u64). No output. | ||
== NotifyApplicationRightsInfo == | |||
Takes an input u64 '''ApplicationId''' and an input u32 (padded to u64). No output. | |||
If the input u32 is 0 or none of the bits are recognized, this just returns 0. Otherwise the lowest set bit is used to determine a value to write to stack (the ApplicationId is also written afterwards), for passing to a func. | |||
== | {| class="wikitable" border="1" | ||
Takes an input u64 | |- | ||
! Bit || Write value | |||
|- | |||
| 0 || 0x2 | |||
|- | |||
| 3 || 0x3 | |||
|- | |||
| 4 || 0x4 | |||
|- | |||
| 5 || [20.1.0+] 0x5 | |||
|- | |||
| 6 || [20.1.0+] 0x6 | |||
|} | |||
== RegisterWatchdog == | |||
Takes a type-0x9 input buffer, an input [[#TimeSpanType]] and an input u64. Returns an output [[#WatchdogHandle]]. | |||
== UnregisterWatchdog == | |||
Takes an input [[#WatchdogHandle]]. No output. | |||
== | == GetSyslogLogger == | ||
Takes a type-0x5 input buffer | Takes a type-0x5 input buffer. No output. | ||
[9.0.0+] No input | [9.0.0+] No input. Returns three output u32s, an [[#ISyslogLogger]] and a SharedMemory handle. | ||
The SharedMemory is mapped with the returned size and with permissions=RW. | The SharedMemory is mapped with the returned size and with permissions=RW. | ||
== | == SaveSyslogReport == | ||
Takes | Takes an input u128 "nn::util::Uuid". No output. | ||
== | == PopReport == | ||
Takes a type- | Takes a type-0xA output buffer and a type-0x6 output buffer. Returns an output [[Account_services#Uid|Uid]]. | ||
[10.0.0+] This now | [6.0.0+] This now returns an additional output u64 '''ApplicationId''' and an output u128 "nn::util::Uuid". | ||
[10.0.0+] This now returns an additional output u64 and two output u32s. | |||
This is only usable with srepo:a. | This is only usable with srepo:a. | ||
== | == GetPushEventReadableHandle == | ||
No input | No input. Returns an output Event handle. | ||
This is only usable with srepo:a. | This is only usable with srepo:a. | ||
== | == Shutdown == | ||
No input/output. | No input/output. | ||
== | == PopLostByBufferShortageInfo == | ||
Takes an input u32 | Takes an input u32. Returns two output u64s. | ||
The input | The input u32 must be <=1. This gets data from a state array with the specified index. | ||
== | == GetBufferUsageInfo == | ||
No input | No input. Returns two output u64s. | ||
The first u64 is a constant value, while the second u64 is from state. | The first u64 is a constant value, while the second u64 is from state. | ||
== | == SetDurationReportChatteringDetectionThreshold == | ||
Takes an input | Takes an input [[#TimeSpanType]] and an input u64. No output. | ||
The input s64 must be >=1. The two input fields are written into global state, and various state is also cleared. | The input s64 must be >=1. The two input fields are written into global state, and various state is also cleared. | ||
== | == GetWatchdogStatistics == | ||
No input | No input. Returns an output [[#WatchdogStatistics]]. | ||
This gets two u64s from global state. | This gets two u64s from global state. | ||
== | == NotifyForegroundTransmissionResult == | ||
Takes | Takes an input u128 "nn::util::Uuid" and an input [[#ResultHolder]]. No output. | ||
This goes through | This goes through the global list of [[#IAsyncContext]] looking for an entry with data matching the input struct, then writes the input [[#ResultHolder]] into that [[#IAsyncContext]]. This Result would then be returned by [[#GetResult]] - the Event from [[#GetSystemEvent]] is also signaled. | ||
This always returns 0. | This always returns 0. | ||
| Line 394: | Line 422: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || [[#ReallocateBuffer|ReallocateBuffer]] | ||
|} | |} | ||
=== ReallocateBuffer === | |||
No input. Returns two output u32s. | |||
This does the same entry-allocation in sharedmem as [[#GetSyslogLogger]]. | |||
== IAsyncContext == | == IAsyncContext == | ||
| Line 408: | Line 439: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || GetSystemEvent | | 0 || [[#GetSystemEvent]] | ||
|- | |- | ||
| 1 || Cancel | | 1 || [[#Cancel]] | ||
|- | |- | ||
| 2 || GetResult | | 2 || [[#GetResult]] | ||
|} | |} | ||
=== GetSystemEvent === | |||
No input, returns an output Event. | |||
=== Cancel === | |||
No input/output. | |||
This just returns 0. | |||
=== GetResult === | |||
No input/output. | |||
This checks if the Event from GetSystemEvent was signaled throwing an error if not, otherwise this returns the Result stored in the context object. | |||
= ovln:rcv = | = ovln:rcv = | ||
| Line 422: | Line 466: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || OpenReceiver | | 0 || [[#OpenReceiver|OpenReceiver]] | ||
|} | |} | ||
== OpenReceiver == | |||
No input. Returns an [[#IReceiver|IReceiver]]. | |||
== IReceiver == | == IReceiver == | ||
| Line 432: | Line 479: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || AddSource | | 0 || [[#AddSource|AddSource]] | ||
|- | |- | ||
| 1 || RemoveSource | | 1 || [[#RemoveSource|RemoveSource]] | ||
|- | |- | ||
| 2 || GetReceiveEventHandle | | 2 || [[#GetReceiveEventHandle|GetReceiveEventHandle]] | ||
|- | |- | ||
| 3 || Receive | | 3 || [[#Receive|Receive]] | ||
|- | |- | ||
| 4 || ReceiveWithTick | | 4 || [[#ReceiveWithTick|ReceiveWithTick]] | ||
|} | |} | ||
=== AddSource === | |||
Takes an input [[#SourceName|SourceName]]. No output. | |||
=== RemoveSource === | |||
Takes an input [[#SourceName|SourceName]]. No output. | |||
=== GetReceiveEventHandle === | |||
No input. Returns an output Event handle. | |||
=== Receive === | |||
No input. Returns an output [[#RawMessage|RawMessage]]. | |||
=== ReceiveWithTick === | |||
No input. Returns an output [[#RawMessage|RawMessage]] and an output s64. | |||
= ovln:snd = | = ovln:snd = | ||
| Line 450: | Line 512: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || OpenSender | | 0 || [[#OpenSender|OpenSender]] | ||
|} | |} | ||
== OpenSender == | |||
Takes an input [[#SourceName|SourceName]] and an input [[#QueueAttribute|QueueAttribute]]. Returns an [[#ISender|ISender]]. | |||
== ISender == | == ISender == | ||
| Line 460: | Line 525: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || Send | | 0 || [[#Send|Send]] | ||
|- | |- | ||
| 1 || GetUnreceivedMessageCount | | 1 || [[#GetUnreceivedMessageCount|GetUnreceivedMessageCount]] | ||
|} | |} | ||
=== Send === | |||
Takes an input [[#RawMessage|RawMessage]] and an input [[#SendOption|SendOption]]. No output. | |||
=== GetUnreceivedMessageCount === | |||
No input. Returns an output u32. | |||
= time:m = | = time:m = | ||
| Line 495: | Line 566: | ||
|- | |- | ||
| 15 || [[#SetupEphemeralNetworkSystemClockCore]] | | 15 || [[#SetupEphemeralNetworkSystemClockCore]] | ||
|- | |||
| 20 || [19.0.0+] GetStandardSteadyClockCurrentTimePoint | |||
|- | |||
| 21 || [22.0.0+] GetStandardNetworkSystemClockCurrentTime | |||
|- | |- | ||
| 50 || GetStandardLocalClockOperationEvent | | 50 || GetStandardLocalClockOperationEvent | ||
| Line 695: | Line 770: | ||
|- | |- | ||
| 501 || [4.0.0+] CalculateSpanBetween || | | 501 || [4.0.0+] CalculateSpanBetween || | ||
|- | |||
| 600 || [19.0.0+] GetInitialLaunchEndTime || | |||
|- | |||
| 601 || [22.0.0+] NotifyInitialLaunchSettingsDone || | |||
|} | |} | ||
| Line 734: | Line 813: | ||
=== TimeSpanType === | === TimeSpanType === | ||
This is an | This is an s64. | ||
== ISystemClock == | == ISystemClock == | ||
| Line 924: | Line 1,003: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || [[# | | 0 || [[#GetInputSourceState]] | ||
|- | |- | ||
| 1 || [[# | | 1 || [[#GetTriggerTargetEvent]] | ||
|} | |} | ||
== | == GetInputSourceState == | ||
Takes an input u32 '''SourceId'''. Returns an output u64 '''EventTime'''. | Takes an input u32 '''SourceId'''. Returns an output u64 '''EventTime'''. | ||
== | == GetTriggerTargetEvent == | ||
Takes an input u32 '''SourceId''' and an input u64 (unused, official software passes struct pointer). Returns an output Event handle with autoclear disabled. | Takes an input u32 '''SourceId''' and an input u64 (unused, official software passes struct pointer). Returns an output Event handle with autoclear disabled. | ||
| Line 948: | Line 1,023: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || [[# | | 0 || [[#GetNotifyEvent]] | ||
|} | |} | ||
== | == GetNotifyEvent == | ||
Takes an input u32 '''SourceId''' and an input u64 (unused, official software passes struct pointer). Returns an output Event handle with autoclear disabled. | Takes an input u32 '''SourceId''' and an input u64 (unused, official software passes struct pointer). Returns an output Event handle with autoclear disabled. | ||
| Line 965: | Line 1,038: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || GetBatteryPercentage | ||
|- | |- | ||
| 1 || | | 1 || GetChargerType | ||
|- | |- | ||
| 2 || [[#OpenChargeSession]] | | 2 || [[#OpenChargeSession]] | ||
|- | |- | ||
| 3 || | | 3 || GetRawBatteryPercentage | ||
|- | |- | ||
| 4 || | | 4 || GetBatteryVoltageLevel | ||
|- | |- | ||
| 5 || [[#OpenThermalSession]] | | 5 || [[#OpenThermalSession]] | ||
|- | |- | ||
| 6 || | | 6 || GetAbnormalTemperatureSet | ||
|- | |- | ||
| 7 || [[#OpenClockSession]] | | 7 || [[#OpenClockSession]] | ||
|- | |- | ||
| 8 || | | 8 || GetClockRate | ||
|- | |||
| 9 || [17.0.0+] [[#OpenBridgeSession]] | |||
|- | |||
| 10 || [17.0.0+] GetBridgePowerSupply | |||
|- | |||
| 11 || [18.0.0+] [[#OpenVsysVoltageSession]] | |||
|- | |||
| 12 || [18.0.0+] GetIsBatteryEnoughForFullAwake | |||
|- | |||
| 13 || [19.0.0+] GetIsCharging | |||
|- | |||
| 14 || [20.0.0+] | |||
|- | |||
| 15 || [20.0.0+] | |||
|} | |} | ||
| Line 992: | Line 1,079: | ||
== OpenClockSession == | == OpenClockSession == | ||
Takes an input u32. Returns an [[#IClockSession]]. | Takes an input u32. Returns an [[#IClockSession]]. | ||
== OpenBridgeSession == | |||
No input. Returns an [[#IBridgeSession]]. | |||
== OpenVsysVoltageSession == | |||
No input. Returns an [[#IVsysVoltageSession]]. | |||
== IChargeSession == | == IChargeSession == | ||
| Line 1,000: | Line 1,093: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || GetStateChangeEvent | ||
|- | |- | ||
| 1 || | | 1 || SetStateChangeSet | ||
|} | |} | ||
| Line 1,012: | Line 1,105: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || GetAbnormalTemperatureEvent | ||
|- | |- | ||
| 1 || | | 1 || SetAbnormalTemperatureEventMask | ||
|} | |} | ||
| Line 1,024: | Line 1,117: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || GetStateChangeEvent | ||
|} | |||
== IBridgeSession == | |||
This is "nn::hshl::IBridgeSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || GetStateChangeEvent | |||
|} | |||
== IVsysVoltageSession == | |||
This is "nn::hshl::IVsysVoltageSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || GetStateChangeEvent | |||
|} | |} | ||
| Line 1,036: | Line 1,149: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || [[# | | 0 || [[#OpenChargeSession_2|OpenChargeSession]] | ||
|- | |||
| 1 || [[#OpenThermalSession_2|OpenThermalSession]] | |||
|- | |- | ||
| | | 2 || SetClockRate | ||
|- | |- | ||
| | | 3 || [17.0.0+] SetBridgePowerSupply | ||
|- | |||
| 4 || [18.0.0+] | |||
|- | |||
| 5 || [18.0.0+] | |||
|} | |} | ||
== | == OpenChargeSession == | ||
Takes an input u32. Returns an [[#IChargeSetterSession]]. | Takes an input u32. Returns an [[#IChargeSetterSession]]. | ||
== | == OpenThermalSession == | ||
Takes an input u32. Returns an [[#IThermalSetterSession]]. | Takes an input u32. Returns an [[#IThermalSetterSession]]. | ||
| Line 1,056: | Line 1,175: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || SetBatteryPercentage | ||
|- | |||
| 1 || SetRawBatteryPercentage | |||
|- | |||
| 2 || SetChargerType | |||
|- | |||
| 3 || SetBatteryVoltageLevel | |||
|- | |- | ||
| | | 4 || [18.0.0+] | ||
|- | |- | ||
| | | 5 || [19.0.0+] | ||
|- | |- | ||
| | | 6 || [20.0.0+] | ||
|- | |||
| 7 || [20.0.0+] | |||
|} | |} | ||
| Line 1,072: | Line 1,199: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || SetAbnormalTemperatureSet | ||
|} | |} | ||
| Line 1,092: | Line 1,219: | ||
| 0x04 || [[USB_services|Usb]] | | 0x04 || [[USB_services|Usb]] | ||
|- | |- | ||
| 0x05 || [[ | | 0x05 || [[Ethernet_services|Eth]] | ||
|- | |- | ||
| 0x06 || [[PTM_services|Fgm]] | | 0x06 || [[PTM_services|Fgm]] | ||
| Line 1,118: | Line 1,245: | ||
| 0x11 || [[PTM_services|Tc]] | | 0x11 || [[PTM_services|Tc]] | ||
|- | |- | ||
| 0x12 || [[ | | 0x12 || [[OMM_services|Omm]] | ||
|- | |- | ||
| 0x13 || [[PCIe_services|Pcie]] | | 0x13 || [[PCIe_services|Pcie]] | ||
| Line 1,186: | Line 1,313: | ||
| 0x33 || [[NIM_services|Ntc]] | | 0x33 || [[NIM_services|Ntc]] | ||
|- | |- | ||
| 0x34 || [[ | | 0x34 || [[OMM_services|Idle]] | ||
|- | |- | ||
| 0x35 || [[Applet_Manager_services|Tcap]] | | 0x35 || [[Applet_Manager_services|Tcap]] | ||
| Line 1,198: | Line 1,325: | ||
| 0x39 || [[PCV_services|Rtc]] | | 0x39 || [[PCV_services|Rtc]] | ||
|- | |- | ||
| 0x3A || | | 0x3A || [[PCV_services|Regulator]] | ||
|- | |- | ||
| 0x3B || | | 0x3B || [[PCV_services|Clkrst]] | ||
|- | |- | ||
| 0x3C || [[Bus_services|Led]] | | 0x3C || [[Bus_services|Led]] | ||
|- | |- | ||
| 0x3D || [[NS_Services| | | 0x3D || [[NS_Services|NuiShell]] | ||
|- | |- | ||
| 0x3E || | | 0x3E || [[PTM_services|Powctl]] | ||
|- | |- | ||
| 0x3F || [[ | | 0x3F || [[OMM_services|NotificationPresenter]] | ||
|- | |- | ||
| 0x40 || | | 0x40 || [[Glue_services|Notification]] | ||
|- | |- | ||
| 0x41 || [[Sockets_services| | | 0x41 || [[Sockets_services|Dhcpc]] | ||
|- | |||
| 0x42 || [[BCAT_services|Mnpp]] | |||
|- | |||
| 0x43 || [[OLSC_services|Sprofile]] | |||
|- | |- | ||
| 0x65 || [[NV_services|NvHost]] | | 0x65 || [[NV_services|NvHost]] | ||
|- | |- | ||
| 0x69 | | | 0x69 || NvDbgSvc | ||
|- | |- | ||
| 0x6A || Tspm | | 0x6A || Tspm | ||
|- | |- | ||
| 0x7F || [[ | | 0x7F || [[OMM_services|Spsm]] | ||
|} | |} | ||
| Line 1,265: | Line 1,396: | ||
! Description | ! Description | ||
|- | |- | ||
| | | 0x0 | ||
| | | 0x8 | ||
| TimeBefore | | TimeBefore | ||
|- | |- | ||
| | | 0x8 | ||
| 0x10 | | 0x10 | ||
| TimeAfter | | TimeAfter | ||
|- | |- | ||
| 0x10 | | 0x10 | ||
| | | 0x4 | ||
| Result | | Result | ||
|- | |- | ||
| 0x14 | | 0x14 | ||
| | | 0x4 | ||
| [[#PmState|StateBefore]] | | [[#PmState|StateBefore]] | ||
|- | |- | ||
| 0x18 | | 0x18 | ||
| | | 0x4 | ||
| [[#PmState|StateAfter]] | | [[#PmState|StateAfter]] | ||
|- | |- | ||
| 0x1C | | 0x1C | ||
| | | 0x4 | ||
| Reserved | | Reserved | ||
|} | |} | ||
= SystemReport = | |||
This is "nn::srepo::SystemReport". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x20 | |||
| [[#EventId|EventId]] | |||
|- | |||
| 0x20 | |||
| 0x8 | |||
| ApplicationId | |||
|- | |||
| 0x28 | |||
| 0x4 | |||
| Flags | |||
|- | |||
| 0x2C | |||
| 0x1 | |||
| | |||
|- | |||
| 0x2D | |||
| 0x3 | |||
| Reserved | |||
|- | |||
| 0x30 | |||
| 0x8 | |||
| ReportBufferAddress | |||
|- | |||
| 0x38 | |||
| 0x8 | |||
| ReportBufferTotalSize | |||
|- | |||
| 0x40 | |||
| 0x8 | |||
| ReportBufferCurrentSize | |||
|} | |||
= EventId = | |||
This is "nn::srepo::EventId". This is a 0x20-byte string. | |||
= WatchdogHandle = | |||
This is "nn::srepo::WatchdogHandle". This is an u64. | |||
= WatchdogStatistics = | |||
This is "nn::srepo::WatchdogStatistics". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x8 | |||
| | |||
|- | |||
| 0x8 | |||
| 0x8 | |||
| | |||
|} | |||
= ResultHolder = | |||
This is "nn::srepo::detail::ipc::ResultHolder". This is an u32. | |||
= SfAppletIdentityInfo = | |||
This is "nn::srepo::detail::ipc::SfAppletIdentityInfo". This is a 0x10-byte struct. | |||
= SourceName = | |||
This is "nn::ovln::SourceName". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x10 | |||
| Name | |||
|} | |||
= RawMessage = | |||
This is "nn::ovln::RawMessage". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x4 | |||
| Tag | |||
|- | |||
| 0x4 | |||
| 0x4 | |||
| DataSize | |||
|- | |||
| 0x8 | |||
| 0x78 | |||
| Data | |||
|} | |||
= QueueAttribute = | |||
This is "nn::ovln::QueueAttribute". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x4 | |||
| QueueLength | |||
|- | |||
| 0x4 | |||
| 0x4 | |||
| Reserved | |||
|} | |||
= SendOption = | |||
This is "nn::ovln::SendOption". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x1 | |||
| EnqueuePosition | |||
|- | |||
| 0x1 | |||
| 0x1 | |||
| OverflowOption | |||
|- | |||
| 0x2 | |||
| 0x6 | |||
| Reserved | |||
|} | |||
== EnqueuePosition == | |||
This is "nn::ovln::EnqueuePosition". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value | |||
! Description | |||
|- | |||
| 0 || Front | |||
|- | |||
| 1 || Back | |||
|} | |||
== OverflowOption == | |||
This is "nn::ovln::OverflowOption". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value | |||
! Description | |||
|- | |||
| 0 || Error | |||
|- | |||
| 1 || RemoveFront | |||
|- | |||
| 2 || RemoveBack | |||
|- | |||
| 3 || Block | |||
|} | |||
= Notes = | |||
psc:m allows a process to register a module that depends on power management in some way. A client calls GetPmModule to receive an IPmModule (Power Managed Module), and then calls IPmModule->Initialize(module_id, module_dependency_list) where module_id is the ModuleId enum member for the client, and the dependency list is an array of module IDs for the modules that this depends on. Initialize() returns an event handle that the client can wait on to be notified of a power state change. | |||
psc:c allows a module to the power state controller for the system (in practice, AM is the only client to the controller). IPmControl->DispatchRequest() is used notify all IPmModules of a state change. | |||
For example, FS registers itself as an IPmModule with dependencies on pinmux, gpio, pcv, tma, and initializes the SD card once those dependencies have registered.. | |||
It then does (basically) the following pseudocode (actual code located at .text + 0xB2DB0 in 6.0.0 FS): | |||
while (true) { | |||
Fs_IPmModule->WaitSignaled(); | |||
Fs_IPmModule->GetRequest(&state); | |||
switch (state) { | |||
case WakingUp: | |||
/* hardware devices are woken up here */ | |||
case GoingToSleep: | |||
/* hardware devices are put to sleep here */ | |||
case ShuttingDown: | |||
/* hardware devices are turned off here */ | |||
} | |||
Fs_IPmModule->Acknowledge(state); | |||
} | |||
[[Category:Services]] | [[Category:Services]] | ||