ULONG
NdisGetCacheFillSize(
);
NdisGetCacheFillSize returns the microprocessor's data cache-line boundary in bytes.
Return Value
If NdisGetCacheFillSize succeeds, it returns the host cache fill size.
Comments
Drivers of DMA NICs can use the information returned by this function to avoid cache-line tearing during DMA transfers.
For example, a NIC driver might use the value returned by NdisGetCacheFillSize in any (or all) of the following ways:
·Allocate cache-aligned buffers for DMA operations.
·Transfer data from aligned buffers that are sized as an integral of the value returned by this function.
·Subtract one from the returned value and use the result as a mask to determine whether a "physical" address in shared memory is aligned on a cache-line boundary.
Callers of NdisGetCacheFillSize run at IRQL PASSIVE_LEVEL. Usually, miniport drivers call this function during initialization and save the value it returns.
See Also
MiniportInitialize, NdisMAllocateMapRegisters, NdisMAllocateSharedMemory, NdisMAllocateSharedMemoryAsync