Plx使用手册学习------2 PlxPci_CommonBufferUnMap

声明:

PLX_STATUS
PlxPci_CommonBufferUnmap(
PLX_DEVICE_OBJECT *pDevice,
VOID **pVa
);

PLX Chip Support: All PLX devices
PLX芯片支持: 所有PLX仪器;
Description:Unmaps the common buffer from user virtual space.

功能:取消公共缓冲区到用户虚拟空间的映射

Parameters: 

pDevice   Pointer to an open device
pVa          The virtual address of the common buffer originally obtained from PlxPci_CommonBufferMap
最初从plxpci_CommonBufferMap获得的公共缓冲区的虚拟地址

 

CodeDescription翻译
ApiSuccessThe function returned successfully and at least one event ocurred函数成功返回,并且至少发生了一个事件
ApiNullParamOne or more parameters is NULL一个或多个参数为空
ApiInvalidDeviceInfoThe device object is not valid设备对象无效
ApiInvalidAddressVirtual address is invalid or buffer was not allocated properly虚拟地址无效或未正确分配缓冲区
ApiFailedThe buffer to unmap is not valid要取消映射的缓冲区无效

It is important to unmap the common buffer when it is no longer needed to release mapping resources back to
the system.

取消公共缓冲区的映射是非常重要的,当它不再需要释放映射资源返回系统
 

The buffer should be un-mapped before calling PlxPci_DeviceClose to close the device.
在调用plxpci_device close关闭设备之前,应取消映射缓冲区。

The virtual address will cease to be valid after closing the device or after un-mapping the buffer.

这个关闭设备或取消缓冲区映射后,虚拟地址将不再有效。

VOID *pBuffer;
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
}
// Map the buffer into user space
rc =
PlxPci_CommonBufferMap(
pDevice,
&pBuffer
);
if (rc != ApiSucess)
{
// Error – Unable to map common buffer to user virtual space
}
//
// Use the common buffer as needed
//
// Unmap the buffer from user space
rc =
PlxPci_CommonBufferUnmap(
pDevice,
&pBuffer
);
if (rc != ApiSucess)
{
// Error – Unable to unmap common buffer from user virtual space
}

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值