|
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 | MEMORY_24_BIT_MAX_ADDRESS 0xFFFFFF |
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 | IopArbMemTranslateAddress (_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 NTSTATUS NTAPI | IopArbMemUnpackRequirements (_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _Out_ PUINT64 OutMinimumAddress, _Out_ PUINT64 OutMaximumAddress, _Out_ PUINT64 OutLength, _Out_ PUINT64 OutAlignment) |
| Extracts the placement window from one memory requirement. The UnpackRequirement callback of the Root Memory arbiter. | |
| static NTSTATUS NTAPI | IopArbMemPackResource (_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 Memory arbiter. | |
| static NTSTATUS NTAPI | IopArbMemUnpackResource (_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 IopArbMemPackResource and the UnpackResource callback of the Root Memory arbiter. | |
| static INT32 NTAPI | IopArbMemScoreRequirement (_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 Memory arbiter. | |
| static NTSTATUS NTAPI | IopArbMemTranslateOrdering (_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 Memory arbiter. | |
| static BOOLEAN NTAPI | IopArbMemFindSuitableRange (_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState) |
| The Root Memory arbiter's FindSuitableRange: the engine search, incremented for a device asking to keep the MMIO window the firmware already programmed it into. | |
| NTSTATUS NTAPI | IopArbMemInitialize (VOID) |
| Initialize the RootMemoryArbiter. | |
Variables | |
| ARBITER_INSTANCE | IopRootMemArbiter |
|
static |
The Root Memory arbiter's FindSuitableRange: the engine search, incremented for a device asking to keep the MMIO window the firmware already programmed it into.
| [in] | Arbiter | The Root Memory arbiter instance. |
| [in,out] | ArbState | The allocation state of the requirement being placed. |
Definition at line 384 of file arbmem.c.
Referenced by IopArbMemInitialize().
Initialize the RootMemoryArbiter.
The root memory arbiter owns CPU physical address space and hands each device the MMIO window it decodes. It is the fallback for every device whose memory no closer arbiter claims.
The physical page 0 is reserved with no attributes at all, so that no availability mask can hand it out: the real-mode interrupt vector table and the BIOS data area live there, and a device decoding over them corrupts the machine rather than merely failing.
| STATUS_SUCCESS | |
| STATUS_UNSUCCESSFUL | |
| STATUS_INSUFFICIENT_RESOURCES |
Definition at line 415 of file arbmem.c.
Referenced by IopInitializeArbiters().
|
static |
Materialises the arbiter's chosen placement as an assigned CM descriptor. The PackResource callback of the Root Memory arbiter.
| [in] | IoDescriptor | The requirement the placement satisfies. Type, Flags and ShareDisposition come across unchanged - and have to, since for a large-memory descriptor the Flags are what say how the Length beside them is encoded. |
| [in] | Start | The physical address the arbiter settled on. |
| [out] | CmDescriptor | Receives the assigned descriptor. |
Definition at line 186 of file arbmem.c.
Referenced by IopArbMemInitialize().
|
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 Memory arbiter.
| [in] | IoDescriptor | The requirement to score. |
Definition at line 260 of file arbmem.c.
Referenced by IopArbMemInitialize().
|
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, so the type is taken from the space the translation actually returned rather than assumed, e.g IOPorts, MMIO, etc. |
Definition at line 65 of file arbmem.c.
Referenced by IopArbMemTranslateOrdering().
|
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 Memory 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 316 of file arbmem.c.
Referenced by IopArbMemInitialize().
|
static |
Extracts the placement window from one memory requirement. The UnpackRequirement callback of the Root Memory arbiter.
| [in] | IoDescriptor | The requirement to decode. |
| [out] | OutMinimumAddress | Receives the lowest physical address the requirement accepts. |
| [out] | OutMaximumAddress | Receives the highest physical address the requirement accepts. A CM_RESOURCE_MEMORY_24 card only wires up 24 address lines and cannot be reached above 16 MB whatever its descriptor claims, so its window is clamped here rather than left for the placement search to get wrong. |
| [out] | OutLength | Receives the size of the window wanted. |
| [out] | OutAlignment | Receives the requirement's alignment; a zero alignment means the device does not care and is normalised to byte alignment, since the placement arithmetic divides by it. |
Definition at line 136 of file arbmem.c.
Referenced by IopArbMemInitialize().
|
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 IopArbMemPackResource and the UnpackResource callback of the Root Memory arbiter.
| [in] | CmDescriptor | The assigned descriptor to decode. |
| [out] | Start | Receives the assigned physical address. |
| [out] | OutLength | Receives the assigned length. |
Definition at line 225 of file arbmem.c.
Referenced by IopArbMemInitialize().
| ULONGLONG NTAPI RtlCmDecodeMemIoResource | ( | _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR | Descriptor, |
| _Out_opt_ PULONGLONG | Start | ||
| ) |
Definition at line 58 of file memres.c.
Referenced by IopArbMemUnpackResource().
| 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 IopArbMemScoreRequirement(), and IopArbMemUnpackRequirements().
|
extern |
Definition at line 26 of file pnpinit.c.
Referenced by IopArbMemInitialize().