ReactOS  0.4.15-dev-2704-gd5265b0
fxinterrupt.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxInterrupt.hpp
8 
9 Abstract:
10 
11  This module implements a frameworks managed interrupt object
12 
13 Author:
14 
15 
16 
17 
18 Environment:
19 
20  Both kernel and user mode
21 
22 Revision History:
23 
24 
25 --*/
26 
27 #ifndef _FXINTERRUPT_H_
28 #define _FXINTERRUPT_H_
29 
31 
32 //
33 // We need two parameters for KeSynchronizeExecution when enabling
34 // and disabling interrupts, so we use this structure on the stack since its
35 // a synchronous call.
36 //
40 };
41 
43 
44 
45 class FxInterrupt : public FxNonPagedObject {
46 
47  friend FxPkgPnp;
48 
49 private:
50 
51  //
52  // User supplied configuration
53  //
55 
56  //
57  // Kernel Interupt object
58  //
60 
61  //
62  // Kernel spinlock for Interrupt
63  //
65 
68 
69  //
70  // Built in SpinLock/PassiveLock
71  //
73 
74  //
75  // Passive-level interrupt handling.
76  //
78 
79  //
80  // DpcForIsr and WorkItemForIsr support. Note that a DPC is still
81  // needed even if the driver opts to use WorkItemForIsr when
82  // driver handles interrupts at DIRQL.
83  //
84 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
86 #endif
88 
89  //
90  // Automatic serialization: this is the callback lock for the object the DPC or
91  // work-item will synchronize with.
92  //
94 
95  //
96  // Set to TRUE when WDF is responsible for disposing the wait-lock.
97  //
99 
100  //
101  // Value provided by driver. When TRUE we use IoReportActive/Inactive to
102  // do soft connect/disconnect on explicit power transitions.
103  //
105 
106  //
107  // Set to TRUE for passive-level interrupt handling.
108  //
110 
111  // set to TRUE once the interrupt has been added to the pnp package's
112  // interrupt list
114 
115  //
116  // Indicates whether the driver has forced a disconnect. If so, then
117  // we should stop automatically managing the connected state.
118  //
121 
122  //
123  // Indicates whether the m_EvtInterruptPostEnable succeeded or not.
124  //
126 
127  //
128  // Save floating point when the ISR runs
129  //
131 
132  //
133  // Set to TRUE if interrupt is created in the prepare hardware callback.
134  //
136 
137  //
138  // State machine to manage a wake capable interrupt
139  //
141 
142 
143 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
144  //
145  // Set to true on successful connect or when driver reports active.
146  // (this field is mainly for aid in debugging)
147  //
149 #endif
150 
151  //
152  // Interrupt policy
153  //
158 
159  //
160  // Callbacks
161  //
164 
168 
169 #if ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
170  //
171  // Rd interrupt object
172  //
173  RD_INTERRUPT_CONTEXT m_RdInterruptContext;
174 
175  //
176  // Each interrupt object has this structure which comprises an event and a
177  // wait structure. The wait struture is associted with interrupt's callback
178  // and the event, and is queued to threadpool. The callback is invoked when
179  // the event is set.
180  //
182 
183  //
184  // True if the interrupt callback can queue another interrupt wait.
185  // Set to true when interrupt is connected and false when interrupts
186  // callbacks and waits are flushed.
187  //
189 
190  //
191  // UMDF's handling of interrupt is split in two parts:
192  // 1. framwork code- runs at passive always and therefore uses mode-agnostic
193  // code meant for passive-level handling, tracked through m_PassiveLevel
194  // field of interrupt object.
195  // 2. redirector code- does passive handling of all of level-triggered
196  // interrupt and DIRQL handing of all others (edge and msi). Driver
197  // doesn't have any choice in that. The PassiveHandling field in the
198  // interrupt config is always set for passive for UMDF (through UMDF's
199  // init function).
200  //
201  // This field stores the type of handling done by redirector as opposed to
202  // m_PassiveHandling which stores user's choice.
203  //
205 #endif
206 
207  //
208  // PnP data about the interrupt.
209  //
211 
212  //
213  // Weak ref to the translated resource interrupt descriptor.
214  // It is valid from prepare hardware callback to release hardware callback.
215  //
217 
218 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
219  //
220  // Callback used to set m_Disconnecting, synchronized to running ISRs.
221  // Only runs if m_IsEdgeTriggeredNonMsiInterrupt is TRUE.
222  //
223  static
225 
226  //
227  // Backup KINTERRUPT pointer, captured from the KMDF ISR thunk. We need it
228  // because valid interrupts may arrive before IoConnectInterruptEx sets
229  // FxInterrupt.m_Interrupt. Non-NULL only if m_IsEdgeTriggeredNonMsiInterrupt is TRUE.
230  //
232 #endif
233 
234  //
235  // Used to mark the interrupt disconnect window, and to discard interrupts
236  // that arrive within this window. Only set if m_IsEdgeTriggeredNonMsiInterrupt is TRUE.
237  //
239 
240  //
241  // Set if this is an Edge-Triggered non-MSI interrupt. These interrupts are
242  // stateful and it is important not to drop any around the connection window.
243  //
245 
246 protected:
247 
249 
250 public:
251  FxInterrupt(
252  __in PFX_DRIVER_GLOBALS FxDriverGlobals
253  );
254 
255  virtual
256  ~FxInterrupt(
257  VOID
258  );
259 
261  static
262  NTSTATUS
264  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
270  );
271 
273  NTSTATUS
275  VOID
276  );
277 
279  NTSTATUS
280  Initialize(
284  );
285 
287  NTSTATUS
291  );
292 
294  NTSTATUS
298  );
299 
300  virtual
301  BOOLEAN
302  Dispose(
303  VOID
304  );
305 
306  virtual
307  VOID
308  DeleteObject(
309  VOID
310  );
311 
312  VOID
314  VOID
315  );
316 
317  VOID
318  DpcHandler(
321  );
322 
323  BOOLEAN
325  VOID
326  );
327 
328  BOOLEAN
329  Synchronize(
332  );
333 
334  struct _KINTERRUPT*
336  VOID
337  );
338 
339  __inline
340  BOOLEAN
342  VOID
343  )
344  {
345  return ((m_WakeInterruptMachine != NULL) ? TRUE:FALSE);
346  }
347 
348  VOID
350  __in BOOLEAN ActiveForWake
351  )
352  {
353  m_WakeInterruptMachine->m_ActiveForWake = ActiveForWake;
354  }
355 
356  BOOLEAN
358  VOID
359  )
360  {
361  if ((m_WakeInterruptMachine != NULL) &&
363  return TRUE;
364  } else {
365  return FALSE;
366  }
367  }
368 
369  VOID
372  )
373  {
375  }
376 
377 
378 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
379 
380  VOID
381  ReportActive(
383  );
384 
385  VOID
388  );
389 
390  BOOLEAN
392  VOID
393  )
394  {
395  if (m_UseSoftDisconnect &&
397  m_Interrupt != NULL &&
398  m_Connected) {
399  return TRUE;
400  }
401  else {
402  return FALSE;
403  }
404  }
405 
406 #elif ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
407 
408  BOOLEAN
410  VOID
411  )
412  {
413  //
414  // Not implemented for UMDF
415  //
416  return FALSE;
417  }
418 
419  VOID
420  ReportActive(
422  )
423  {
425  //
426  // Not implemented for UMDF
427  //
428  }
429 
430  VOID
433  )
434  {
436  //
437  // Not implemented for UMDF
438  //
439  }
440 
441 #endif
442 
443  VOID
445  VOID
446  );
447 
448  BOOLEAN
450  VOID
451  );
452 
453  __inline
454  BOOLEAN
456  VOID
457  )
458  {
459  return m_PassiveHandling;
460  }
461 
462  __inline
463  BOOLEAN
465  VOID
466  )
467  {
468  //
469  // UMDF's handling of interrupt is split in two parts:
470  // 1. framework code that runs at passive always in host process and
471  // therefore uses mode-agnostic code meant for passive-level handling,
472  // tracked through m_PassiveHandling member.
473  // field of interrupt object.
474  // 2. redirector code that does passive handling of all of level-triggered
475  // interrupt and DIRQL handing of all others (edge and msi). Driver
476  // doesn't have any choice in that. The m_PassiveHandling field in the
477  // interrupt config is always set for passive for UMDF (through UMDF's
478  // init function). m_PasiveHandlingByRedirector member is present to
479  // this part of code.
480  // In summary, m_PassiveHandling and m_PasiveHandlingByRedirector
481  // effectively maintain how the interrupt is connected (passive or DIRQL),
482  // for KMDF and UMDF respectively. This routine tells how the
483  // interrupt is connnected by looking at these members.
484  //
485 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
486  return IsPassiveHandling();
487 #else
489 #endif
490  }
491 
492  __inline
493  BOOLEAN
495  VOID
496  )
497  {
498  return m_CallbackLock != NULL ? TRUE : FALSE;
499  }
500 
501  VOID
502  AcquireLock(
503  VOID
504  );
505 
506  BOOLEAN
508  VOID
509  );
510 
511  VOID
512  ReleaseLock(
513  VOID
514  );
515 
516  CfxDevice*
518  VOID
519  )
520  {
521  return m_Device;
522  }
523 
525  GetInfo(
526  VOID
527  );
528 
529  WDFINTERRUPT
531  VOID
532  )
533  {
534  return (WDFINTERRUPT) GetObjectHandle();
535  }
536 
537  BOOLEAN
539  VOID
540  )
541  {
542  return m_SpinLock != &m_BuiltInSpinLock.Get() ? TRUE : FALSE;
543  }
544 
545  BOOLEAN
547  VOID
548  )
549  {
551  }
552 
553  KIRQL
555  VOID
556  )
557  {
558  return m_SynchronizeIrql;
559  }
560 
561  KIRQL
563  VOID
564  )
565  {
566  return m_InterruptInfo.Irql;
567  }
568 
569  BOOLEAN
572  )
573  {
574  return m_SpinLock == Interrupt->m_SpinLock ? TRUE : FALSE;
575  }
576 
577 private:
578  VOID
579  Reset(
580  VOID
581  );
582 
583  VOID
585  VOID
586  );
587 
588  VOID
590  KIRQL SyncIrql
591  )
592  {
593  m_SynchronizeIrql = SyncIrql;
594  }
595 
596  //
597  // Called from workitem to perform final flushing of any
598  // outstanding DPC's and dereferencing of objects.
599  //
600  VOID
602  VOID
603  );
604 
605  VOID
607  VOID
608  );
609 
610  static
612 
613  static
614  EVT_SYSTEMWORKITEM _InterruptWorkItemCallback;
615 
616  static
618 
619 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
620 
621  static
623 
624 #elif ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
625 
626  static
627  MX_WORKITEM_ROUTINE _InterruptWorkItemThunk;
628 
629  VOID
630  ThreadpoolWaitCallback(
631  VOID
632  );
633 
634  VOID
635  QueueSingleWaitOnInterruptEvent(
636  VOID
637  );
638 
639  VOID
640  StartThreadpoolWaitQueue(
641  VOID
642  );
643 
644  VOID
645  StopAndFlushThreadpoolWaitQueue(
646  VOID
647  );
648 
649 #endif
650 
651  //
652  // Helper functions to enable an interrupt.
653  // Sequence:
654  // (1) InterruptEnable
655  // (2) _InterruptEnableThunk
656  // (3) InterruptEnableInvokeCallback
657  //
658  NTSTATUS
660  VOID
661  );
662 
663  static
665 
666 
667  NTSTATUS
669  VOID
670  );
671 
672  //
673  // Helper functions to disable an interrupt.
674  // Sequence:
675  // (1) InterruptDisable
676  // (2) _InterruptDisableThunk
677  // (3) InterruptDisableInvokeCallback
678  //
679  NTSTATUS
681  VOID
682  );
683 
684  static
686 
687 
688  NTSTATUS
690  VOID
691  );
692 public:
693  static
694  BOOLEAN
696  __in USHORT ResourceFlags
697  )
698  {
699  if (ResourceFlags & CM_RESOURCE_INTERRUPT_MESSAGE) {
700  return TRUE;
701  }
702  else {
703  return FALSE;
704  }
705  }
706 
707  static
708  BOOLEAN
710  __in USHORT ResourceFlags
711  )
712  {
713  if (ResourceFlags & CM_RESOURCE_INTERRUPT_WAKE_HINT) {
714  return TRUE;
715  }
716  else {
717  return FALSE;
718  }
719  }
720 
722  NTSTATUS
723  Connect(
724  __in ULONG NotifyFlags
725  );
726 
728  NTSTATUS
730  VOID
731  );
732 
734  NTSTATUS
735  Disconnect(
736  __in ULONG NotifyFlags
737  );
738 
739  VOID
741  VOID
742  );
743 
745  NTSTATUS
747  VOID
748  );
749 
751  NTSTATUS
753  VOID
754  );
755 
756  VOID
758  __inout PIO_RESOURCE_DESCRIPTOR IoResourceDescriptor
759  );
760 
761  VOID
765  );
766 
769  VOID
770  )
771  {
772  // Weak ref to the translated resource interrupt descriptor.
773  // It is valid from prepare hardware callback to release hardware callback.
774  return m_CmTranslatedResource;
775  }
776 
777  VOID
781  __in PWDF_INTERRUPT_INFO InterruptConfig
782  );
783 
784  VOID
786  VOID
787  );
788 
789  VOID
791  VOID
792  );
793 
794  VOID
795  SetPolicy(
799  );
800 
801  VOID
806  );
807 
808  VOID
810  VOID
811  );
812 
813  VOID
815  VOID
816  );
817 
818  VOID
820  VOID
821  );
822 
823  BOOLEAN
825  VOID
826  );
827 
828  BOOLEAN
831  )
832  {
835  }
836 
837  __inline
838  BOOLEAN
840  VOID
841  )
842  {
843  //
844  // Queue DPC for KMDF and workitem for UMDF. Note that driver can either
845  // specify EvtInterruptDpc or EvtInterruptWorkItem, and therefore it can
846  // either call WdfInterruptQueueDpcForisr or WdfInterruptQueueWorkitemForIsr.
847  //
848 
849 
850 
851 
852  //
853 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
854  return QueueDpcForIsr();
855 #else
856  return QueueWorkItemForIsr();
857 #endif
858  }
859 
860 };
861 
862 BOOLEAN
867  );
868 
869 #endif // _FXINTERRUPT_H_
FxWaitLock * m_WaitLock
Definition: fxinterrupt.hpp:77
BOOLEAN IsSharedSpinLock(VOID)
NTSTATUS InterruptEnableInvokeCallback(VOID)
CfxDevice * m_Device
Definition: fxobject.hpp:329
_Must_inspect_result_ NTSTATUS Initialize(__in CfxDevice *Device, __in FxObject *Parent, __in PWDF_INTERRUPT_CONFIG Configuration)
KSYNCHRONIZE_ROUTINE * MdInterruptSynchronizeRoutine
Definition: mxgeneralkm.h:38
__inline BOOLEAN IsPassiveConnect(VOID)
static MdDeferredRoutineType _InterruptDpcThunk
#define _Must_inspect_result_
Definition: no_sal2.h:62
static EVT_SYSTEMWORKITEM _InterruptWorkItemCallback
static MdInterruptServiceRoutineType _InterruptThunk
PCM_PARTIAL_RESOURCE_DESCRIPTOR GetResources(VOID)
virtual BOOLEAN Dispose(VOID)
#define CM_RESOURCE_INTERRUPT_WAKE_HINT
Definition: cmtypes.h:149
_Must_inspect_result_ NTSTATUS ConnectInternal(VOID)
VOID AssignResources(__in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescRaw, __in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescTrans)
BOOLEAN m_AddedToList
BOOLEAN SharesLock(FxInterrupt *Interrupt)
KIRQL GetSyncIrql(VOID)
VOID InvokeWakeInterruptEvtIsr(VOID)
VOID DpcHandler(__in_opt PVOID SystemArgument1, __in_opt PVOID SystemArgument2)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG Configuration
Definition: wdfinterrupt.h:372
VOID RevokeResourcesInternal(VOID)
#define __in_opt
Definition: dbghelp.h:38
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
enum _WDF_TRI_STATE WDF_TRI_STATE
static MdInterruptSynchronizeRoutineType _InterruptMarkDisconnecting
VOID FlushQueuedWorkitem(VOID)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:372
VOID Reset(VOID)
BOOLEAN m_IsEdgeTriggeredNonMsiInterrupt
BOOLEAN m_CreatedInPrepareHardware
LONG NTSTATUS
Definition: precomp.h:26
PFN_WDF_INTERRUPT_DISABLE m_EvtInterruptDisable
BOOLEAN m_DisposeWaitLock
Definition: fxinterrupt.hpp:98
RD_INTERRUPT_CONTEXT m_RdInterruptContext
BOOLEAN m_CanQueue
NTSTATUS InterruptEnable(VOID)
WDF_TRI_STATE m_ShareVector
Definition: fxinterrupt.hpp:54
IO_WORKITEM_ROUTINE MX_WORKITEM_ROUTINE
Definition: mxworkitemkm.h:26
FxSystemWorkItem * m_SystemWorkItem
Definition: fxinterrupt.hpp:87
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:728
__inline BOOLEAN IsAutomaticSerialization(VOID)
BOOLEAN QueueDpcForIsr(VOID)
_Must_inspect_result_ NTSTATUS Disconnect(__in ULONG NotifyFlags)
VOID AssignResourcesInternal(__in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescRaw, __in PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescTrans, __in PWDF_INTERRUPT_INFO InterruptConfig)
#define CM_RESOURCE_INTERRUPT_MESSAGE
Definition: cmtypes.h:145
BOOLEAN m_Disconnecting
_Must_inspect_result_ NTSTATUS Connect(__in ULONG NotifyFlags)
KSERVICE_ROUTINE MdInterruptServiceRoutineType
Definition: mxgeneralkm.h:37
PCM_PARTIAL_RESOURCE_DESCRIPTOR m_CmTranslatedResource
_Must_inspect_result_ NTSTATUS ForceDisconnect(VOID)
VOID FlushAndRundownInternal(VOID)
VOID RevokeResources(VOID)
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define FALSE
Definition: types.h:117
VOID OnPostReleaseHardware(VOID)
BOOLEAN m_ForceDisconnected
EVT_WDF_INTERRUPT_SYNCHRONIZE * PFN_WDF_INTERRUPT_SYNCHRONIZE
Definition: wdfinterrupt.h:115
MdLock & Get()
Definition: mxlock.h:43
volatile KIRQL m_SynchronizeIrql
Definition: fxinterrupt.hpp:67
static MdInterruptSynchronizeRoutineType _InterruptSynchronizeThunk
WDF_INTERRUPT_POLICY m_Policy
VOID ReportActive(_In_ BOOLEAN Internal=FALSE)
PVOID __inline GetObjectHandle(VOID)
Definition: fxobject.hpp:603
#define __out
Definition: dbghelp.h:62
VOID DisconnectInternal(VOID)
__inline BOOLEAN QueueDeferredRoutineForIsr(VOID)
enum _WDF_INTERRUPT_POLICY WDF_INTERRUPT_POLICY
unsigned char BOOLEAN
struct _KINTERRUPT * m_Interrupt
Definition: fxinterrupt.hpp:59
BOOLEAN IsSoftDisconnectCapable(VOID)
#define CM_RESOURCE_INTERRUPT_LEVEL_LATCHED_BITS
Definition: cmtypes.h:151
BOOLEAN m_Enabled
BOOLEAN _SynchronizeExecution(__in MdInterrupt Interrupt, __in MdInterruptSynchronizeRoutine SynchronizeRoutine, __in PVOID SynchronizeContext)
PWDF_INTERRUPT_INFO GetInfo(VOID)
WDF_INTERRUPT_PRIORITY m_Priority
BOOLEAN m_FloatingSave
VOID ProcessEvent(__in FxWakeInterruptEvents Event)
VOID SetSyncIrql(KIRQL SyncIrql)
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
BOOLEAN IsLevelTriggered(__in ULONG Flags)
VOID ProcessWakeInterruptEvent(__in FxWakeInterruptEvents Event)
BOOLEAN IsSyncIrqlSet(VOID)
static MdInterruptSynchronizeRoutineType _InterruptEnableThunk
VOID FlushQueuedDpcs(VOID)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
BOOLEAN m_PassiveHandlingByRedirector
_In_ PKSYNCHRONIZE_ROUTINE SynchronizeRoutine
Definition: kefuncs.h:536
CfxDevice * GetDevice(VOID)
friend FxPkgPnp
Definition: fxinterrupt.hpp:47
NTSTATUS InterruptDisable(VOID)
EVT_WDF_INTERRUPT_WORKITEM * PFN_WDF_INTERRUPT_WORKITEM
Definition: wdfinterrupt.h:153
enum _WDF_INTERRUPT_PRIORITY WDF_INTERRUPT_PRIORITY
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY _In_ KAFFINITY TargetProcessorSet
Definition: wdfinterrupt.h:651
BOOLEAN m_PassiveHandling
LIST_ENTRY m_PnpList
VOID FlushAndRundown(VOID)
VOID SetPolicyInternal(__in WDF_INTERRUPT_POLICY Policy, __in WDF_INTERRUPT_PRIORITY Priority, __in PGROUP_AFFINITY TargetProcessorSet)
PFN_WDF_INTERRUPT_WORKITEM m_EvtInterruptWorkItem
EVT_WDF_INTERRUPT_ISR * PFN_WDF_INTERRUPT_ISR
Definition: wdfinterrupt.h:94
VOID FilterResourceRequirements(__inout PIO_RESOURCE_DESCRIPTOR IoResourceDescriptor)
BOOLEAN m_Active
EVT_WDF_INTERRUPT_ENABLE * PFN_WDF_INTERRUPT_ENABLE
Definition: wdfinterrupt.h:175
BOOLEAN m_UseSoftDisconnect
BOOLEAN m_SetPolicy
BOOLEAN m_Connected
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:651
VOID ReleaseLock(VOID)
FxInterruptEnableParameters FxInterruptDisableParameters
Definition: fxinterrupt.hpp:42
VOID SetPolicy(__in WDF_INTERRUPT_POLICY Policy, __in WDF_INTERRUPT_PRIORITY Priority, __in PGROUP_AFFINITY TargetProcessorSet)
MdLock * m_SpinLock
Definition: fxinterrupt.hpp:64
BOOLEAN Synchronize(__in PFN_WDF_INTERRUPT_SYNCHRONIZE Callback, __in WDFCONTEXT Context)
_Must_inspect_result_ NTSTATUS InitializeWorker(__in FxObject *Parent, __in PWDF_INTERRUPT_CONFIG Configuration)
VOID WorkItemHandler(VOID)
Definition: ketypes.h:687
FxCallbackLock * m_CallbackLock
Definition: fxinterrupt.hpp:93
#define __inout
Definition: dbghelp.h:50
__inline BOOLEAN IsWakeCapable(VOID)
Definition: typedefs.h:119
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
static BOOLEAN _IsWakeHintedInterrupt(__in USHORT ResourceFlags)
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
KIRQL m_OldIrql
Definition: fxinterrupt.hpp:66
PFN_WDF_INTERRUPT_ISR m_EvtInterruptIsr
PFN_WDF_INTERRUPT_ENABLE m_EvtInterruptEnable
Definition: mxlock.h:101
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:456
KDEFERRED_ROUTINE MdDeferredRoutineType
Definition: mxkm.h:35
#define _In_
Definition: no_sal2.h:158
_In_ PKSYNCHRONIZE_ROUTINE _In_opt_ __drv_aliasesMem PVOID SynchronizeContext
Definition: kefuncs.h:536
__inline BOOLEAN IsPassiveHandling(VOID)
unsigned short USHORT
Definition: pedump.c:61
static MdInterruptSynchronizeRoutineType _InterruptDisableThunk
VOID ResetInternal(VOID)
#define NULL
Definition: types.h:112
_Must_inspect_result_ NTSTATUS ForceReconnect(VOID)
EVT_WDF_INTERRUPT_DISABLE * PFN_WDF_INTERRUPT_DISABLE
Definition: wdfinterrupt.h:197
BOOLEAN TryToAcquireLock(VOID)
#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE
Definition: cmtypes.h:143
KIRQL GetResourceIrql(VOID)
_Must_inspect_result_ NTSTATUS InitializeInternal(__in FxObject *Parent, __in PWDF_INTERRUPT_CONFIG Configuration)
WDFINTERRUPT GetHandle(VOID)
BOOLEAN QueueWorkItemForIsr(VOID)
_Must_inspect_result_ NTSTATUS CreateWakeInterruptMachine(VOID)
FxInterrupt(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
MxLock m_BuiltInSpinLock
Definition: fxinterrupt.hpp:72
FxInterruptWaitblock * m_InterruptWaitblock
unsigned int ULONG
Definition: retypes.h:1
BOOLEAN WakeInterruptIsr(VOID)
static _Must_inspect_result_ NTSTATUS _CreateAndInit(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device, __in_opt FxObject *Parent, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in PWDF_INTERRUPT_CONFIG Configuration, __out FxInterrupt **Interrupt)
PFN_WDF_INTERRUPT_DPC m_EvtInterruptDpc
GROUP_AFFINITY m_Processors
virtual VOID DeleteObject(VOID)
virtual ~FxInterrupt(VOID)
FxWakeInterruptMachine * m_WakeInterruptMachine
VOID ReportInactive(_In_ BOOLEAN Internal=FALSE)
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY Policy
Definition: wdfinterrupt.h:651
VOID SetActiveForWake(__in BOOLEAN ActiveForWake)
VOID AcquireLock(VOID)
#define __in
Definition: dbghelp.h:35
static BOOLEAN _IsMessageInterrupt(__in USHORT ResourceFlags)
NTSTATUS InterruptDisableInvokeCallback(VOID)
KSYNCHRONIZE_ROUTINE MdInterruptSynchronizeRoutineType
Definition: mxgeneralkm.h:38
BOOLEAN IsActiveForWake(VOID)
struct _KINTERRUPT * m_InterruptCaptured
PFN_IO_REPORT_INTERRUPT_INACTIVE IoReportInterruptInactive
Definition: fxglobals.h:764
WDF_INTERRUPT_INFO m_InterruptInfo
EVT_WDF_INTERRUPT_DPC * PFN_WDF_INTERRUPT_DPC
Definition: wdfinterrupt.h:134
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
struct _KINTERRUPT * GetInterruptPtr(VOID)