ReactOS  0.4.15-dev-3303-g1ade494
fxspinlock.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxSpinLock.hpp
8 
9 Abstract:
10 
11 Author:
12 
13 
14 Revision History:
15 
16 --*/
17 
18 #ifndef _FXSPINLOCK_H_
19 #define _FXSPINLOCK_H_
20 
21 #define FX_SPIN_LOCK_NUM_HISTORY_ENTRIES (10)
22 
27 };
28 
30 
33 
35 
37 };
38 
40 
41 class FxSpinLock : public FxObject {
42 
43 public:
44  FxSpinLock(
45  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
46  __in USHORT ExtraSize
47  );
48 
49 
52  VOID
54  __in PVOID CallersAddress
55  );
56 
58  VOID
60  VOID
61  );
62 
63 
64  MdLock*
66  VOID
67  )
68  {
69  return &m_SpinLock.Get();
70  }
71 
72  VOID
74  VOID
75  )
76  {
78  }
79 
80  BOOLEAN
82  VOID
83  )
84  {
85  return m_InterruptLock;
86  }
87 
88 protected:
91  VOID
92  )
93  {
96  return NULL;
97  }
98  else {
100  this,
103  }
104  }
105 
106 protected:
108 
110 
111  //
112  // TRUE, this lock is being used to synchronize FxInterrupts. As such, the
113  // caller is not allowed to actually call WDFSPINLOCK APIs on the handle
114  // because it would then be acquiring a spinlock at DISPATCH_LEVEL and the
115  // interrupt could be attempting to acquire the same lock at a higher IRQL
116  // on the same processor.
117  //
119 };
120 
121 #endif // _FXSPINLOCK_H_
USHORT GetObjectSize(VOID)
Definition: fxobject.hpp:750
PFX_SPIN_LOCK_HISTORY_ENTRY CurrentHistory
Definition: fxspinlock.hpp:34
KIRQL m_Irql
Definition: fxspinlock.hpp:109
#define COMPUTE_RAW_OBJECT_SIZE(_rawObjectSize)
Definition: fxhandle.h:100
#define TRUE
Definition: types.h:120
BOOLEAN m_InterruptLock
Definition: fxspinlock.hpp:118
FxSpinLock(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT ExtraSize)
Definition: fxspinlock.cpp:32
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:290
__drv_requiresIRQL(DISPATCH_LEVEL) VOID ReleaseLock(VOID)
Definition: fxspinlock.hpp:23
PVOID CallersAddress
Definition: fxspinlock.hpp:24
struct FX_SPIN_LOCK_HISTORY_ENTRY * PFX_SPIN_LOCK_HISTORY_ENTRY
Definition: fxspinlock.hpp:29
UCHAR KIRQL
Definition: env_spec_w32.h:591
LARGE_INTEGER AcquiredAtTime
Definition: fxspinlock.hpp:25
pPkgPnp m_DeviceInterfaceLock ReleaseLock(pFxDriverGlobals)
MdLock & Get()
Definition: mxlock.h:43
FORCEINLINE size_t WDF_ALIGN_SIZE_UP(_In_ size_t Length, _In_ size_t AlignTo)
Definition: wdfcore.h:129
unsigned char BOOLEAN
MxLock m_SpinLock
Definition: fxspinlock.hpp:107
int64_t LONGLONG
Definition: typedefs.h:68
LONGLONG LockedDuraction
Definition: fxspinlock.hpp:26
#define FX_SPIN_LOCK_NUM_HISTORY_ENTRIES
Definition: fxspinlock.hpp:21
MdLock * GetLock(VOID)
Definition: fxspinlock.hpp:65
pPkgPnp m_DeviceInterfaceLock AcquireLock(pFxDriverGlobals)
PFX_SPIN_LOCK_HISTORY GetHistory(VOID)
Definition: fxspinlock.hpp:90
Definition: mxlock.h:101
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
unsigned short USHORT
Definition: pedump.c:61
#define NULL
Definition: types.h:112
struct FX_SPIN_LOCK_HISTORY * PFX_SPIN_LOCK_HISTORY
Definition: fxspinlock.hpp:39
__drv_raisesIRQL(DISPATCH_LEVEL) __drv_maxIRQL(DISPATCH_LEVEL) VOID AcquireLock(__in PVOID CallersAddress)
BOOLEAN IsInterruptLock(VOID)
Definition: fxspinlock.hpp:81
FX_SPIN_LOCK_HISTORY_ENTRY History[FX_SPIN_LOCK_NUM_HISTORY_ENTRIES]
Definition: fxspinlock.hpp:36
#define __in
Definition: dbghelp.h:35
#define MEMORY_ALLOCATION_ALIGNMENT
Definition: ntbasedef.h:90
VOID SetInterruptSpinLock(VOID)
Definition: fxspinlock.hpp:73
#define WDF_PTR_ADD_OFFSET_TYPE(_ptr, _offset, _type)
Definition: wdfcore.h:141