Plx使用手册学习-----5 PlxPci_CommonBufferProperties
作者:互联网
Syntax:
PLX_STATUS
PlxPci_CommonBufferProperties(
PLX_DEVICE_OBJECT *pDevice,
PLX_PHYSICAL_MEM *pMemoryInfo
);
PLX Chip Support:
All PLX devices
Description:
返回公共缓冲区属性。
Returns the common buffer properties.
Parameters:
pDevice
Pointer to an open device
pMemoryInfo
A pointer to a PLX_PHYSICAL_MEM structure which will contain information about the common buffer
Return Codes:
Code | Description |
ApiSuccess | The function returned successfully and at least one event ocurred |
ApiNullParam | One or more parameters is NULL |
ApiInvalidDeviceInfo | The device object is not valid |
Notes:
This function will only return properties of the common buffer. It will not provide a virtual address for the buffer.
Use PlxPci_CommonBufferMap to get a virtual address.
PLX drivers allocate a common buffer for use by applications. The buffer size requested is determined by a
PLX registry entry (refer to the PLX driver registry options in this manual). The driver will attempt to allocate the
buffer, but the operating system determines the success of the attempt based upon available system resources.
PLX drivers will re-issue the request for a smaller-sized buffer until the call succeeds.
The common buffer is guaranteed to be physically contiguous and page-locked in memory so that it may be used for
operations such as DMA. PLX drivers do not use the common buffer for any functionality. Its use is reserved for
applications.
Coordination and management of access to the buffer between multiple processes or threads is left to applications.
Care must be taken to avoid shared memory issues.
Usage:
PLX_STATUS rc;
PLX_PHYSICAL_MEM BufferInfo;
// Get the common buffer information
rc =
PlxPci_CommonBufferProperties(
pDevice,
&BufferInfo
);
if (rc != ApiSucess)
{
// Error – Unable to get common buffer properties
}
Cons_printf(
“Common buffer information:\n”
“ Bus Physical Addr: %08lx\n”
“ CPU Physical Addr: %08lx\n”
“ Size : %d bytes\n”,
BufferInfo.PhysicalAddr,
BufferInfo.CpuPhysical,
BufferInfo.Size
);
标签:CommonBufferProperties,buffer,PLX,will,PlxPci,使用手册,common,BufferInfo 来源: https://blog.csdn.net/u014626607/article/details/94010631