ReactOS 0.4.16-dev-297-gc569aee
fxspinlock.hpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxSpinLock.hpp
8
9Abstract:
10
11Author:
12
13
14Revision 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
41class FxSpinLock : public FxObject {
42
43public:
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
82 VOID
83 )
84 {
85 return m_InterruptLock;
86 }
87
88protected:
91 VOID
92 )
93 {
96 return NULL;
97 }
98 else {
100 this,
103 }
104 }
105
106protected:
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_
unsigned char BOOLEAN
USHORT GetObjectSize(VOID)
Definition: fxobject.hpp:750
MxLock m_SpinLock
Definition: fxspinlock.hpp:107
MdLock * GetLock(VOID)
Definition: fxspinlock.hpp:65
KIRQL m_Irql
Definition: fxspinlock.hpp:109
__drv_requiresIRQL(DISPATCH_LEVEL) VOID ReleaseLock(VOID)
BOOLEAN IsInterruptLock(VOID)
Definition: fxspinlock.hpp:81
VOID SetInterruptSpinLock(VOID)
Definition: fxspinlock.hpp:73
__drv_raisesIRQL(DISPATCH_LEVEL) __drv_maxIRQL(DISPATCH_LEVEL) VOID AcquireLock(__in PVOID CallersAddress)
BOOLEAN m_InterruptLock
Definition: fxspinlock.hpp:118
PFX_SPIN_LOCK_HISTORY GetHistory(VOID)
Definition: fxspinlock.hpp:90
MdLock & Get()
Definition: mxlock.h:43
Definition: mxlock.h:102
#define __in
Definition: dbghelp.h:35
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:291
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
pPkgPnp m_DeviceInterfaceLock AcquireLock(pFxDriverGlobals)
pPkgPnp m_DeviceInterfaceLock ReleaseLock(pFxDriverGlobals)
#define COMPUTE_RAW_OBJECT_SIZE(_rawObjectSize)
Definition: fxhandle.h:100
struct FX_SPIN_LOCK_HISTORY * PFX_SPIN_LOCK_HISTORY
Definition: fxspinlock.hpp:39
struct FX_SPIN_LOCK_HISTORY_ENTRY * PFX_SPIN_LOCK_HISTORY_ENTRY
Definition: fxspinlock.hpp:29
#define FX_SPIN_LOCK_NUM_HISTORY_ENTRIES
Definition: fxspinlock.hpp:21
#define MEMORY_ALLOCATION_ALIGNMENT
Definition: ntbasedef.h:90
unsigned short USHORT
Definition: pedump.c:61
Definition: fxspinlock.hpp:23
PVOID CallersAddress
Definition: fxspinlock.hpp:24
LARGE_INTEGER AcquiredAtTime
Definition: fxspinlock.hpp:25
LONGLONG LockedDuraction
Definition: fxspinlock.hpp:26
PFX_SPIN_LOCK_HISTORY_ENTRY CurrentHistory
Definition: fxspinlock.hpp:34
FX_SPIN_LOCK_HISTORY_ENTRY History[FX_SPIN_LOCK_NUM_HISTORY_ENTRIES]
Definition: fxspinlock.hpp:36
int64_t LONGLONG
Definition: typedefs.h:68
#define WDF_PTR_ADD_OFFSET_TYPE(_ptr, _offset, _type)
Definition: wdfcore.h:141
FORCEINLINE size_t WDF_ALIGN_SIZE_UP(_In_ size_t Length, _In_ size_t AlignTo)
Definition: wdfcore.h:129