ReactOS  0.4.15-dev-2701-g34593d9
arbiter.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Kernel
3  * COPYRIGHT: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * FILE: lib/drivers/arbiter/arbiter.h
5  * PURPOSE: Hardware Resources Arbiter Library
6  * PROGRAMMERS: Copyright 2020 Vadim Galyant <vgal@rambler.ru>
7  */
8 
9 #ifndef _ARBITER_H
10 #define _ARBITER_H
11 
12 typedef struct _ARBITER_ORDERING
13 {
17 
18 typedef struct _ARBITER_ORDERING_LIST
19 {
24 
25 typedef struct _ARBITER_ALTERNATIVE
26 {
36 
38 {
52 
54 
55 typedef NTSTATUS
57  _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor,
58  _Out_ PULONGLONG OutMinimumAddress,
59  _Out_ PULONGLONG OutMaximumAddress,
60  _Out_ PULONG OutLength,
61  _Out_ PULONG OutAlignment
62 );
63 
64 typedef NTSTATUS
66  _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor,
69 );
70 
71 typedef NTSTATUS
75  _Out_ PULONG OutLength
76 );
77 
78 typedef LONG
80  _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor
81 );
82 
83 typedef NTSTATUS
85  _In_ PARBITER_INSTANCE Arbiter,
86  _In_ PLIST_ENTRY ArbitrationList
87 );
88 
89 typedef NTSTATUS
91  _In_ PARBITER_INSTANCE Arbiter,
92  _In_ PLIST_ENTRY ArbitrationList
93 );
94 
95 typedef NTSTATUS
97  _In_ PARBITER_INSTANCE Arbiter
98 );
99 
100 typedef NTSTATUS
102  _In_ PARBITER_INSTANCE Arbiter
103 );
104 
105 typedef NTSTATUS
107  _In_ PARBITER_INSTANCE Arbiter,
108  _In_ PLIST_ENTRY ArbitrationList
109 );
110 
111 /* Not correct yet, FIXME! */
112 typedef NTSTATUS
114  _In_ PARBITER_INSTANCE Arbiter
115 );
116 
117 /* Not correct yet, FIXME! */
118 typedef NTSTATUS
120  _In_ PARBITER_INSTANCE Arbiter
121 );
122 
123 /* Not correct yet, FIXME! */
124 typedef NTSTATUS
126  _In_ PARBITER_INSTANCE Arbiter
127 );
128 
129 /* Not correct yet, FIXME! */
130 typedef NTSTATUS
132  _In_ PARBITER_INSTANCE Arbiter
133 );
134 
135 typedef NTSTATUS
137  _In_ PARBITER_INSTANCE Arbiter,
139 );
140 
141 typedef NTSTATUS
143  _In_ PARBITER_INSTANCE Arbiter,
145 );
146 
147 typedef BOOLEAN
149  _In_ PARBITER_INSTANCE Arbiter,
151 );
152 
153 typedef BOOLEAN
155  _In_ PARBITER_INSTANCE Arbiter,
157 );
158 
159 typedef VOID
161  _In_ PARBITER_INSTANCE Arbiter,
163 );
164 
165 typedef VOID
167  _In_ PARBITER_INSTANCE Arbiter,
169 );
170 
171 /* Not correct yet, FIXME! */
172 typedef NTSTATUS
174  _In_ PARBITER_INSTANCE Arbiter
175 );
176 
177 typedef struct _ARBITER_INSTANCE
178 {
182  CM_RESOURCE_TYPE ResourceType;
217 
218 typedef NTSTATUS
220  _Out_ PIO_RESOURCE_DESCRIPTOR OutIoDescriptor,
221  _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor
222 );
223 
224 NTSTATUS
225 NTAPI
227  _Inout_ PARBITER_INSTANCE Arbiter,
228  _In_ PDEVICE_OBJECT BusDeviceObject,
229  _In_ CM_RESOURCE_TYPE ResourceType,
230  _In_ PCWSTR ArbiterName,
231  _In_ PCWSTR OrderName,
232  _In_ PARB_TRANSLATE_ORDERING TranslateOrderingFunction
233 );
234 
235 #endif /* _ARBITER_H */
PARB_START_ARBITER StartArbiter
Definition: arbiter.h:203
PARBITER_ALTERNATIVE CurrentAlternative
Definition: arbiter.h:44
const uint16_t * PCWSTR
Definition: typedefs.h:57
NTSTATUS NTAPI ArbInitializeArbiterInstance(_Inout_ PARBITER_INSTANCE Arbiter, _In_ PDEVICE_OBJECT BusDeviceObject, _In_ CM_RESOURCE_TYPE ResourceType, _In_ PCWSTR ArbiterName, _In_ PCWSTR OrderName, _In_ PARB_TRANSLATE_ORDERING TranslateOrderingFunction)
Definition: arbiter.c:27
NTSTATUS(NTAPI * PARB_UNPACK_REQUIREMENT)(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _Out_ PULONGLONG OutMinimumAddress, _Out_ PULONGLONG OutMaximumAddress, _Out_ PULONG OutLength, _Out_ PULONG OutAlignment)
Definition: arbiter.h:56
PARB_RETEST_ALLOCATION RetestAllocation
Definition: arbiter.h:196
NTSTATUS(NTAPI * PARB_START_ARBITER)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:131
struct _ARBITER_ORDERING ARBITER_ORDERING
PARB_PREPROCESS_ENTRY PreprocessEntry
Definition: arbiter.h:204
struct _ARBITER_ALLOCATION_STATE * PARBITER_ALLOCATION_STATE
PARB_QUERY_CONFLICT QueryConflict
Definition: arbiter.h:201
LONG ReferenceCount
Definition: arbiter.h:187
PARBITER_ORDERING Orderings
Definition: arbiter.h:22
struct _ARBITER_INSTANCE ARBITER_INSTANCE
PARBITER_INTERFACE Interface
Definition: arbiter.h:188
LONG NTSTATUS
Definition: precomp.h:26
struct _ARBITER_ALLOCATION_STATE ARBITER_ALLOCATION_STATE
NTSTATUS(NTAPI * PARB_TRANSLATE_ORDERING)(_Out_ PIO_RESOURCE_DESCRIPTOR OutIoDescriptor, _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor)
Definition: arbiter.h:219
struct _ARBITER_ORDERING_LIST * PARBITER_ORDERING_LIST
ULONGLONG Minimum
Definition: arbiter.h:27
ULONGLONG CurrentMinimum
Definition: arbiter.h:41
PARBITER_LIST_ENTRY Entry
Definition: arbiter.h:43
LONG(NTAPI * PARB_SCORE_REQUIREMENT)(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor)
Definition: arbiter.h:79
ULONG AllocationStackMaxSize
Definition: arbiter.h:189
PARB_ADD_ALLOCATION AddAllocation
Definition: arbiter.h:208
PARB_TEST_ALLOCATION TestAllocation
Definition: arbiter.h:195
Definition: iotypes.h:4630
PKEVENT MutexEvent
Definition: arbiter.h:180
uint32_t ULONG_PTR
Definition: typedefs.h:65
PARB_ROLLBACK_ALLOCATION RollbackAllocation
Definition: arbiter.h:198
PRTL_RANGE_LIST Allocation
Definition: arbiter.h:183
ULONGLONG CurrentMaximum
Definition: arbiter.h:42
PARB_BACKTRACK_ALLOCATION BacktrackAllocation
Definition: arbiter.h:209
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID(NTAPI * PARB_ADD_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:160
PARB_SCORE_REQUIREMENT ScoreRequirement
Definition: arbiter.h:194
ARBITER_ORDERING_LIST ReservedList
Definition: arbiter.h:186
struct _ARBITER_ALTERNATIVE ARBITER_ALTERNATIVE
long LONG
Definition: pedump.c:60
ULONGLONG Start
Definition: arbiter.h:14
NTSTATUS(NTAPI * PARB_ADD_RESERVED)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:125
NTSTATUS(NTAPI * PARB_RETEST_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _In_ PLIST_ENTRY ArbitrationList)
Definition: arbiter.h:90
PDEVICE_OBJECT BusDeviceObject
Definition: arbiter.h:213
NTSTATUS(NTAPI * PARB_ROLLBACK_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:101
unsigned char BOOLEAN
#define _Out_
Definition: no_sal2.h:160
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
PARB_COMMIT_ALLOCATION CommitAllocation
Definition: arbiter.h:197
NTSTATUS(NTAPI * PARB_BOOT_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _In_ PLIST_ENTRY ArbitrationList)
Definition: arbiter.h:106
NTSTATUS(NTAPI * PARB_UNPACK_RESOURCE)(_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor, _Out_ PULONGLONG Start, _Out_ PULONG OutLength)
Definition: arbiter.h:72
ULONGLONG End
Definition: arbiter.h:15
PARB_UNPACK_REQUIREMENT UnpackRequirement
Definition: arbiter.h:191
struct _ARBITER_ORDERING_LIST ARBITER_ORDERING_LIST
BOOLEAN TransactionInProgress
Definition: arbiter.h:211
uint64_t ULONGLONG
Definition: typedefs.h:67
NTSTATUS(NTAPI * PARB_QUERY_ARBITRATE)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:113
NTSTATUS(NTAPI * PARB_PREPROCESS_ENTRY)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:136
ARBITER_ORDERING_LIST OrderingList
Definition: arbiter.h:185
NTSTATUS(NTAPI * PARB_COMMIT_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:96
#define _Inout_
Definition: no_sal2.h:162
PARB_ADD_RESERVED AddReserved
Definition: arbiter.h:202
Definition: partlist.h:33
struct _ARBITER_INSTANCE * PARBITER_INSTANCE
Definition: arbiter.h:53
NTSTATUS(NTAPI * PARB_PACK_RESOURCE)(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _In_ ULONGLONG Start, _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor)
Definition: arbiter.h:65
NTSTATUS(NTAPI * PARB_QUERY_CONFLICT)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:119
unsigned char UCHAR
Definition: xmlstorage.h:181
NTSTATUS(NTAPI * PARB_TEST_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _In_ PLIST_ENTRY ArbitrationList)
Definition: arbiter.h:84
PVOID ConflictCallbackContext
Definition: arbiter.h:214
NTSTATUS(NTAPI * PARB_OVERRIDE_CONFLICT)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:173
#define NTSTATUS
Definition: precomp.h:20
#define VOID
Definition: acefi.h:82
Definition: typedefs.h:119
PRTL_RANGE_LIST PossibleAllocation
Definition: arbiter.h:184
PARB_PACK_RESOURCE PackResource
Definition: arbiter.h:192
PARBITER_ALLOCATION_STATE AllocationStack
Definition: arbiter.h:190
#define _In_
Definition: no_sal2.h:158
BOOLEAN(NTAPI * PARB_GET_NEXT_ALLOCATION_RANGE)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:148
unsigned short USHORT
Definition: pedump.c:61
PARBITER_ALTERNATIVE Alternatives
Definition: arbiter.h:46
PARB_QUERY_ARBITRATE QueryArbitrate
Definition: arbiter.h:200
unsigned int * PULONG
Definition: retypes.h:1
PVOID ConflictCallback
Definition: arbiter.h:215
VOID(NTAPI * PARB_BACKTRACK_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:166
PARB_ALLOCATE_ENTRY AllocateEntry
Definition: arbiter.h:205
NTSTATUS(NTAPI * PARB_ALLOCATE_ENTRY)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:142
#define BOOLEAN
Definition: pedump.c:73
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:383
PARB_OVERRIDE_CONFLICT OverrideConflict
Definition: arbiter.h:210
CM_RESOURCE_TYPE ResourceType
Definition: arbiter.h:182
unsigned int ULONG
Definition: retypes.h:1
ULONGLONG Maximum
Definition: arbiter.h:28
struct _ARBITER_ORDERING * PARBITER_ORDERING
PARB_FIND_SUITABLE_RANGE FindSuitableRange
Definition: arbiter.h:207
BOOLEAN(NTAPI * PARB_FIND_SUITABLE_RANGE)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:154
PARB_BOOT_ALLOCATION BootAllocation
Definition: arbiter.h:199
PARB_GET_NEXT_ALLOCATION_RANGE GetNextAllocationRange
Definition: arbiter.h:206
UCHAR RangeAvailableAttributes
Definition: arbiter.h:49
struct _ARBITER_ALTERNATIVE * PARBITER_ALTERNATIVE
PARB_UNPACK_RESOURCE UnpackResource
Definition: arbiter.h:193
PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: arbiter.h:33