ReactOS 0.4.16-dev-257-g6aa11ac
arbiter.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel&Driver SDK
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Hardware Resources Arbiter Library
5 * COPYRIGHT: Copyright 2020 Vadim Galyant <vgal@rambler.ru>
6 */
7
8#pragma once
9
10#define ARBITER_SIGNATURE 'sbrA'
11#define TAG_ARBITER 'MbrA'
12#define TAG_ARB_ALLOCATION 'AbrA'
13#define TAG_ARB_RANGE 'RbrA'
14
15typedef struct _ARBITER_ORDERING
16{
20
22{
27
29{
39
41{
55
57
58typedef NTSTATUS
60 _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor,
61 _Out_ PUINT64 OutMinimumAddress,
62 _Out_ PUINT64 OutMaximumAddress,
63 _Out_ PUINT32 OutLength,
64 _Out_ PUINT32 OutAlignment
65);
66
67typedef NTSTATUS
69 _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor,
72);
73
74typedef NTSTATUS
78 _Out_ PUINT32 OutLength
79);
80
81typedef INT32
83 _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor
84);
85
86typedef NTSTATUS
88 _In_ PARBITER_INSTANCE Arbiter,
89 _In_ PLIST_ENTRY ArbitrationList
90);
91
92typedef NTSTATUS
94 _In_ PARBITER_INSTANCE Arbiter,
95 _In_ PLIST_ENTRY ArbitrationList
96);
97
98typedef NTSTATUS
100 _In_ PARBITER_INSTANCE Arbiter
101);
102
103typedef NTSTATUS
105 _In_ PARBITER_INSTANCE Arbiter
106);
107
108typedef NTSTATUS
110 _In_ PARBITER_INSTANCE Arbiter,
111 _In_ PLIST_ENTRY ArbitrationList
112);
113
114/* Not correct yet, FIXME! */
115typedef NTSTATUS
117 _In_ PARBITER_INSTANCE Arbiter
118);
119
120/* Not correct yet, FIXME! */
121typedef NTSTATUS
123 _In_ PARBITER_INSTANCE Arbiter
124);
125
126/* Not correct yet, FIXME! */
127typedef NTSTATUS
129 _In_ PARBITER_INSTANCE Arbiter
130);
131
132/* Not correct yet, FIXME! */
133typedef NTSTATUS
135 _In_ PARBITER_INSTANCE Arbiter
136);
137
138typedef NTSTATUS
140 _In_ PARBITER_INSTANCE Arbiter,
142);
143
144typedef NTSTATUS
146 _In_ PARBITER_INSTANCE Arbiter,
148);
149
150typedef BOOLEAN
152 _In_ PARBITER_INSTANCE Arbiter,
154);
155
156typedef BOOLEAN
158 _In_ PARBITER_INSTANCE Arbiter,
160);
161
162typedef VOID
164 _In_ PARBITER_INSTANCE Arbiter,
166);
167
168typedef VOID
170 _In_ PARBITER_INSTANCE Arbiter,
172);
173
174/* Not correct yet, FIXME! */
175typedef NTSTATUS
177 _In_ PARBITER_INSTANCE Arbiter
178);
179
180typedef struct _ARBITER_INSTANCE
181{
185 CM_RESOURCE_TYPE ResourceType;
220
221typedef NTSTATUS
223 _Out_ PIO_RESOURCE_DESCRIPTOR OutIoDescriptor,
224 _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor
225);
226
227CODE_SEG("PAGE")
229NTAPI
232 _In_ PDEVICE_OBJECT BusDeviceObject,
233 _In_ CM_RESOURCE_TYPE ResourceType,
234 _In_ PCWSTR ArbiterName,
235 _In_ PCWSTR OrderName,
236 _In_ PARB_TRANSLATE_ORDERING TranslateOrderingFunction
237);
#define CODE_SEG(...)
unsigned short UINT16
signed int INT32
unsigned char BOOLEAN
unsigned long long UINT64
unsigned int UINT32
#define VOID
Definition: acefi.h:82
BOOLEAN(NTAPI * PARB_FIND_SUITABLE_RANGE)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:157
NTSTATUS(NTAPI * PARB_UNPACK_REQUIREMENT)(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _Out_ PUINT64 OutMinimumAddress, _Out_ PUINT64 OutMaximumAddress, _Out_ PUINT32 OutLength, _Out_ PUINT32 OutAlignment)
Definition: arbiter.h:59
NTSTATUS(NTAPI * PARB_ALLOCATE_ENTRY)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:145
NTSTATUS(NTAPI * PARB_OVERRIDE_CONFLICT)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:176
struct _ARBITER_ORDERING_LIST * PARBITER_ORDERING_LIST
NTSTATUS(NTAPI * PARB_ROLLBACK_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:104
VOID(NTAPI * PARB_ADD_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:163
struct _ARBITER_ALTERNATIVE * PARBITER_ALTERNATIVE
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:222
struct _ARBITER_ALLOCATION_STATE * PARBITER_ALLOCATION_STATE
NTSTATUS(NTAPI * PARB_PREPROCESS_ENTRY)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:139
struct _ARBITER_ORDERING * PARBITER_ORDERING
BOOLEAN(NTAPI * PARB_GET_NEXT_ALLOCATION_RANGE)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:151
NTSTATUS(NTAPI * PARB_PACK_RESOURCE)(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _In_ UINT64 Start, _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor)
Definition: arbiter.h:68
NTSTATUS(NTAPI * PARB_RETEST_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _In_ PLIST_ENTRY ArbitrationList)
Definition: arbiter.h:93
NTSTATUS(NTAPI * PARB_BOOT_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _In_ PLIST_ENTRY ArbitrationList)
Definition: arbiter.h:109
NTSTATUS(NTAPI * PARB_ADD_RESERVED)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:128
struct _ARBITER_ORDERING ARBITER_ORDERING
struct _ARBITER_INSTANCE ARBITER_INSTANCE
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:282
NTSTATUS(NTAPI * PARB_QUERY_ARBITRATE)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:116
struct _ARBITER_INSTANCE * PARBITER_INSTANCE
Definition: arbiter.h:56
NTSTATUS(NTAPI * PARB_UNPACK_RESOURCE)(_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor, _Out_ PUINT64 Start, _Out_ PUINT32 OutLength)
Definition: arbiter.h:75
NTSTATUS(NTAPI * PARB_QUERY_CONFLICT)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:122
NTSTATUS(NTAPI * PARB_START_ARBITER)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:134
NTSTATUS(NTAPI * PARB_TEST_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _In_ PLIST_ENTRY ArbitrationList)
Definition: arbiter.h:87
struct _ARBITER_ALTERNATIVE ARBITER_ALTERNATIVE
VOID(NTAPI * PARB_BACKTRACK_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Definition: arbiter.h:169
INT32(NTAPI * PARB_SCORE_REQUIREMENT)(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor)
Definition: arbiter.h:82
NTSTATUS(NTAPI * PARB_COMMIT_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter)
Definition: arbiter.h:99
struct _ARBITER_ORDERING_LIST ARBITER_ORDERING_LIST
LONG NTSTATUS
Definition: precomp.h:26
unsigned int * PUINT32
Definition: basetsd.h:125
unsigned __int64 * PUINT64
Definition: basetsd.h:187
#define NTSTATUS
Definition: precomp.h:21
return pTarget Start()
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define BOOLEAN
Definition: pedump.c:73
PARBITER_ALTERNATIVE CurrentAlternative
Definition: arbiter.h:47
UCHAR RangeAvailableAttributes
Definition: arbiter.h:52
PARBITER_ALTERNATIVE Alternatives
Definition: arbiter.h:49
PARBITER_LIST_ENTRY Entry
Definition: arbiter.h:46
PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: arbiter.h:36
PARB_RETEST_ALLOCATION RetestAllocation
Definition: arbiter.h:199
BOOLEAN TransactionInProgress
Definition: arbiter.h:214
PARB_UNPACK_RESOURCE UnpackResource
Definition: arbiter.h:196
PARB_OVERRIDE_CONFLICT OverrideConflict
Definition: arbiter.h:213
PARB_SCORE_REQUIREMENT ScoreRequirement
Definition: arbiter.h:197
PRTL_RANGE_LIST Allocation
Definition: arbiter.h:186
PKEVENT MutexEvent
Definition: arbiter.h:183
PARB_START_ARBITER StartArbiter
Definition: arbiter.h:206
PARBITER_INTERFACE Interface
Definition: arbiter.h:191
PARB_ALLOCATE_ENTRY AllocateEntry
Definition: arbiter.h:208
PDEVICE_OBJECT BusDeviceObject
Definition: arbiter.h:216
CM_RESOURCE_TYPE ResourceType
Definition: arbiter.h:185
PVOID ConflictCallback
Definition: arbiter.h:218
PARB_UNPACK_REQUIREMENT UnpackRequirement
Definition: arbiter.h:194
ARBITER_ORDERING_LIST ReservedList
Definition: arbiter.h:189
PARB_QUERY_ARBITRATE QueryArbitrate
Definition: arbiter.h:203
PARB_PREPROCESS_ENTRY PreprocessEntry
Definition: arbiter.h:207
PARB_FIND_SUITABLE_RANGE FindSuitableRange
Definition: arbiter.h:210
PARBITER_ALLOCATION_STATE AllocationStack
Definition: arbiter.h:193
UINT32 Signature
Definition: arbiter.h:182
PARB_GET_NEXT_ALLOCATION_RANGE GetNextAllocationRange
Definition: arbiter.h:209
PARB_BOOT_ALLOCATION BootAllocation
Definition: arbiter.h:202
PVOID ConflictCallbackContext
Definition: arbiter.h:217
PARB_ADD_RESERVED AddReserved
Definition: arbiter.h:205
PARB_TEST_ALLOCATION TestAllocation
Definition: arbiter.h:198
PARB_ADD_ALLOCATION AddAllocation
Definition: arbiter.h:211
PARB_QUERY_CONFLICT QueryConflict
Definition: arbiter.h:204
PRTL_RANGE_LIST PossibleAllocation
Definition: arbiter.h:187
PARB_COMMIT_ALLOCATION CommitAllocation
Definition: arbiter.h:200
ARBITER_ORDERING_LIST OrderingList
Definition: arbiter.h:188
PARB_PACK_RESOURCE PackResource
Definition: arbiter.h:195
PARB_BACKTRACK_ALLOCATION BacktrackAllocation
Definition: arbiter.h:212
UINT32 AllocationStackMaxSize
Definition: arbiter.h:192
PARB_ROLLBACK_ALLOCATION RollbackAllocation
Definition: arbiter.h:201
INT32 ReferenceCount
Definition: arbiter.h:190
Definition: iotypes.h:4630
PARBITER_ORDERING Orderings
Definition: arbiter.h:25
UINT64 Start
Definition: arbiter.h:17
Definition: typedefs.h:120
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
unsigned char UCHAR
Definition: xmlstorage.h:181