亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? endnetbuflib.c

?? INTEL IXP425的VXWORKS BSP
?? C
?? 第 1 頁 / 共 2 頁
字號:
    int 		num,		/* number of units to allocate */    int			unitSize,	/* size of each unit */    int			headerSize,	/* hidden header size */    char *		memArea		/* pre allocated memory area */    )    {    if (((int) unitSize & ~(sizeof (void *) - 1)) != unitSize )        {        errno = S_netBufLib_MEMSIZE_UNALIGNED;        return (ERROR);				/* unaligned size */        }    unitSize += headerSize;		/* adjust for NET_POOL_ID */    if (memArea == NULL)        {        errno = S_netBufLib_MEMAREA_INVALID;        return (ERROR);        }    if (((int) memArea & ~(sizeof (void *) - 1)) != (int)memArea )        {        errno = S_netBufLib_MEM_UNALIGNED;        return (ERROR);				/* unaligned memory */        }    bzero ((char *)memArea, (num * unitSize));    return (OK);    }/********************************************************************************* _endMBlkFree - free the given mBlk** This function frees the given mBlk and returns it to the mBlk pool.** RETURNS: N/A** NOMANUAL*/LOCAL void _endMBlkFree    (    NET_POOL_ID		pNetPool,	/* pointer to the net pool */    M_BLK_ID	 	pMblk		/* mBlk to free */    )    {    FAST int		ms;    pMblk->mBlkHdr.mNextPkt 	= NULL;    ms = intLock ();    pNetPool->pPoolStat->mTypes [pMblk->mBlkHdr.mType]--;    pNetPool->pPoolStat->mTypes [MT_FREE]++;    pMblk->mBlkHdr.mType 	= MT_FREE;    pMblk->mBlkHdr.mNext 	= pNetPool->pmBlkHead;    pNetPool->pmBlkHead 	= pMblk; /* add the mbuf to the free list */    intUnlock (ms);    }/********************************************************************************* _endClBlkFree - free the given cluster Blk** This function frees the given clBlk and returns it to the cluster Blk pool.** RETURNS: N/A** NOMANUAL*/LOCAL void _endClBlkFree    (    CL_BLK_ID	 	pClBlk		/* clBlk to free */    )    {    FAST int		level;    CL_BUF_ID		pClBuf;    NET_POOL_ID		pNetPool;	/* pointer to the net pool */        pNetPool = pClBlk->pNetPool;    pClBuf   = (CL_BUF_ID)pClBlk->clNode.pClBuf;    level = intLock ();			/* lock interrupts briefly */    if (pClBuf == NULL)			/* no cluster attached */        goto returnClBlk;    else if (--(pClBlk->clRefCnt) == 0)        {        if (pClBlk->pClFreeRtn != NULL)            {	/* call the free routine if associated with one */            intUnlock (level); 	    (*pClBlk->pClFreeRtn) (pClBlk->clFreeArg1, pClBlk->clFreeArg2,                                   pClBlk->clFreeArg3);            level = intLock ();            }        else            {            _endClFree (pNetPool, (char *)pClBuf);	    }        goto returnClBlk;	}    else        goto clBlkFreeEnd;    returnClBlk:    /* free the cluster blk and add it to the free list */    pClBlk->clNode.pClBlkNext 	= pNetPool->pClBlkHead;    pNetPool->pClBlkHead 	= pClBlk;    clBlkFreeEnd:    intUnlock (level);    }/********************************************************************************* _endClFree - free a  cluster of a given size.** This function frees a cluster of given size in a net pool** RETURNS: N/A** NOMANUAL*/LOCAL void _endClFree    (    NET_POOL_ID		pNetPool,	/* pointer to the net pool */    char * 		pClBuf		/* pointer to the cluster buffer */    )    {    FAST int		level;    END_CL_POOL *       pEndClPool;    pEndClPool = (END_CL_POOL *)pNetPool->clTbl[0];     level = intLock ();    if (pEndClPool->clPool.clNumFree < pEndClPool->clPool.clNum)        {        pEndClPool->clPool.clNumFree++;        pEndClPool->clFreeArray[pEndClPool->clPool.clNumFree] = (UINT32)pClBuf;        }    intUnlock (level);    }/********************************************************************************* _endMBlkClFree - free an mBlk/cluster pair.** This function frees a mBlk/cluster pair.  This function returns a pointer* to the next mBlk which is connected to the current one.  This routine will* free the cluster only if it is attached to the mBlk.** RETURNS: M_BLK_ID or NULL.** NOMANUAL*/LOCAL M_BLK_ID _endMBlkClFree    (    NET_POOL_ID		pNetPool,	/* pointer to net pool */    M_BLK_ID 		pMblk		/* pointer to the mBlk */    )    {    M_BLK_ID		pMblkNext;	/* pointer to the next mBlk */    if (pMblk->mBlkHdr.mType == MT_FREE)        {#ifdef NETBUF_DEBUG        logMsg ("mBlkClFree -- Invalid mBlk\n", 0, 0, 0, 0, 0, 0);#endif /* NETBUF_DEBUG */        errno = S_netBufLib_MBLK_INVALID;        return (NULL);        }    pMblkNext = pMblk->mBlkHdr.mNext;    /* free the cluster first if it is attached to the mBlk */    if (M_HASCL(pMblk))        netClBlkFree (pMblk->pClBlk->pNetPool, pMblk->pClBlk);    _endMBlkFree (pNetPool, pMblk); 		/* free the mBlk */    return (pMblkNext);    }/********************************************************************************* _endMBlkGet - get a free mBlk** This routine returns a free mBlk if one is available. If the <canWait>* parameter is set to M_WAIT and an mBlk is not immediately available, the* routine repeats the allocation attempt after calling any installed garbage* collection routine.** RETURNS: M_BLK_ID or NULL if none available** NOMANUAL*/LOCAL M_BLK_ID _endMBlkGet    (    NET_POOL_ID		pNetPool,	/* pointer to the net pool */    int			canWait,	/* M_WAIT/M_DONTWAIT */    UCHAR		type		/* mBlk type */    )    {    M_BLK_ID	 	pMblk = NULL;	/* pointer to mbuf */    int 		level;		/* level of interrupt */    reTry:    level = intLock();			/* lock interrupts very briefly */    if ((pMblk = pNetPool->pmBlkHead) != NULL)        {        pNetPool->pmBlkHead = pMblk->mBlkHdr.mNext;        pNetPool->pPoolStat->mTypes [MT_FREE]--;        pNetPool->pPoolStat->mTypes [type]++;        intUnlock (level); 			/* unlock interrupts */        if (pMblk->mBlkHdr.mType != MT_FREE)            {#ifdef NETBUF_DEBUG            logMsg("mBlkGet free error:\n", 0, 0, 0, 0, 0, 0);#endif /* NETBUF_DEBUG */            errno = S_netBufLib_MBLK_INVALID;            return (NULL);            }        pMblk->mBlkHdr.mType	= type;        pMblk->mBlkHdr.mNext 	= NULL;        pMblk->mBlkHdr.mNextPkt = NULL;        pMblk->mBlkHdr.mFlags 	= 0;        }    else /* if (canWait != M_ISR) */        {        if (canWait == M_WAIT)            {            if (_pNetBufCollect)                {                intUnlock (level);			/* unlock interrupts */                (*_pNetBufCollect) (pNetPool->pPoolStat);		canWait = M_DONTWAIT;                goto reTry;                }            }        pNetPool->pPoolStat->mDrops++;        intUnlock (level);	errnoSet (S_netBufLib_NO_POOL_MEMORY);        }    return (pMblk);    }/********************************************************************************* _endClBlkGet - get a free clBlk** This routine returns a free clBlk if one is available. If the <canWait>* parameter is set to M_WAIT and a clBlk is not immediately available, the* routine repeats the allocation attempt after calling any installed garbage* collection routine.** RETURNS: CL_BLK_ID or NULL.** NOMANUAL*/LOCAL CL_BLK_ID _endClBlkGet    (    NET_POOL_ID		pNetPool,	/* pointer to the net pool */    int			canWait		/* M_WAIT/M_DONTWAIT */    )    {    CL_BLK_ID	 	pClBlk = NULL;	/* pointer to mbuf */    int 		level;		/* level of interrupt */    reTry:    level = intLock();			/* lock interrupts very briefly */    if ((pClBlk = pNetPool->pClBlkHead) != NULL)        {        pNetPool->pClBlkHead = pClBlk->clNode.pClBlkNext;        intUnlock (level); 			/* unlock interrupts */        pClBlk->clNode.pClBuf = NULL;        pClBlk->pClFreeRtn    = NULL;        pClBlk->clRefCnt      = 0;        pClBlk->pNetPool      = pNetPool; 	/* netPool originator */        }    else /* if (canWait != M_ISR) */        {        if (canWait == M_WAIT)            {            if (_pNetBufCollect)                {                intUnlock (level);			/* unlock interrupts */                (*_pNetBufCollect) (pNetPool->pPoolStat);		canWait = M_DONTWAIT;                goto reTry;                }            }        intUnlock (level);       	errnoSet (S_netBufLib_NO_POOL_MEMORY);	}    return (pClBlk);    }/********************************************************************************* _endClusterGet - get a new cluster of a given cluster pool.** This function returns a cluster given a pool pointer.  The reference count* for the cluster is incremented.** RETURNS: pointer to a cluster or NULL** NOMANUAL*/LOCAL char * _endClusterGet    (    NET_POOL_ID		pNetPool,	/* pointer to the net pool */    CL_POOL_ID 		pClPool 	/* ptr to the cluster pool */    )    {    int		  level;			/* level of interrupt */    CL_BUF_ID	  pClBuf;			/* ptr to the cluster buffer */    END_CL_POOL * pEndClPool;    pEndClPool = (END_CL_POOL *)pClPool;    level = intLock (); 			/* lock interrupts briefly */    if (pClPool->clNumFree > 0)        {        pClBuf = (CL_BUF_ID)pEndClPool->clFreeArray[pClPool->clNumFree];        pClPool->clNumFree--;        }    else        {        intUnlock (level);        return (NULL);        }    pClPool->clUsage++;				/* increment the usage count */    intUnlock (level);    return ((char *)pClBuf);    }/********************************************************************************* endMClGet - get a new mBlk/cluster pair.** This function gets a free cluster from the NET_POOL and joins it with* the mBlk passed to it.  An mBlk must be pre allocated and passed to this* function.** RETURNS: OK or ERROR.** NOMANUAL*/LOCAL STATUS _endMClGet    (    NET_POOL_ID		pNetPool,	/* pointer to the net pool */    M_BLK_ID	 	pMblk, 		/* mBlk to embed the cluster in */    int			bufSize,	/* size of the buffer to get */    int			canWait,	/* wait or dontwait */    BOOL		bestFit		/* TRUE/FALSE */    )    {    CL_BUF_ID		pClBuf = NULL; 	/* pointer to the cluster buffer */    CL_BLK_ID		pClBlk = NULL; 	/* pointer to the cluster blk */    FAST int 		ms; 		/* integer for level */    END_CL_POOL *       pEndClPool;    /* check pMblk */    if ((pMblk == NULL) || ((pClBlk = _endClBlkGet (pNetPool, canWait)) == NULL))	goto mClGetError;    /* get the pool pointer */    if ((pEndClPool = (END_CL_POOL *)pNetPool->clTbl [0]) == NULL)	{#ifdef NETBUF_DEBUG	logMsg ("endMClGet: Invalid cluster type\n", 0, 0, 0, 0, 0, 0);#endif /* NETBUF_DEBUG */        errno = S_netBufLib_CLSIZE_INVALID;	goto mClGetError;	}        reTry:    ms = intLock(); 			/* lock interrupts briefly */       if (pEndClPool->clPool.clNumFree == 0)        {        if (canWait == M_WAIT)	/* want for buffers */            {            if (_pNetBufCollect)                {                intUnlock (ms);                (*_pNetBufCollect) (pNetPool->pPoolStat);		canWait = M_DONTWAIT;                goto reTry;                }            }        }     if ((pClBuf =(CL_BUF_ID) _endClusterGet(pNetPool,                                              (CL_POOL_ID)pEndClPool)) != NULL)        intUnlock (ms);    else	{	pNetPool->pPoolStat->mDrops++;	/* no. times failed to find space */        intUnlock (ms);	errnoSet (S_netBufLib_NO_POOL_MEMORY);	goto mClGetError;	}    pMblk->mBlkHdr.mData  = (caddr_t) pClBuf;    pMblk->mBlkHdr.mFlags |= M_EXT;    pClBlk->clNode.pClBuf = (caddr_t) pClBuf;    pClBlk->clSize	  = pEndClPool->clPool.clSize;    pClBlk->pClFreeRtn	  = NULL;    pClBlk->clRefCnt	  = 1;    pMblk->pClBlk 	  = pClBlk;    return (OK); 		/* return OK */    mClGetError:    if (pClBlk != NULL)        _endClBlkFree (pClBlk);    return (ERROR); 		/* return ERROR */    }/********************************************************************************* endClPoolIdGet - return a pool Id for a given cluster Size** This function returns a poolID for a given cluster Size.* If this returns NULL then the corresponding pool has not been initialized.** RETURNS: CL_POOL_ID or NULL.** NOMANUAL*/LOCAL CL_POOL_ID _endClPoolIdGet    (    NET_POOL_ID		pNetPool,	/* pointer to the net pool */    int 		bufSize,	/* size of the buffer */    BOOL		bestFit		/* TRUE/FALSE */    )    {    return (pNetPool->clTbl [0]);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看亚洲a| 久久久夜色精品亚洲| 91精品国产综合久久精品麻豆| 日韩午夜激情免费电影| 国产精品福利影院| 精品一区中文字幕| 欧美图片一区二区三区| 国产精品久久久久久户外露出| 久久精品久久99精品久久| 在线观看视频一区二区欧美日韩| 337p日本欧洲亚洲大胆色噜噜| 亚洲黄色片在线观看| 国产精品2024| 亚洲精品一区二区三区精华液| 亚洲国产精品精华液网站 | 一区二区免费视频| 国产一区二区免费视频| 欧美卡1卡2卡| 樱桃视频在线观看一区| 粗大黑人巨茎大战欧美成人| 精品黑人一区二区三区久久| 日韩制服丝袜av| 色播五月激情综合网| 亚洲欧美怡红院| 懂色av一区二区夜夜嗨| 欧美精品一区二区三区在线 | 免费在线观看日韩欧美| 欧美日韩成人综合在线一区二区| 综合色天天鬼久久鬼色| 97精品电影院| 亚洲另类中文字| 色悠悠久久综合| 亚洲视频一区在线观看| jlzzjlzz亚洲日本少妇| 国产精品国产成人国产三级| 97久久超碰精品国产| 亚洲精选视频免费看| 色综合久久88色综合天天免费| 日韩一区日韩二区| 91啪亚洲精品| 亚洲主播在线观看| 欧美欧美午夜aⅴ在线观看| 舔着乳尖日韩一区| 欧美三级三级三级爽爽爽| 日本在线不卡一区| 欧美va日韩va| 国产精品一区二区三区网站| 欧美激情在线免费观看| 91香蕉视频mp4| 亚洲成人免费av| 日韩欧美色综合| 丁香亚洲综合激情啪啪综合| 国产精品久久看| 色欧美片视频在线观看在线视频| 亚洲午夜免费福利视频| 91精品欧美综合在线观看最新| 老司机精品视频线观看86| 久久免费精品国产久精品久久久久| 国产盗摄一区二区| 亚洲免费观看高清完整版在线观看| 日韩欧美电影在线| 国内精品在线播放| 中文字幕中文在线不卡住| 在线免费观看日本一区| 日韩电影在线看| 国产亚洲女人久久久久毛片| 91在线精品秘密一区二区| 五月激情综合色| 国产欧美日韩在线观看| 欧美色涩在线第一页| 美女网站一区二区| 中文字幕在线免费不卡| 7777精品伊人久久久大香线蕉的| 国产成人精品免费一区二区| 亚洲www啪成人一区二区麻豆| 亚洲在线视频一区| 精品国产一区久久| 色呦呦日韩精品| 国产一区二三区| 一区二区三区电影在线播| 久久综合久久综合久久| 欧美性猛片aaaaaaa做受| 极品尤物av久久免费看| 亚洲一区在线观看视频| 国产精品私人影院| 日韩欧美一二区| 欧美色网一区二区| 91视频免费看| 韩国av一区二区三区四区| 亚洲一线二线三线视频| 中文字幕精品三区| 久久久精品综合| 欧美一级日韩免费不卡| 在线观看国产日韩| 91影院在线免费观看| 国内精品久久久久影院色| 性欧美大战久久久久久久久| 中文字幕在线不卡视频| 国产亚洲午夜高清国产拍精品| 这里只有精品免费| 欧美日韩国产小视频在线观看| 97se狠狠狠综合亚洲狠狠| 国v精品久久久网| 国内精品久久久久影院一蜜桃| 青娱乐精品视频| 亚瑟在线精品视频| 一区二区三区日韩欧美| 亚洲色图欧美偷拍| 亚洲免费观看高清完整版在线 | 欧美久久久久久蜜桃| 91在线视频播放地址| 国产成a人无v码亚洲福利| 韩国女主播一区| 久久国产欧美日韩精品| 久久精品国产精品亚洲精品| 奇米精品一区二区三区在线观看一| 夜夜嗨av一区二区三区网页| 亚洲精选免费视频| 亚洲一区二区三区视频在线播放 | 91啪九色porn原创视频在线观看| 成人午夜激情在线| 国产不卡一区视频| eeuss鲁一区二区三区| 成人激情开心网| 色综合一区二区| 天天色 色综合| 日韩综合小视频| 青青草成人在线观看| 日本中文字幕一区二区视频| 久久国产精品99久久人人澡| 狠狠色丁香久久婷婷综| 国产99久久久久久免费看农村| 成人午夜伦理影院| 一本久久综合亚洲鲁鲁五月天| 在线看一区二区| 欧美偷拍一区二区| 欧美草草影院在线视频| 国产日产欧美一区二区三区| 国产精品理伦片| 亚洲黄色片在线观看| 日韩电影免费在线看| 精彩视频一区二区三区| 成人激情av网| 欧美人妖巨大在线| 精品成人私密视频| 成人欧美一区二区三区1314| 亚洲国产精品尤物yw在线观看| 久久精品久久精品| 97久久人人超碰| 日韩欧美中文字幕公布| 国产精品欧美综合在线| 亚洲电影你懂得| 国产精品91一区二区| 欧美日韩亚洲国产综合| 久久久不卡影院| 亚洲国产日韩一区二区| 国产不卡视频在线观看| 69堂精品视频| 中文字幕中文在线不卡住| 日日夜夜免费精品| 北条麻妃国产九九精品视频| 欧美精品一级二级| 中文字幕一区二区三区四区| 天天av天天翘天天综合网色鬼国产| 久久国产夜色精品鲁鲁99| 91国模大尺度私拍在线视频| www久久久久| 日韩精品三区四区| 99久久精品费精品国产一区二区| 日韩一区二区免费高清| 亚洲精品写真福利| 国产成人精品www牛牛影视| 欧美日韩一区国产| 亚洲色图视频网| 国产美女娇喘av呻吟久久| 欧美一区中文字幕| 夜夜嗨av一区二区三区中文字幕 | 麻豆91在线观看| 91久久奴性调教| 日本一区二区三区免费乱视频 | 欧美videos大乳护士334| 亚洲国产日韩精品| 91在线观看高清| 国产精品毛片a∨一区二区三区| 久久99精品国产麻豆婷婷洗澡| 欧美自拍丝袜亚洲| 亚洲男同性恋视频| caoporn国产精品| 国产欧美日韩精品一区| 国产一区二区三区四| 精品少妇一区二区三区在线视频| 天天免费综合色| 欧美精品丝袜中出| 五月天激情小说综合| 欧美日韩一区二区电影| 亚洲一区二区三区影院| 在线视频综合导航| 一区二区在线电影| 91福利视频在线| 亚洲一二三四久久|