HI_S32 HI_MPI_PCIV_GetAttr(PCIV_DEVICE_ATTR_S *pPcivAttr) { CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pPcivAttr); return ioctl(g_s32PcivFd,PCIV_GETATTR_CTRL,pPcivAttr); }
HI_S32 HI_MPI_PCIV_DmaTask(PCIV_DMA_TASK_S *pTask) { CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pTask); return ioctl(g_s32PcivFd, PCIV_DMATASK_CTRL, pTask); }
HI_S32 HI_MPI_PCIV_GetBaseWindow(PCIV_BASEWINDOW_S *pBase) { CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pBase); return ioctl(g_s32PcivFd, PCIV_GETBASEWINDOW_CTRL, pBase); }
HI_S32 HI_MPI_PCIV_Free(PCIV_DEVICE_S *pDevice) { CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pDevice); return ioctl(g_s32PcivFd, PCIV_FREE_CTRL, pDevice); }
/*pci view host function*/ HI_S32 HI_MPI_PCIV_Malloc(PCIV_DEVICE_ATTR_S *pDevAttr) { CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pDevAttr); return ioctl(g_s32PcivFd,PCIV_MALLOC_CTRL, pDevAttr); }
ListString *ListString::getNextWord(ListStruct* &Position) { ListString *Word = new ListString; Word->Create(0); while (Position->ch == ' ') { Position = Position->ptr; CHECK_NULL_PTR(Position); } int WordLength = 0; while (Position->ch != ' ') { Word->Append(Position->ch); Position = Position->ptr; WordLength++; CHECK_NULL_PTR(Position); } Word->setLength(WordLength); return Word; }
ListString* ListString::getLastWord() { ListString *Word = new ListString; // Найдем последнее слово в строке ListStruct *temp = this->StringHead; while (temp != 0) { Word->Create(0); while (temp->ch != ' '){ Word->Append(temp->ch); temp = temp->ptr; CHECK_NULL_PTR(temp); } CHECK_NULL_PTR(temp); while (temp->ch == ' ') { temp = temp->ptr; CHECK_NULL_PTR(temp); } } return Word; }
/*pci view host function*/ HI_S32 HI_MPI_PCIV_HOST_AllocDstAddr(HI_S32 s32PciDev,VI_DEV ViDev,VI_CHN ViChn,const PCIV_PIC_ATTR_S *pstPicAttr ,HI_U32 u32Count,HI_U32 *pPhyAddrArray) { PCIV_DEVICE_ATTR_S stPcivAttr; CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pstPicAttr); stPcivAttr.stPCIDevice.s32PciDev = s32PciDev; stPcivAttr.stPCIDevice.s32Port = PCIV_VIU2PORT(ViDev, ViChn); memcpy(stPcivAttr.cAddrArray, pPhyAddrArray, u32Count*sizeof(HI_U32)); stPcivAttr.u32Count = u32Count; memcpy(&stPcivAttr.stPicAttr, pstPicAttr, sizeof(PCIV_PIC_ATTR_S)); return HI_MPI_PCIV_Malloc(&stPcivAttr); }
HI_S32 HI_MPI_PCIV_SLAVE_GetDstPicAttr(VI_DEV ViDev,VI_CHN ViChn,PCIV_PIC_ATTR_S *pstPicAttr) { PCIV_DEVICE_ATTR_S stPcivAttr; HI_S32 s32Ret; CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pstPicAttr); stPcivAttr.stPCIDevice.s32PciDev = 0; stPcivAttr.stPCIDevice.s32Port = PCIV_VIU2PORT(ViDev, ViChn); s32Ret = HI_MPI_PCIV_GetAttr(&stPcivAttr); if(HI_SUCCESS == s32Ret) { memcpy(pstPicAttr,&stPcivAttr.stPicAttr,sizeof(PCIV_PIC_ATTR_S)); } return s32Ret; }
HI_S32 HI_MPI_PCIV_SLAVE_SetDstAddr(VI_DEV ViDev,VI_CHN ViChn,HI_U32 *pPhyAddrArray,HI_U32 u32Count) { PCIV_DEVICE_ATTR_S stPcivAttr; HI_S32 s32Ret; CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pPhyAddrArray); stPcivAttr.stPCIDevice.s32PciDev = 0; stPcivAttr.stPCIDevice.s32Port = PCIV_VIU2PORT(ViDev, ViChn); s32Ret = ioctl(g_s32PcivFd,PCIV_GETATTR_CTRL,&stPcivAttr); if(HI_SUCCESS != s32Ret) { return s32Ret; } stPcivAttr.cAddrArray = pPhyAddrArray; stPcivAttr.u32Count = u32Count; return HI_MPI_PCIV_SetAttr(&stPcivAttr); }
HI_S32 HI_MPI_PCIV_Start(PCIV_DEVICE_S *pDevice) { CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pDevice); return ioctl(g_s32PcivFd, PCIV_START_CTRL, pDevice); }
HI_S32 HI_MPI_PCIV_Destroy(PCIV_DEVICE_S *pDevice) { CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pDevice); return ioctl(g_s32PcivFd, PCIV_DESTROY_DEVICE_CTRL, pDevice); }
HI_S32 HI_MPI_PCIV_UnBind(PCIV_BIND_S *pBind) { CHECK_PCIV_OPEN(); CHECK_NULL_PTR(pBind); return ioctl(g_s32PcivFd, PCIV_UNBIND_CTRL, pBind); }