- /*! @var Owner
- Points to object that called PMinit(). Used only for debugging.
- */
- IOService * Owner;
-
- /*! @var InterestedDrivers
- List of interested drivers.
- */
- IOPMinformeeList * InterestedDrivers;
-
- /*! @var DriverTimer
- How long to wait for controlling driver to acknowledge.
- */
- IOReturn DriverTimer;
-
- /*! @var AckTimer */
- thread_call_t AckTimer;
-
- /*! @var SettleTimer */
- thread_call_t SettleTimer;
-
- /*! @var MachineState
- Current power management machine state.
- */
- unsigned long MachineState;
-
- /*! @var SettleTimeUS
- Settle time after changing power state.
- */
- unsigned long SettleTimeUS;
-
- /*! @var HeadNoteFlags
- The flags field for the current change note.
- */
- unsigned long HeadNoteFlags;
-
- /*! @var HeadNoteState
- The newStateNumber field for the current change note.
- */
- unsigned long HeadNoteState;
-
- /*! @var HeadNoteOutputFlags
- The outputPowerCharacter field for the current change note.
- */
- unsigned long HeadNoteOutputFlags;
-
- /*! @var HeadNoteDomainState
- Power domain flags from parent. (only on parent change).
- */
- unsigned long HeadNoteDomainState;
-
- /*! @var HeadNoteParent
- Pointer to initiating parent. (only on parent change).
- */
- IOPowerConnection * HeadNoteParent;
-
- /*! @var HeadNoteCapabilityFlags
- The capabilityFlags field for the current change note.
- */
- unsigned long HeadNoteCapabilityFlags;
-
- /*! @var HeadNotePendingAcks
- Number of acks we are waiting for.
- */
- unsigned long HeadNotePendingAcks;
-
- /*! @var PMLock
- PM state lock.
- */
- IOLock * PMLock;
-
- /*! @var WeAreRoot
- True if our owner is the root of the power tree.
- */
- bool WeAreRoot;
-
- /*! @var InitialChange
- Initialized to true, then set to false after the initial power change.
- */
- bool InitialChange;
-
- /*! @var NeedToBecomeUsable
- Someone has called makeUsable before we had a controlling driver.
- */
- bool NeedToBecomeUsable;
-
- /*! @var DeviceOverrides
- Ignore children and driver desires if true.
- */
- bool DeviceOverrides;
-
- /*! @var ClampOn
- Domain is clamped on until the first power child is added.
- */
- bool ClampOn;
-
- /*! @var DeviceActive
- True if device was active since last idle timer expiration.
- */
- bool DeviceActive;
-
- /*! @var DoNotPowerDown
- Keeps track of any negative responses from notified apps and clients.
- */
- bool DoNotPowerDown;
-
- /*! @var ParentsKnowState
- True if all our parents know the state of their power domain.
- */
- bool ParentsKnowState;
-
- /*! @var DeviceActiveTimestamp
- Time of last device activity.
- */
- AbsoluteTime DeviceActiveTimestamp;
-
- /*! @var ActivityLock
- Used to protect activity flag.
- */
- IOLock * ActivityLock;
-
- /*! @var IdleTimerEventSource
- An idle timer event source.
- */
- IOTimerEventSource * IdleTimerEventSource;
-
- /*! @var IdleTimerPeriod
- Idle timer's period in seconds.
- */
- unsigned long IdleTimerPeriod;
- unsigned long IdleTimerMinPowerState;
-
- /*! @var DriverDesire
- Power state desired by our controlling driver.
- */
- unsigned long DriverDesire;
-
- /*! @var DeviceDesire
- Power state desired by a subclassed device object.
- */
- unsigned long DeviceDesire;
-
- /*! @var ChildrenDesire
- Power state desired by all children.
- */
- unsigned long ChildrenDesire;
-
- /*! @var DesiredPowerState
- This is the power state we desire currently.
- */
- unsigned long DesiredPowerState;
-
- /*! @var PreviousRequest
- This is what our parent thinks our need is.
- */
- unsigned long PreviousRequest;
-
- /*! @var Name
- Cache result from getName(), used in logging.
- */
- const char * Name;
-
- /*! @var Platform
- Cache result from getPlatform(), used in logging and registering.
- */
- IOPlatformExpert * Platform;
-
- /*! @var NumberOfPowerStates
- Number of power states in the power array.
- */
- unsigned long NumberOfPowerStates;
-
- /*! @var PowerStates
- Power state array.
- */
- IOPMPowerState * PowerStates;
-
- /*! @var ControllingDriver
- The controlling driver.
- */
- IOService * ControllingDriver;
-
- /*! @var AggressivenessValues
- Array of aggressiveness values.
- */
- unsigned long AggressivenessValue[ kMaxType + 1 ];
-
- /*! @var AggressivenessValid
- True for aggressiveness values that are currently valid.
- */
- bool AggressivenessValid[ kMaxType + 1 ];
-
- /*! @var CurrentPowerState
- The ordinal of our current power state.
- */
- unsigned long CurrentPowerState;
-
- /*! @var ParentsCurrentPowerFlags
- Logical OR of power flags for each power domain parent.
- */
- IOPMPowerFlags ParentsCurrentPowerFlags;
-
- /*! @var MaxCapability
- Ordinal of highest power state we can achieve in current power domain.
- */
- unsigned long MaxCapability;
-
- /*! @var OutputPowerCharacterFlags
- Logical OR of all output power character flags in the array.
- */
- IOPMPowerFlags OutputPowerCharacterFlags;
-
- /*! @var SerialNumber
- Used to uniquely identify power management notification to apps and clients.
- */
- UInt16 SerialNumber;
-
- /*! @var ResponseArray
- OSArray which manages responses from notified apps and clients.
- */
- OSArray * ResponseArray;
-
- /*! @var OutOfBandParameter
- Used to communicate desired function to tellClientsWithResponse().
- This is used because it avoids changing the signatures of the affected virtual methods.
- */
- int OutOfBandParameter;
-
- AbsoluteTime DriverCallStartTime;
- IOPMPowerFlags CurrentCapabilityFlags;
- unsigned long CurrentPowerConsumption;
- unsigned long TempClampPowerState;
- unsigned long TempClampCount;
- IOPMWorkQueue * PMWorkQueue;
- IOPMRequest * PMRequest;
- OSSet * InsertInterestSet;
- OSSet * RemoveInterestSet;
- OSArray * NotifyChildArray;
- unsigned long WaitReason;
- unsigned long NextMachineState;
- thread_call_t DriverCallEntry;
- void * DriverCallParamPtr;
- IOItemCount DriverCallParamCount;
- IOItemCount DriverCallParamSlots;
- IOOptionBits DriverCallReason;
- long ActivityTicklePowerState;
- bool StrictTreeOrder;
- bool DriverCallBusy;
- bool ActivityTimerStopped;
- bool WillAdjustPowerState;
- bool WillPMStop;
+// Link IOServicePM objects on IOPMWorkQueue.
+ queue_chain_t WorkChain;
+
+// Queue of IOPMRequest objects.
+ queue_head_t RequestHead;
+
+// IOService creator and owner.
+ IOService * Owner;
+
+// List of interested drivers (protected by PMLock).
+ IOPMinformeeList * InterestedDrivers;
+
+// How long to wait for controlling driver to acknowledge.
+ IOReturn DriverTimer;
+
+// Current power management machine state.
+ uint32_t MachineState;
+
+ thread_call_t AckTimer;
+ thread_call_t SettleTimer;
+ thread_call_t IdleTimer;
+ thread_call_t WatchdogTimer;
+ thread_call_t SpinDumpTimer;
+
+ IOLock * WatchdogLock;
+ OSArray * BlockedArray;
+ uint64_t PendingResponseDeadline;
+ uint64_t WatchdogDeadline;
+
+// Settle time after changing power state.
+ uint32_t SettleTimeUS;
+ uint32_t IdleTimerGeneration;
+
+// The flags describing current change note.
+ IOPMPowerChangeFlags HeadNoteChangeFlags;
+
+// The new power state number being changed to.
+ IOPMPowerStateIndex HeadNotePowerState;
+
+// Points to the entry in the power state array.
+ IOPMPSEntry * HeadNotePowerArrayEntry;
+
+// Power flags supplied by all parents (domain).
+ IOPMPowerFlags HeadNoteDomainFlags;
+
+// Power flags supplied by domain accounting for parent changes.
+ IOPMPowerFlags HeadNoteDomainTargetFlags;
+
+// Connection attached to the changing parent.
+ IOPowerConnection * HeadNoteParentConnection;
+
+// Power flags supplied by the changing parent.
+ IOPMPowerFlags HeadNoteParentFlags;
+
+// Number of acks still outstanding.
+ uint32_t HeadNotePendingAcks;
+
+// PM state lock.
+ IOLock * PMLock;
+
+ unsigned int InitialPowerChange :1;
+ unsigned int InitialSetPowerState :1;
+ unsigned int DeviceOverrideEnabled :1;
+ unsigned int DoNotPowerDown :1;
+ unsigned int ParentsKnowState :1;
+ unsigned int StrictTreeOrder :1;
+ unsigned int IdleTimerStopped :1;
+ unsigned int AdjustPowerScheduled :1;
+
+ unsigned int IsPreChange :1;
+ unsigned int DriverCallBusy :1;
+ unsigned int PCDFunctionOverride :1;
+ unsigned int IdleTimerIgnored :1;
+ unsigned int HasAdvisoryDesire :1;
+ unsigned int AdvisoryTickleUsed :1;
+ unsigned int ResetPowerStateOnWake :1;
+
+// Time of last device activity.
+ AbsoluteTime DeviceActiveTimestamp;
+ AbsoluteTime MaxPowerStateEntryTime;
+ AbsoluteTime MaxPowerStateExitTime;
+
+// Used to protect activity flag.
+ IOLock * ActivityLock;
+
+// Idle timer's period in seconds.
+ unsigned long IdleTimerPeriod;
+ unsigned long IdleTimerMinPowerState;
+ unsigned long NextIdleTimerPeriod;
+ AbsoluteTime IdleTimerStartTime;
+
+// Power state desired by a subclassed device object.
+ IOPMPowerStateIndex DeviceDesire;
+
+// This is the power state we desire currently.
+ IOPMPowerStateIndex DesiredPowerState;
+
+// This is what our parent thinks our need is.
+ IOPMPowerFlags PreviousRequestPowerFlags;
+
+// Cache result from getName(), used in logging.
+ const char * Name;
+
+// Number of power states in the power array.
+ IOPMPowerStateIndex NumberOfPowerStates;
+
+// Ordered highest power state in the power array.
+ IOPMPowerStateIndex HighestPowerState;
+
+// Power state array.
+ IOPMPSEntry * PowerStates;
+
+// The controlling driver.
+ IOService * ControllingDriver;
+
+// Our current power state.
+ IOPMPowerStateIndex CurrentPowerState;
+
+// Logical OR of power flags for each power domain parent.
+ IOPMPowerFlags ParentsCurrentPowerFlags;
+
+// The highest power state we can achieve in current power domain.
+ IOPMPowerStateIndex MaxPowerState;
+
+// Logical OR of all output power flags in the power state array.
+ IOPMPowerFlags MergedOutputPowerFlags;
+
+// OSArray which manages responses from notified apps and clients.
+ OSArray * ResponseArray;
+ OSArray * NotifyClientArray;
+
+// Used to uniquely identify power management notification to apps and clients.
+ UInt16 SerialNumber;
+
+// Used to communicate desired function to tellClientsWithResponse().
+// This is used because it avoids changing the signatures of the affected virtual methods.
+ int OutOfBandParameter;
+
+ AbsoluteTime DriverCallStartTime;
+ IOPMPowerFlags CurrentCapabilityFlags;
+ unsigned long CurrentPowerConsumption;
+ IOPMPowerStateIndex TempClampPowerState;
+ OSArray * NotifyChildArray;
+ OSDictionary * PowerClients;
+ thread_call_t DriverCallEntry;
+ void * DriverCallParamPtr;
+ IOItemCount DriverCallParamCount;
+ IOItemCount DriverCallParamSlots;
+ uint32_t DriverCallReason;
+ uint32_t OutOfBandMessage;
+ uint32_t TempClampCount;
+ uint32_t OverrideMaxPowerState;
+ uint32_t DeviceUsablePowerState;
+
+// Protected by ActivityLock - BEGIN
+ IOPMPowerStateIndex ActivityTicklePowerState;
+ IOPMPowerStateIndex AdvisoryTicklePowerState;
+ uint32_t ActivityTickleCount;
+ uint32_t DeviceWasActive : 1;
+ uint32_t AdvisoryTickled : 1;
+// Protected by ActivityLock - END
+
+ uint32_t WaitReason;
+ uint32_t SavedMachineState;
+
+// Protected by PMLock - BEGIN
+ struct {
+ uint32_t PMStop : 1;
+ uint32_t PMDriverCallWait : 1;
+ } LockedFlags;
+
+ queue_head_t PMDriverCallQueue;
+ OSSet * InsertInterestSet;
+ OSSet * RemoveInterestSet;
+
+// IOReporter Data
+ uint32_t ReportClientCnt;
+ void * ReportBuf;
+// Protected by PMLock - END