VOS_UINT32 diag_BufCtrlGlobalInit(VOS_VOID)
{
    VOS_UINT32 ret = ERR_MSP_SUCCESS;
    VOS_UINT32 i = 0;
	VOS_INT32 aulLen[DIAG_CODER_SRC_TYPE_BUTT] = {0,};
#ifndef CHIP_BB_HI6210
    BSP_DDR_SECT_QUERY_S stSectQuery = {};
    BSP_DDR_SECT_INFO_S stSectInfo = {};
#endif
    /* 创建 控制LOG上报的信号量,第二个参数1表示一开始能take到信号量,不需等待,0表示一开始take不到*/
    ret = VOS_SmBCreate(NULL, 1, VOS_SEMA4_FIFO,&g_DiagLogSem);
    if (ERR_MSP_SUCCESS != ret)
    {
    	diag_printf("[%s]:VOS_SmBCreate fail!\n",__FUNCTION__);
        return ret;
    }
#ifndef CHIP_BB_HI6210
    stSectQuery.enSectType = BSP_DDR_SECT_TYPE_SOCP;

    mdrv_get_fix_ddr_addr(&stSectQuery, &stSectInfo);

    g_DiagMemVirt = stSectInfo.pSectVirtAddr;
    g_DiagMemPhy = stSectInfo.pSectPhysAddr;
    g_DiagMemSize = stSectInfo.ulSectSize;
#else
    /*lint -save -e40 -e539*/
#ifdef DIAG_MEMMAP
	g_DiagMemVirt = (VOS_UINT8*)MSP_NOCACHEMAP(DIAG_MEM_ADDR_BASE,DIAG_MEM_TOTAL_SIZE);
#else
	g_DiagMemVirt = (VOS_UINT8*)SOCP_GLOBAL_MEM_ADDR_VIRT;
#endif
    /*lint -restore*/
#endif
    diag_GetBufLen((VOS_UINT32 *)aulLen);

    /* 创建log发送缓冲区 */
    for(i = 0 ; i< DIAG_CODER_SRC_TYPE_BUTT; i++)
    {
        if (VOS_OK != diag_CreateLogBuf(&g_stDiagBufCtrl[i], aulLen[i]))
        {
            diag_printf("diag_BufCtrlGlobalInit:diag_CreateLogBuffer Failed!\n");
            return ERR_MSP_FAILURE;
        }
    }

#if ((VOS_OS_VER == VOS_VXWORKS) || (VOS_OS_VER == VOS_RTOSCK))
    /*lint -save -e539*/
	diag_InitSocpChan();
    /*lint -restore */
#endif
    return ret;
}
VOS_UINT32 diag_BufCtrlGlobalInit(VOS_VOID)
{
    VOS_UINT32 ret = ERR_MSP_SUCCESS;
    VOS_UINT32 i = 0;
	VOS_INT32 aulLen[DIAG_CODER_SRC_TYPE_BUTT] = {0,};

    /* 创建 控制LOG上报的信号量,第二个参数1表示一开始能take到信号量,不需等待,0表示一开始take不到*/
    ret = VOS_SmBCreate(NULL, 1, VOS_SEMA4_FIFO,&g_DiagLogSem);
    /*lint -save -e830*/
    if (ERR_MSP_SUCCESS != ret)
    {
    	diag_printf("[%s]:VOS_SmBCreate fail!\n",__FUNCTION__);
        return ret;
    }
    /*lint -restore*/

#ifdef DIAG_MEMMAP
    g_DiagMemVirt = (VOS_UINT8*)MSP_NOCACHEMAP(DIAG_MEM_ADDR_BASE,DIAG_MEM_TOTAL_SIZE);
#else
    g_DiagMemVirt = (VOS_UINT8*)SOCP_GLOBAL_MEM_ADDR_VIRT;
#endif

    diag_GetBufLen((VOS_UINT32 *)aulLen);
    /*lint -save -e830*/
    /* 创建log发送缓冲区 */
    for(i = 0 ; i< DIAG_CODER_SRC_TYPE_BUTT; i++)
    {
        if (VOS_OK != diag_CreateLogBuf(&g_stDiagBufCtrl[i], aulLen[i]))
        {
            diag_printf("diag_BufCtrlGlobalInit:diag_CreateLogBuffer Failed!\n");
            return ERR_MSP_FAILURE;
        }
    }
    /*lint -restore*/
#if ((VOS_OS_VER == VOS_VXWORKS) || (VOS_OS_VER == VOS_RTOSCK))
    diag_InitSocpChan();
#endif
    return ret;
}