- // 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
+// 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.
+ int IdleTimerPeriod;
+ int NextIdleTimerPeriod;
+ IOPMPowerStateIndex IdleTimerMinPowerState;
+ 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_t 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;
+ IOPMPowerStateIndex OverrideMaxPowerState;
+ IOPMPowerStateIndex 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