ReactOS 0.4.17-dev-934-g091855f
legacypc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

NTSTATUS NTAPI HalpLegacyPCCreateArbiter (_In_ PDEVICE_OBJECT BusFdo)
 Initialize the legacy PC arbiter that uses PIR for PIC IRQ assignments.
 
NTSTATUS NTAPI HalpLegacyPCQueryArbInterface (_Out_writes_bytes_(Size) PVOID Interface, _In_ ULONG Size, _Out_ PULONG Length)
 Query the legacy PC Arbiter.
 

Function Documentation

◆ HalpLegacyPCCreateArbiter()

NTSTATUS NTAPI HalpLegacyPCCreateArbiter ( _In_ PDEVICE_OBJECT  BusFdo)

Initialize the legacy PC arbiter that uses PIR for PIC IRQ assignments.

Parameters
[in]BusFdoHal Bus FDO deviceobject

Definition at line 123 of file legacypcirqarb.c.

125{
127
128 PAGED_CODE();
129
134
135 /*
136 * TODO: Later we'll override more when we implement PIR.
137 * The most important piece for now here is the clamp.
138 * This will let us boot for now, preserving orignal reactos behavior.
139 * (Plug and Pray)
140 */
141
143 BusFdo,
145 L"HalIRQ",
146 L"Root",
147 NULL);
148 if (!NT_SUCCESS(Status))
149 {
150 return Status;
151 }
152
153 /* Lock to the 0-15 the PIR table only understands. */
158
159 return Status;
160}
#define PAGED_CODE()
NTSTATUS NTAPI ArbiterLibInitializeInstance(_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:69
#define ARBITER_MAXIMUM_ADDRESS
Definition: arbiter.h:13
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define L(x)
Definition: resources.c:13
Status
Definition: gdiplustypes.h:24
#define PIC_CASCADE_IRQ
Definition: halhw.h:156
static NTSTATUS NTAPI HalpLegacyPCArbUnpackRequirement(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _Out_ PUINT64 OutMinimumAddress, _Out_ PUINT64 OutMaximumAddress, _Out_ PUINT64 OutLength, _Out_ PUINT64 OutAlignment)
static INT32 NTAPI HalpLegacyPCArbScoreRequirement(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor)
static NTSTATUS NTAPI HalpLegacyPCArbUnpackResource(_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor, _Out_ PUINT64 Start, _Out_ PUINT64 OutLength)
static NTSTATUS NTAPI HalpLegacyPCArbPackResource(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _In_ UINT64 Start, _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor)
static ARBITER_INSTANCE LegacyPCArbiter
NTSYSAPI NTSTATUS NTAPI RtlAddRange(_Inout_ PRTL_RANGE_LIST RangeList, _In_ ULONGLONG Start, _In_ ULONGLONG End, _In_ UCHAR Attributes, _In_ ULONG Flags, _In_opt_ PVOID UserData, _In_opt_ PVOID Owner)
#define RTL_RANGE_LIST_ADD_IF_CONFLICT
Definition: rtltypes.h:81
#define CmResourceTypeInterrupt
Definition: restypes.h:105
PARB_UNPACK_RESOURCE UnpackResource
Definition: arbiter.h:312
PARB_SCORE_REQUIREMENT ScoreRequirement
Definition: arbiter.h:313
PRTL_RANGE_LIST Allocation
Definition: arbiter.h:302
PARB_UNPACK_REQUIREMENT UnpackRequirement
Definition: arbiter.h:310
PARB_PACK_RESOURCE PackResource
Definition: arbiter.h:311

Referenced by HalpQueryInterface().

◆ HalpLegacyPCQueryArbInterface()

NTSTATUS NTAPI HalpLegacyPCQueryArbInterface ( _Out_writes_bytes_(Size) PVOID  Interface,
_In_ ULONG  Size,
_Out_ PULONG  Length 
)

Query the legacy PC Arbiter.

Parameters
[out]InterfaceCaller-supplied buffer that receives the ARBITER_INTERFACE.
[in]SizeSize of the Interface buffer, in bytes.
[out]LengthReceives sizeof(ARBITER_INTERFACE), whether or not the buffer was large enough.
Returns
STATUS_SUCCESS on success, or STATUS_BUFFER_TOO_SMALL if Size is smaller than sizeof(ARBITER_INTERFACE).

Definition at line 183 of file legacypcirqarb.c.

187{
188 PARBITER_INTERFACE ArbiterInterface = Interface;
189
190 PAGED_CODE();
191
192 *Length = sizeof(*ArbiterInterface);
193 if (Size < sizeof(*ArbiterInterface))
195
196 ArbiterInterface->Size = sizeof(*ArbiterInterface);
197 ArbiterInterface->Version = 1;
198 ArbiterInterface->Context = &LegacyPCArbiter;
199 ArbiterInterface->ArbiterHandler = ArbiterLibHandler;
200 ArbiterInterface->Flags = 0;
201
204
205 return STATUS_SUCCESS;
206}
NTSTATUS NTAPI ArbiterLibHandler(_In_ PVOID Context, _In_ ARBITER_ACTION Action, _Inout_ PARBITER_PARAMETERS Parameters)
The single ARBITER_ACTION dispatcher every exported ARBITER_INTERFACE points its ArbiterHandler at; C...
Definition: handler.c:164
static VOID NTAPI HalpLegacyPCArbDereference(PVOID Context)
static VOID NTAPI HalpLegacyPCArbReference(PVOID Context)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
PINTERFACE_REFERENCE InterfaceReference
Definition: iotypes.h:4661
PARBITER_HANDLER ArbiterHandler
Definition: iotypes.h:4663
PINTERFACE_DEREFERENCE InterfaceDereference
Definition: iotypes.h:4662
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465

Referenced by HalpQueryInterface().