#include <fxpoweridlestatemachine.hpp>
|
| FxPowerIdleMachine (VOID) |
|
| ~FxPowerIdleMachine (VOID) |
|
_Must_inspect_result_ NTSTATUS | Init (VOID) |
|
VOID | EnableTimer (VOID) |
|
BOOLEAN | DisableTimer (VOID) |
|
VOID | Start (VOID) |
|
VOID | Stop (VOID) |
|
VOID | Reset (VOID) |
|
_Must_inspect_result_ NTSTATUS | IoIncrement (VOID) |
|
_Must_inspect_result_ NTSTATUS | IoIncrementWithFlags (__in FxPowerReferenceFlags Flags, __out_opt PULONG Count=NULL) |
|
VOID | IoDecrement (__in_opt PVOID Tag=NULL, __in_opt LONG Line=0, __in_opt PSTR File=NULL) |
|
BOOLEAN | QueryReturnToIdle (VOID) |
|
VOID | WaitForD0 (VOID) |
|
_Must_inspect_result_ NTSTATUS | PowerReference (__in BOOLEAN WaitForD0, __in_opt PVOID Tag=NULL, __in_opt LONG Line=0, __in_opt PSTR File=NULL) |
|
_Must_inspect_result_ NTSTATUS | PowerReferenceWithFlags (__in FxPowerReferenceFlags Flags) |
|
VOID | ProcessPowerEvent (__in FxPowerIdleEvents Event) |
|
PVOID | operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals) |
|
PVOID | operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in POOL_TYPE PoolType) |
|
VOID | operator delete (__in PVOID pointer) |
|
PVOID | operator new[] (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals) |
|
VOID | operator delete[] (__in PVOID pointer) |
|
◆ FxPowerIdleMachine()
FxPowerIdleMachine::FxPowerIdleMachine |
( |
VOID |
| ) |
|
Definition at line 332 of file poweridlestatemachine.cpp.
347{
348
349
350
351
352
355
358
361
363}
FxTagTracker * m_TagTracker
FxPowerIdleStates m_StateHistory[FxPowerIdleEventQueueDepth]
FxPowerIdleEvents m_EventHistory[FxPowerIdleEventQueueDepth]
LARGE_INTEGER m_PowerTimeout
FxPowerIdleStates m_CurrentIdleState
UCHAR m_EventHistoryIndex
UCHAR m_StateHistoryIndex
#define RtlZeroMemory(Destination, Length)
◆ ~FxPowerIdleMachine()
FxPowerIdleMachine::~FxPowerIdleMachine |
( |
VOID |
| ) |
|
◆ CancelIdleTimer()
Definition at line 234 of file fxpoweridlestatemachine.hpp.
237 {
238
239
240
242
244 m_Flags &= ~FxPowerIdleTimerStarted;
246 }
247 else {
249 }
250 }
MxTimer m_PowerTimeoutTimer
_Must_inspect_result_ __inline BOOLEAN Stop(VOID)
@ FxPowerIdleTimerStarted
◆ CancelTimer()
◆ CheckAssumptions()
VOID FxPowerIdleMachine::CheckAssumptions |
( |
VOID |
| ) |
|
|
private |
◆ CheckIoCount()
◆ DecrementIo()
◆ Disabled()
◆ DisableTimer()
Definition at line 1381 of file poweridlestatemachine.cpp.
1402{
1405
1407
1409
1410
1411
1412
1413
1414
1415
1417 disabledImmediately =
FALSE;
1418 }
1419 else {
1420 disabledImmediately =
TRUE;
1421 }
1422
1424
1425 return disabledImmediately;
1426}
VOID ProcessEventLocked(__in FxPowerIdleEvents Event)
◆ Disabling()
◆ DisablingTimerExpired()
Definition at line 1187 of file poweridlestatemachine.cpp.
1203{
1204 This->m_Flags &= ~FxPowerIdleTimerStarted;
1205
1206#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
1208#else
1212 );
1213#endif
1214
1216}
VOID PowerPolicyProcessEvent(__in FxPowerPolicyEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
@ PwrPolPowerTimeoutExpired
__inline FxPkgPnp * GetPnpPkg(__inout FxPowerIdleMachine *This)
◆ EnableTimer()
VOID FxPowerIdleMachine::EnableTimer |
( |
VOID |
| ) |
|
◆ GoingToDx()
◆ InD0Locked()
◆ InDx()
◆ InDxDisabled()
◆ InDxEnabled()
◆ InDxIoIncrement()
Definition at line 832 of file poweridlestatemachine.cpp.
848{
850
852
856 "WDFDEVICE %p idle (in Dx) not sending io present event (already sent)",
858 }
859 else {
860#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
862#else
866 );
867#endif
869 }
870
872}
WDFDEVICE __inline GetHandle(VOID)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
__inline CfxDevice * GetDevice(VOID)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
@ FxPowerIdleIoPresentSent
#define TRACE_LEVEL_INFORMATION
◆ InDxPowerUpFailure()
◆ InDxStopped()
Definition at line 902 of file poweridlestatemachine.cpp.
918{
919
920
921
922
923 This->SendD0Notification();
924
925
926
927
928 This->m_Flags &= ~FxPowerIdleInDx;
929
930
931
932
933 This->m_Flags &= ~FxPowerIdleTimerEnabled;
934
935
936
937
938 This->m_Flags &= ~FxPowerIdleIoPresentSent;
939
941}
◆ Init()
Definition at line 377 of file poweridlestatemachine.cpp.
380{
382
383
384
385
389 }
390
391
392
393
397 }
398
400
402}
static MdDeferredRoutineType _PowerTimeoutDpcRoutine
CHECK_RETURN_IF_USER_MODE __inline NTSTATUS Initialize(__in_opt PVOID TimerContext, __in MdDeferredRoutine TimerCallback, __in LONG Period)
#define NT_SUCCESS(StatCode)
CHECK_RETURN_IF_USER_MODE NTSTATUS Initialize(__in BOOLEAN InitialState=FALSE)
Referenced by FxPowerPolicyOwnerSettings::Init().
◆ IoDecrement()
Definition at line 1735 of file poweridlestatemachine.cpp.
1754{
1759
1762
1764
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1782 "WDFDEVICE 0x%p !devobj 0x%p The device is being power-dereferenced"
1783 " without a matching power-reference. This could occur if driver"
1784 " incorrectly calls WdfDeviceResumeIdle without a matching call to"
1785 " WdfDeviceStopIdle.",
1788
1791 }
1792 }
1793
1798
1801 }
1802}
MdDeviceObject __inline GetDeviceObject(VOID)
VOID UpdateTagHistory(__in PVOID Tag, __in LONG Line, __in_opt PSTR File, __in FxTagRefType RefType, __in ULONG RefCount)
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxVerifierDbgBreakPoint(pFxDriverGlobals)
@ PowerIdleEventIoDecrement
GLuint GLuint GLsizei count
#define TRACE_LEVEL_ERROR
_Must_inspect_result_ BOOLEAN IsVerificationEnabled(__in ULONG Major, __in ULONG Minor, __in FxVerifierDownlevelOption DownLevel)
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Referenced by FxPkgPnp::PowerDereference().
◆ IoIncrement()
Definition at line 1639 of file poweridlestatemachine.cpp.
1658{
1660}
_Must_inspect_result_ NTSTATUS IoIncrementWithFlags(__in FxPowerReferenceFlags Flags, __out_opt PULONG Count=NULL)
@ FxPowerReferenceDefault
◆ IoIncrementWithFlags()
Definition at line 1664 of file poweridlestatemachine.cpp.
1690{
1693
1695
1697
1698
1699
1700
1703 }
1705
1706
1707
1709 }
1710 else {
1714 }
1715
1717
1720 }
1721 else {
1725 }
1726 }
1727 }
1729
1731}
@ FxPowerIdleSendPnpPowerUpEvent
@ FxPowerReferenceSendPnpPowerUpEvent
@ PowerIdleEventIoIncrement
#define STATUS_POWER_STATE_INVALID
_Must_inspect_result_ _In_ ULONG Flags
Referenced by IoIncrement(), and PowerReferenceWorker().
◆ IsTransitioning()
◆ PowerFailed()
Definition at line 1219 of file poweridlestatemachine.cpp.
1235{
1236
1237
1238
1240
1242
1243
1244
1245
1246 This->m_Flags &= ~FxPowerIdleTimerEnabled;
1247
1248
1249
1250
1251 This->SendD0Notification();
1252
1254}
◆ PowerReference()
Definition at line 193 of file fxpoweridlestatemachine.hpp.
199 {
201 }
_Must_inspect_result_ NTSTATUS PowerReferenceWorker(__in BOOLEAN WaitForD0, __in FxPowerReferenceFlags Flags, __in_opt PVOID Tag=NULL, __in_opt LONG Line=0, __in_opt PSTR File=NULL)
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN WaitForD0
Referenced by FxPkgPnp::PowerReference().
◆ PowerReferenceWithFlags()
◆ PowerReferenceWorker()
Definition at line 1480 of file poweridlestatemachine.cpp.
1509{
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1536
1537
1538
1539
1543
1545
1546
1547
1548
1549
1550
1551
1552
1553
1555
1557
1560 "WDFDEVICE %p in thread %p waiting synchronously for Dx to D0 "
1561 "transition",
1564
1565
1566
1567
1569
1571
1572
1573
1574
1575
1576
1577
1579
1582
1583
1584
1585
1587
1591 "WDFDEVICE %p waiting for D0 in thread %p failed because of "
1592 "power failure, %!STATUS!",
1596 }
1597 else {
1601 "WDFDEVICE %p waiting for D0 in thread %p failed because of "
1602 "invalid state , %!STATUS!",
1605 }
1606
1607
1608
1609
1613 }
1614 else {
1615
1616
1617
1619 }
1621 }
1622 }
1623
1625
1626
1627
1628
1631 }
1632 }
1633
1635}
static __inline MxThread MxGetCurrentThread()
static __inline KIRQL MxGetCurrentIrql()
#define TRACE_LEVEL_VERBOSE
Referenced by PowerReference(), and PowerReferenceWithFlags().
◆ PowerUp()
◆ PowerUpComplete()
◆ ProcessEventLocked()
Definition at line 1923 of file poweridlestatemachine.cpp.
1939{
1943
1945
1949
1952
1954 if (
entry->TargetStates[
i].PowerIdleEvent ==
Event) {
1956 newState =
entry->TargetStates[
i].PowerIdleState;
1957 break;
1958 }
1959 }
1960
1965
1966
1967
1968
1969 break;
1970
1973
1974
1975
1976 break;
1977 }
1978
1979
1980
1981 default:
1982
1983
1984
1985
1986
1989 "WDFDEVICE 0x%p !devobj 0x%p power idle state %!FxPowerIdleStates!"
1990 " dropping event %!FxPowerIdleEvents!",
1994
1996 }
1997 }
1998
2000
2003 "WDFDEVICE 0x%p !devobj 0x%p entering power idle state "
2004 "%!FxPowerIdleStates! from %!FxPowerIdleStates!",
2008
2012
2015
2017 newState =
entry->StateFunc(
this);
2018 }
2019 else {
2021 }
2022 }
2023}
#define TRACINGPNPPOWERSTATES
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by __drv_maxIRQL(), DisableTimer(), EnableTimer(), IoDecrement(), IoIncrementWithFlags(), PowerReferenceWorker(), ProcessPowerEvent(), Start(), and Stop().
◆ ProcessPowerEvent()
◆ QueryReturnToIdle()
Definition at line 1805 of file poweridlestatemachine.cpp.
1823{
1826
1827
1828
1829
1830
1831
1832
1834
1835
1837
1840 }
1841 else {
1843 }
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855 m_Flags &= ~FxPowerIdleIoPresentSent;
1856
1858
1860}
◆ Reset()
Definition at line 1313 of file poweridlestatemachine.cpp.
1328{
1331
1333
1336
1339
1342
1343
1344
1350 }
1351
1353}
VOID SendD0Notification(VOID)
static _Must_inspect_result_ NTSTATUS __inline CreateAndInitialize(__out FxTagTracker **TagTracker, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxTagTrackerType Type, __in BOOLEAN CaptureStack, __in FxObject *Owner, __in_opt PVOID CreateTag=NULL)
@ FxTrackPowerRefsAndStack
FxTrackPowerOption TrackPower
FxDriverGlobalsDebugExtension * DebugExtension
Referenced by Init().
◆ SendD0Notification()
VOID FxPowerIdleMachine::SendD0Notification |
( |
VOID |
| ) |
|
|
protected |
Definition at line 1863 of file poweridlestatemachine.cpp.
1866{
1868
1870
1871 m_Flags &= ~FxPowerIdleSendPnpPowerUpEvent;
1872
1873
1874
1875
1876
1877#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
1879#else
1883 );
1884#endif
1885
1886 }
1887 return;
1888}
VOID PnpProcessEvent(__in FxPnpEvent Event, __in BOOLEAN ProcessEventOnDifferentThread=FALSE)
Referenced by Reset().
◆ Start()
◆ Started()
◆ StartedPowerFailed()
◆ StartedPowerUp()
◆ StartTimer()
Definition at line 614 of file poweridlestatemachine.cpp.
630{
632
634 This->m_PowerTimeoutTimer.Start(
This->m_PowerTimeout,
636
638}
static const ULONG m_IdleTimerTolerableDelayMS
◆ Stop()
◆ Stopped()
◆ TimedOutDisabled()
Definition at line 1063 of file poweridlestatemachine.cpp.
1079{
1080
1081
1082
1083 This->SendD0Notification();
1084
1085
1086
1087
1088 This->m_Flags &= ~FxPowerIdleIoPresentSent;
1089
1091}
◆ TimedOutEnabled()
Definition at line 1094 of file poweridlestatemachine.cpp.
1097{
1098
1099
1100
1101 This->SendD0Notification();
1102
1103
1104
1105
1106 This->m_Flags &= ~FxPowerIdleIoPresentSent;
1107
1109}
◆ TimedOutIoIncrement()
Definition at line 685 of file poweridlestatemachine.cpp.
703{
705
707
711 "WDFDEVICE %p idle (in D0) not sending io present event (already sent)",
713 }
714 else {
715#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
717#else
721 );
722#endif
723
725 }
726
728}
◆ TimedOutPowerDown()
◆ TimedOutPowerDownFailed()
◆ TimerExpired()
◆ TimingOut()
Definition at line 642 of file poweridlestatemachine.cpp.
658{
659#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
661#else
665 );
666#endif
667
668
669
670
671
672
673 This->m_Flags &= ~FxPowerIdleTimerStarted;
674
675
676
677
678
679 This->m_D0NotificationEvent.Clear();
680
682}
◆ WaitForD0()
VOID FxPowerIdleMachine::WaitForD0 |
( |
VOID |
| ) |
|
|
inline |
union { ... } FxPowerIdleMachine::@4814 |
◆ _PowerTimeoutDpcRoutine
◆ InDx
◆ IoPresentSent
UCHAR FxPowerIdleMachine::IoPresentSent |
◆ IsStarted
UCHAR FxPowerIdleMachine::IsStarted |
◆ m_BusyStates
◆ m_CurrentIdleState
◆ m_D0NotificationEvent
FxCREvent FxPowerIdleMachine::m_D0NotificationEvent |
|
protected |
◆ m_DisabledStates
◆ m_DisablingWaitForTimeoutStates
◆ m_EventHistory
◆ m_EventHistoryIndex
UCHAR FxPowerIdleMachine::m_EventHistoryIndex |
|
protected |
◆ m_Flags
UCHAR FxPowerIdleMachine::m_Flags |
struct { ... } FxPowerIdleMachine::m_FlagsByName |
◆ m_IdleTimerTolerableDelayMS
const ULONG FxPowerIdleMachine::m_IdleTimerTolerableDelayMS = 100 |
|
staticprotected |
◆ m_InDxStates
◆ m_IoCount
ULONG FxPowerIdleMachine::m_IoCount |
|
protected |
◆ m_Lock
MxLock FxPowerIdleMachine::m_Lock |
|
protected |
◆ m_PowerFailedWaitForTimeoutStates
◆ m_PowerTimeout
◆ m_PowerTimeoutTimer
MxTimer FxPowerIdleMachine::m_PowerTimeoutTimer |
|
protected |
◆ m_StartedStates
◆ m_StateHistory
◆ m_StateHistoryIndex
UCHAR FxPowerIdleMachine::m_StateHistoryIndex |
|
protected |
◆ m_StateTable
◆ m_StoppedStates
◆ m_TagTracker
◆ m_TimedOutStates
Initial value:=
{
}
@ FxIdleTimedOutIoIncrement
@ FxIdleTimedOutPowerDown
@ FxIdleTimedOutPowerDownFailed
Definition at line 533 of file fxpoweridlestatemachine.hpp.
◆ m_TimerRunningStates
◆ m_WaitForTimeoutStates
◆ SendPnpPowerUpEvent
UCHAR FxPowerIdleMachine::SendPnpPowerUpEvent |
◆ TimerCanceled
UCHAR FxPowerIdleMachine::TimerCanceled |
◆ TimerEnabled
UCHAR FxPowerIdleMachine::TimerEnabled |
◆ TimerPowerFailed
UCHAR FxPowerIdleMachine::TimerPowerFailed |
◆ TimerStarted
UCHAR FxPowerIdleMachine::TimerStarted |
The documentation for this class was generated from the following files: