/***************************************************************************** Function : vos_FidTask Description: the process entry of every FID Input : ulQueueID -- the queue of the FID : the ID of the FID Return : VOS_VOID *****************************************************************************/ VOS_VOID vos_FidTask( VOS_UINT32 ulQueueID, VOS_UINT32 FID_value, VOS_UINT32 Para1, VOS_UINT32 Para2 ) { MSG_CB *pMsg; VOS_UINT32 iThePid; VOS_UINT32 Msg_Address; for ( ; ; ) { if ( VOS_ERR == VOS_FixedQueueRead(ulQueueID, &Msg_Address)) { Print1("# FID fetch message error. the Q ID is %ld.\r\n", (VOS_INT)ulQueueID); continue; } Msg_Address += VOS_MSG_BLK_HEAD_LEN; pMsg = (MSG_CB *)Msg_Address; iThePid = pMsg->uwReceiverPid; if(!VOS_PidCheck(iThePid)) { Print("# vos_FidTask Pid too big.\r\n"); VOS_FreeMsg( iThePid, pMsg ); continue; } if( VOS_ID_PID_BELONG_TO_FID == vos_FidCtrlBlk[FID_value].PidsBelong[VOS_PidIdx(iThePid)] ) { /* 接收消息时调用hook */ if ( VOS_NULL_PTR != g_pfVosHookFuncTable[OS_HOOK_TYPE_MSG_GET] ) { ((VOS_MSG_HOOK_FUNC)g_pfVosHookFuncTable[OS_HOOK_TYPE_MSG_GET])(pMsg); } (vos_PidRecords[VOS_PidIdx(iThePid)].MsgFunction)(pMsg); } else { Print("# vos_FidTask Pid not belong the Fid.\r\n"); } VOS_FreeMsg( iThePid, pMsg ); } }
/***************************************************************************** Function : vos_FidTask Description: the process entry of every FID Input : ulQueueID -- the queue of the FID : the ID of the FID Return : void *****************************************************************************/ VOS_VOID vos_FidTask( VOS_UINT32 ulQueueID, VOS_UINT32 FID_value, VOS_UINT32 Para1, VOS_UINT32 Para2 ) { MSG_CB *pMsg; VOS_UINT32 *pulMsgAddr; VOS_UINT32 iThePid; VOS_UINT32 Msg_Address; for(;;) { if ( VOS_ERR == VOS_FixedQueueRead(ulQueueID, 0, &Msg_Address, VOS_FID_MAX_MSG_LENGTH)) { LogPrint1("# FID fetch message error. the Q ID is %d.\r\n", (int)ulQueueID); continue; } Msg_Address += VOS_MSG_BLK_HEAD_LEN; pMsg = (MSG_CB *)Msg_Address; iThePid = pMsg->ulReceiverPid; if(iThePid >= VOS_PID_BUTT) { LogPrint("# vos_FidTask Pid too big.\r\n"); pulMsgAddr = (VOS_UINT32 *)pMsg; LogPrint4("# Msg :S pid %08X R Pid %08X Length %08X Name %08X.\r\n", *(pulMsgAddr + 1), *(pulMsgAddr + 3), *(pulMsgAddr + 4), *(pulMsgAddr + 5)); VOS_FreeMsg( iThePid, pMsg ); continue; } if( FID_value == vos_PidRecords[iThePid-VOS_PID_DOPRAEND].Fid ) { if ( VOS_NULL_PTR != vos_MsgHook ) { (vos_MsgHook)(pMsg); } (vos_PidRecords[iThePid-VOS_PID_DOPRAEND].MsgFunction)(pMsg); } else { LogPrint("# vos_FidTask Pid not belong the Fid.\r\n"); pulMsgAddr = (VOS_UINT32 *)pMsg; LogPrint4("# Msg :S pid %08X R Pid %08X Length %08X Name %08X.\r\n", *(pulMsgAddr + 1), *(pulMsgAddr + 3), *(pulMsgAddr + 4), *(pulMsgAddr + 5)); } VOS_FreeMsg( iThePid, pMsg ); } }