Expand Minimize

NdisGetCacheFillSize function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

NdisGetCacheFillSize returns the microprocessor's data cache-line boundary in bytes.

Syntax


ULONG NdisGetCacheFillSize(void);

Parameters

This function has no parameters.

Return value

If NdisGetCacheFillSize succeeds, it returns the host cache fill size.

Remarks

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.

Windows XP and later versions support the NdisMGetDmaAlignment function for retrieving the microprocessor's data cache-line boundary.

Callers of NdisGetCacheFillSize must run at IRQL = PASSIVE_LEVEL. Usually, miniport drivers call this function during initialization and save the value it returns.

Requirements

Target platform

Desktop

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.Windows XP supports this function for legacy drivers. However, the Windows XP DDK will not build an NDIS driver that calls this function. Instead of using NdisGetCacheFillSize, use NdisMGetDmaAlignment.

Header

Ndis.h (include Ndis.h)

IRQL

PASSIVE_LEVEL (See Remarks section)

See also

MiniportInitialize
NdisMAllocateMapRegisters
NdisMAllocateSharedMemory
NdisMAllocateSharedMemoryAsync
NdisMGetDmaAlignment

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft