Plx使用手册学习-----8 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:

CodeDescription
ApiSuccessThe function returned successfully and at least one event ocurred
ApiNullParamOne or more parameters is NULL
ApiInvalidDeviceInfoThe 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
);

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值