|
ReactOS 0.4.17-dev-806-gffa4164
|
#include <ntoskrnl.h>#include <debug.h>
Go to the source code of this file.
Macros | |
| #define | NDEBUG |
| #define | PORT_ALIAS_STRIDE_10_BIT 0x400 |
| #define | PORT_ALIAS_STRIDE_12_BIT 0x1000 |
| #define | PORT_MAX_ADDRESS 0xFFFF |
Functions | |
| ULONGLONG NTAPI | RtlIoDecodeMemIoResource (_In_ PIO_RESOURCE_DESCRIPTOR Descriptor, _Out_opt_ PULONGLONG Alignment, _Out_opt_ PULONGLONG MinimumAddress, _Out_opt_ PULONGLONG MaximumAddress) |
| ULONGLONG NTAPI | RtlCmDecodeMemIoResource (_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, _Out_opt_ PULONGLONG Start) |
| static NTSTATUS | IopArbPortTranslateAddress (_In_ UCHAR SourceType, _In_ PHYSICAL_ADDRESS SourceAddress, _Out_ PPHYSICAL_ADDRESS TranslatedAddress, _Out_ PUCHAR TranslatedType) |
| Translates one bus-relative address to a system-physical one on the ISA bus, and reports the space it landed in as a CM resource type. | |
| static BOOLEAN | IopArbPortGetNextAlias (_In_ USHORT DescriptorFlags, _In_ UINT64 LastAlias, _Out_ PUINT64 NextAlias) |
| Walks the decode-alias chain of a port range: given the previous alias, or the granted range's start on the first call, produces the next one. | |
| static NTSTATUS NTAPI | IopArbPortUnpackRequirements (_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _Out_ PUINT64 OutMinimumAddress, _Out_ PUINT64 OutMaximumAddress, _Out_ PUINT64 OutLength, _Out_ PUINT64 OutAlignment) |
| Extracts the placement window from one I/O port requirement. The UnpackRequirement callback of the Root Port arbiter. | |
| static NTSTATUS NTAPI | IopArbPortPackResource (_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _In_ UINT64 Start, _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor) |
| Materialises the arbiter's chosen placement as an assigned CM descriptor. The PackResource callback of the Root Port arbiter. | |
| static NTSTATUS NTAPI | IopArbPortUnpackResource (_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor, _Out_ PUINT64 Start, _Out_ PUINT64 OutLength) |
| Reads the placement back out of an already-assigned descriptor (a firmware boot configuration, typically) so the arbiter can mark that span occupied. The inverse of IopArbPortPackResource and the UnpackResource callback of the Root Port arbiter. | |
| static INT32 NTAPI | IopArbPortScoreRequirement (_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor) |
| Scores how constrained a requirement is: the number of distinct aligned addresses it could be placed at inside its own window, ignoring what is already allocated. The ScoreRequirement callback of the Root Port arbiter. | |
| static NTSTATUS NTAPI | IopArbPortTranslateOrdering (_Out_ PIO_RESOURCE_DESCRIPTOR OutIoDescriptor, _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor) |
| Translates one registry allocation-ordering window from the bus-relative addresses it is written in into the system-physical space the arbiter allocates in. The TranslateOrdering function of the Root Port arbiter. | |
| static BOOLEAN NTAPI | IopArbPortFindSuitableRange (_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState) |
| The Root Port arbiter's FindSuitableRange: the engine search, incremented for a device asking to keep the ports the firmware already programmed it into. | |
| static VOID NTAPI | IopArbPortAddAllocation (_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState) |
| The Root Port arbiter's AddAllocation: records the granted range in the tentative allocation, and behind it every port range a partially-decoding ISA card would shadow. | |
| static VOID NTAPI | IopArbPortBacktrackAllocation (_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState) |
| The Root Port arbiter's BacktrackAllocation: the exact inverse of IopArbPortAddAllocation. | |
| NTSTATUS NTAPI | IopArbPortInitialize (VOID) |
| Initialize the RootPortArbiter. | |
Variables | |
| ARBITER_INSTANCE | IopRootPortArbiter |
|
static |
The Root Port arbiter's AddAllocation: records the granted range in the tentative allocation, and behind it every port range a partially-decoding ISA card would shadow.
| [in] | Arbiter | The Root Port arbiter instance. |
| [in,out] | ArbState | The allocation state carrying the granted Start and End. Alias ranges span the same width, belong to the same device, and are tagged ARBITER_RANGE_PORT_ALIAS. |
Definition at line 455 of file arbport.c.
Referenced by IopArbPortInitialize().
|
static |
The Root Port arbiter's BacktrackAllocation: the exact inverse of IopArbPortAddAllocation.
| [in] | Arbiter | The Root Port arbiter instance. |
| [in,out] | ArbState | The allocation state whose placement is being withdrawn. |
Definition at line 516 of file arbport.c.
Referenced by IopArbPortInitialize().
|
static |
The Root Port arbiter's FindSuitableRange: the engine search, incremented for a device asking to keep the ports the firmware already programmed it into.
| [in] | Arbiter | The Root Port arbiter instance. |
| [in,out] | ArbState | The allocation state of the requirement being placed. |
Definition at line 426 of file arbport.c.
Referenced by IopArbPortInitialize().
|
static |
Walks the decode-alias chain of a port range: given the previous alias, or the granted range's start on the first call, produces the next one.
| [in] | DescriptorFlags | The requirement's flags. Only 10-bit and 12-bit decode requirements alias; a full 16-bit decoder owns exactly what it asked for. |
| [in] | LastAlias | The previous alias start, or the granted range's start. |
| [out] | NextAlias | Receives the next alias start. |
Definition at line 134 of file arbport.c.
Referenced by IopArbPortAddAllocation(), and IopArbPortBacktrackAllocation().
Initialize the RootPortArbiter.
The root port arbiter owns the 16-bit x86 I/O port space and hands out sub-ranges of it. It is the fallback for every device whose ports no closer arbiter claims: root-enumerated and HAL-reported legacy hardware above all, which is also the hardware that partially decodes its address lines and so needs the aliasing this arbiter adds.
| STATUS_SUCCESS | |
| STATUS_UNSUCCESSFUL | |
| STATUS_INSUFFICIENT_RESOURCES |
Definition at line 557 of file arbport.c.
Referenced by IopInitializeArbiters().
|
static |
Materialises the arbiter's chosen placement as an assigned CM descriptor. The PackResource callback of the Root Port arbiter.
| [in] | IoDescriptor | The requirement the placement satisfies. Type, Flags and ShareDisposition come across unchanged, and so does the Length, still in the encoding its Flags describe. |
| [in] | Start | The port address the arbiter settled on. |
| [out] | CmDescriptor | Receives the assigned descriptor. |
Definition at line 227 of file arbport.c.
Referenced by IopArbPortInitialize().
|
static |
Scores how constrained a requirement is: the number of distinct aligned addresses it could be placed at inside its own window, ignoring what is already allocated. The ScoreRequirement callback of the Root Port arbiter.
| [in] | IoDescriptor | The requirement to score. |
Definition at line 302 of file arbport.c.
Referenced by IopArbPortInitialize().
|
static |
Translates one bus-relative address to a system-physical one on the ISA bus, and reports the space it landed in as a CM resource type.
| [in] | SourceType | The CM resource type of the address being translated. |
| [in] | SourceAddress | The bus-relative address. |
| [out] | TranslatedAddress | Receives the system-physical address. |
| [out] | TranslatedType | Receives the post-translation resource type. A HAL may map one space onto another (memory-mapped I/O ports being the usual case) so the type is taken from the space the translation actually returned rather than assumed, e.g IOPorts, MMIO, etc. |
Definition at line 72 of file arbport.c.
Referenced by IopArbPortTranslateOrdering().
|
static |
Translates one registry allocation-ordering window from the bus-relative addresses it is written in into the system-physical space the arbiter allocates in. The TranslateOrdering function of the Root Port arbiter.
| [out] | OutIoDescriptor | Receives the translated copy. An entry whose endpoints cannot both be translated is marked CmResourceTypeNull for the ordering reader to drop; otherwise it takes the translated type. |
| [in] | IoDescriptor | The ordering window. A descriptor that carries no address passes through untouched. |
Definition at line 358 of file arbport.c.
Referenced by IopArbPortInitialize().
|
static |
Extracts the placement window from one I/O port requirement. The UnpackRequirement callback of the Root Port arbiter.
| [in] | IoDescriptor | The requirement to decode. |
| [out] | OutMinimumAddress | Receives the lowest port address the requirement accepts. |
| [out] | OutMaximumAddress | Receives the highest port address the requirement accepts. |
| [out] | OutLength | Receives the number of consecutive ports wanted. |
| [out] | OutAlignment | Receives the requirement's alignment; a zero alignment means the device does not care and is normalized to byte alignment, since the placement arithmetic divides by it. |
Definition at line 185 of file arbport.c.
Referenced by IopArbPortInitialize().
|
static |
Reads the placement back out of an already-assigned descriptor (a firmware boot configuration, typically) so the arbiter can mark that span occupied. The inverse of IopArbPortPackResource and the UnpackResource callback of the Root Port arbiter.
| [in] | CmDescriptor | The assigned descriptor to decode. |
| [out] | Start | Receives the assigned port address. |
| [out] | OutLength | Receives the assigned length. |
Definition at line 266 of file arbport.c.
Referenced by IopArbPortInitialize().
| ULONGLONG NTAPI RtlCmDecodeMemIoResource | ( | _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR | Descriptor, |
| _Out_opt_ PULONGLONG | Start | ||
| ) |
Definition at line 58 of file memres.c.
Referenced by IopArbPortUnpackResource().
| ULONGLONG NTAPI RtlIoDecodeMemIoResource | ( | _In_ PIO_RESOURCE_DESCRIPTOR | Descriptor, |
| _Out_opt_ PULONGLONG | Alignment, | ||
| _Out_opt_ PULONGLONG | MinimumAddress, | ||
| _Out_opt_ PULONGLONG | MaximumAddress | ||
| ) |
Definition at line 79 of file memres.c.
Referenced by IopArbPortScoreRequirement(), and IopArbPortUnpackRequirements().
|
extern |
Definition at line 27 of file pnpinit.c.
Referenced by IopArbPortInitialize().