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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? zbuflib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* zbufLib.c - zbuf interface library *//* Copyright 1984 - 2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01h,07may02,kbw  man page edits01g,15oct01,rae  merge from truestack ver 01g, base 01f (AE / 5_X)01f,26jan95,jdi  format tweak.01e,24jan95,rhp  revisions based on jdi feedback01d,16jan95,rhp  fix SEE ALSO subroutine ref format01c,15nov94,dzb  doc tweaks.01b,09nov94,rhp  library man page added, subroutine man pages edited.01a,08nov94,dzb  written.*//*DESCRIPTIONThis library contains routines to create, build, manipulate, anddelete zbufs.  Zbufs, also known as "zero copy buffers," are a dataabstraction designed to allow software modules to share bufferswithout unnecessarily copying data.To support the data abstraction, the subroutines in this library hidethe implementation details of zbufs.  This also maintains thelibrary's independence from any particular implementation mechanism,thus permitting the zbuf interface to be used with other buffering schemes.Zbufs have three essential properties.  First, a zbuf holds asequence of bytes.  Second, these bytes are organized into one or moresegments of contiguous data, although the successive segmentsthemselves are not usually contiguous.  Third, the data within asegment may be shared with other segments; that is, the data may be in useby more than one zbuf at a time.ZBUF TYPESThe following data types are used in managing zbufs:.iP ZBUF_ID 16 3An arbitrary (but unique) integer that identifies a particular zbuf..iP ZBUF_SEGAn arbitrary (but unique within a single zbuf) integer that identifiesa segment within a zbuf..LPADDRESSING BYTES IN ZBUFSThe bytes in a zbuf are addressed by the combination <zbufSeg>,<offset>.  The <offset> may be positive or negative, and is simply thenumber of bytes from the beginning of the segment <zbufSeg>.A <zbufSeg> can be specified as NULL, to identify the segment at thebeginning of a zbuf.  If <zbufseg> is NULL, <offset> is theabsolute offset to any byte in the zbuf.  However, it is moreefficient to identify a zbuf byte location relative to the <zbufSeg>that contains it; see zbufSegFind() to convert any <zbufSeg>, <offset>pair to the most efficient equivalent.Negative <offset> values always refer to bytes before thecorresponding <zbufSeg>, and are not usually the most efficientaddress formulation (though using them may save yourprogram other work in some cases).The following special <offset> values, defined as constants,allow you to specify the very beginning or the very end of an entire zbuf,regardless of the <zbufSeg> value:.iP ZBUF_BEGIN 16 3The beginning of the entire zbuf..iP ZBUF_ENDThe end of the entire zbuf (useful for appending to a zbuf; see below)..LPINSERTION AND LIMITS ON OFFSETSAn <offset> is not valid if it points outside the zbuf.  Thus, toaddress data currently within an N-byte zbuf, the valid offsetsrelative to the first segment are 0 through N-1.Insertion routines are a special case: they obey the usualconvention, but they use <offset> to specify where the new databegins after the insertion is complete.  Therefore, the originalzbuf data is always inserted just before the bytelocation addressed by the <offset> value.  The value of thisconvention is that it permits inserting (or concatenating) data eitherbefore or after the existing data.  To insert before all the datacurrently in a zbuf segment, use 0 as <offset>.  To insert after allthe data in an N-byte segment, use N as <offset>. An <offset> of N-1inserts the data just before the last byte in an N-byte segment.An <offset> of 0 is always a valid insertion point; for an empty zbuf,0 is the only valid <offset> (and NULL the only valid <zbufSeg>).SHARING DATAThe routines in this library avoid copying segment data wheneverpossible.  Thus, by passing and manipulating ZBUF_IDs rather thancopying data, multiple programs can communicate with greaterefficiency.  However, each program must be aware of data sharing:changes to the data in a zbuf segment are visible to all zbuf segmentsthat reference the data.To alter your own program's view of zbuf data without affecting otherprograms, first use zbufDup() to make a new zbuf; then you can use aninsertion or deletion routine, such as zbufInsertBuf(), to add asegment that only your program sees (until you pass a zbuf containingit to another program).  It is safest to do all direct datamanipulation in a private buffer, before enrolling it in a zbuf: inprinciple, you should regard all zbuf segment data as shared.Once a data buffer is enrolled in a zbuf segment, the zbuf library isresponsible for noticing when the buffer is no longer in use by anyprogram, and freeing it.  To support this, zbufInsertBuf() requiresthat you specify a callback to a free routine each time you build azbuf segment around an existing buffer.  You can use this callback to notifyyour application when a data buffer is no longer in use.VXWORKS AE PROTECTION DOMAINSUnder VxWorks AE, this feature is restricted to the kernel protection domain.  This restriction does not apply under non-AE versions of VxWorks.  To use this feature, include the following component:INCLUDE_ZBUF_SOCKSEE ALSOzbufSockLibINTERNALExtensions:zbufJoin (zbufId, zbufSeg) - coalesce two adjacent segment fragments    This routine combines two or more contiguous zbuf segments into a single    zbuf segment.  Such an operation is only feasible for joining segments    that have the same freeRtn and freeArg, and that follow eachother in    the zbuf.  This could be useful for coalescing zbuf segments fragmented    by split operations.zbufOwn (zbufId, zbufSeg, offset, len) - own a local copy of zbuf data    This routine makes a local copy of a portion of a zbuf.  This    is useful if you want to change the actual data in a zbuf, but want to    make sure that you are not corrupting another zbuf that shares the    same data.  If you are the only zbuf segment using a particular buffer,    this routine does nothing.  If other zbufs reference the same data, this    routine inserts a copy of the requested data, then deletes reference    to the original data.*//* includes */#include "vxWorks.h"#include "zbufLib.h"#include "stdlib.h"#include "memPartLib.h"/* locals *//* * N.B. * As other back-ends to zbuf are ever developed, and need to be run * concurrently with existing back-ends, the zbufFunc table needs to have * the back-end resident function table pointer in the ZBUF_ID.  This will * require a modification to the current method of simply passing through * the ZBUF_ID to the back-end.  Instead, the ZBUF_ID will have to point * to a structure, which would contain the back-end function table pointer * and a back-end-specific XX_ID pointer. */LOCAL ZBUF_FUNC		zbufFuncNull =	/* null funcs for unconnected zbufs */    {    NULL,				/* zbufCreate()		*/    NULL,				/* zbufDelete()		*/    NULL,				/* zbufInsert()		*/    NULL,				/* zbufInsertBuf()	*/    NULL,				/* zbufInsertCopy()	*/    NULL,				/* zbufExtractCopy()	*/    NULL,				/* zbufCut()		*/    NULL,				/* zbufSplit()		*/    NULL,				/* zbufDup()		*/    NULL,				/* zbufLength()		*/    NULL,				/* zbufSegFind()	*/    NULL,				/* zbufSegNext()	*/    NULL,				/* zbufSegPrev()	*/    NULL,				/* zbufSegData()	*/    NULL				/* zbufSegLength()	*/    };LOCAL ZBUF_FUNC *	pZbufFunc = &zbufFuncNull;/********************************************************************************* zbufLibInit - initialize the zbuf interface library** This routine initializes the zbuf interface facility.  It* must be called before any zbuf routines are used.  This routine is* typically called during the initialization of a VxWorks facility which* uses or extends the zbuf interface, although this is not a requirement.* The zbuf library may be used on its own, provided an appropriate back-end* buffer mechanism is available, and is specified by <libInitRtn>.** RETURNS:* OK, or ERROR if the zbuf interface cannot be initialized.** NOMANUAL*/STATUS zbufLibInit    (    FUNCPTR		libInitRtn	/* back-end buffer mechanism init rtn */    )    {    ZBUF_FUNC *		pZbufFuncTemp;	/* temp return of back-end func table */    /* call the back-end initialization routine - watch for NULL func ptr */    if ((libInitRtn == NULL) || ((pZbufFuncTemp =	(ZBUF_FUNC *) (libInitRtn) ()) == NULL))	return (ERROR);    pZbufFunc = pZbufFuncTemp;			/* connect back-end func tbl */    return (OK);    }#if	FALSE		/* Pool routines not in service yet *//********************************************************************************* zbufSegPoolCreate - create an empty zbuf segment pool** This routine creates a zbuf segment pool.  It remains empty (that is, does* not contain any free segments) until segments are added by calling* zbufSegPoolAdd().  Operations performed on zbuf segments pools require* a zbuf segment pool ID, which is returned by this routine.** RETURNS:* A zbuf segment pool ID, or NULL if an ID cannot be created.** SEE ALSO: zbufSegPoolDelete(), zbufSegPoolAdd()** NOMANUAL*/ZBUF_POOL_ID zbufSegPoolCreate (void)    {    ZBUF_POOL_ID	zbufPoolId;		/* new ID */        if ((zbufPoolId = (ZBUF_POOL_ID) KHEAP_ALLOC(sizeof(struct zbufPoolId))) ==	NULL)	return (NULL);				/* malloc pool ID struct */    /* create mutex sem for guarding access to zbuf segment pool */    if ((zbufPoolId->poolSem = semMCreate ((SEM_Q_PRIORITY |	SEM_INVERSION_SAFE | SEM_DELETE_SAFE))) == ERROR)	{	KHEAP_FREE(zbufPoolId);			/* free resources */	return (NULL);	}    /* create binary sem for waiting for free segments to come into pool */    if ((zbufPoolId->waitSem = semBCreate (SEM_Q_PRIORITY, SEM_EMPTY)) == ERROR)	{        semDelete (zbufPoolId->poolSem);	/* free resources */	KHEAP_FREE(zbufPoolId);	return (NULL);	}    zbufPoolId->use = 0;			/* no loaned buffers yet */    zbufPoolId->blockHead = NULL;		/* no blocks/segs yet */    return (zbufPoolId);    }/********************************************************************************* zbufSegPoolDelete - delete a zbuf segment pool and free associated segments** This routine will free any segments associated with <zbufPoolId>,* then delete the zbuf segment pool ID itself.  To do this, all segments* must be in the pool (that is, no segments may currently be part of a zbuf).* <zbufPoolId> must not be used after this routine executes successfully.** Associated segments will be returned to the system memory pool if they* were allocated with zbufSegPoolAdd().  No action will be taken upon* user segments added to the segment pool by specifying the segment block* start address. These segments should be considered free after this* routine executes successfully.* * RETURNS:* OK, or ERROR if the zbuf segment pool has outstanding segments.** SEE ALSO: zbufSegPoolCreate(), zbufSegPoolAdd()** NOMANUAL*/STATUS zbufSegPoolDelete    (    ZBUF_POOL_ID	zbufPoolId	/* zbuf segment pool to delete */    )    {    ZBUF_BLOCK_ID	zbufBlock;		/* ptr to block headers */    ZBUF_BLOCK_ID	zbufBlockTemp;		/* temp storage of block hdr */    /* obtain exclusive access to zbuf segment pool structures */    if ((semTake (zbufPoolId->poolSem, WAIT_FOREVER)) == ERROR)	return (ERROR);    if (zbufPoolId->use != 0)			/* any segments in use ? */	{	semGive (zbufPoolId->poolSem);		/* give up access */	return (ERROR);				/* cannot feee if in use */	}    /* go through list of block headers, freein all alloc'ed mem */    for (zbufBlock = zbufPoolId->blockHead; zbufBlock != NULL;)	{	zbufBlockTemp = zbufBlock->blockNext;		KHEAP_FREE(zbufBlock);			/* free each hdr & memory */        zbufBlock = zbufBlockTemp;		/* bump to next block hdr */        }    semDelete (zbufPoolId->waitSem);		/* free wait binary sem */    semDelete (zbufPoolId->poolSem);		/* free pool mutex sem */    KHEAP_FREE(zbufPoolId);			/* free actual pool ID struct */    return (OK);    }/********************************************************************************* zbufSegPoolAdd - add a block of zbuf segments to a zbuf segment pool** This routine adds a block of zbuf segments to <zbufPoolId>.  This routine* may be called multiple times to add segment blocks of different sizes and* numbers.** The segment size <segSise> will be rounded up to the memory allignment* requirements of the target architecture.  The minimum size of a* segment is the size of a void pointer.** If system memory is to be used for the segment allocation, set <blockStart>* to NULL, in which case <blockLength> parameter will be ignored.* Otherwise, a block of memory to be used may be specified by <blockStart> and* <blockLen>.  If a segment block is specified with <blockStart>, the* <segNum> parameter is ignored.  Instead, the number of alligned segments* that can be obtained from <memLength> are added to the pool.* * If a zbuf segment pool is deleted with zbufSegPoolDelete(), any allocated* segment blocks will be returned to the system memory pool.  Specific memory* blocks obtained through <blockStart> should be considered free after* zbufSegPoolDelete() executes successfully, but the user will not be* given any further indication of the memory being released from the pool.* * RETURNS:* OK, or ERROR if the zbuf segment block cannot be added to the pool.** SEE ALSO: zbufSegPoolDelete()** NOMANUAL*/STATUS zbufSegPoolAdd    (    ZBUF_POOL_ID	zbufPoolId,	/* pool to add zbuf segments to */    int			segSize,	/* size of new segments */    int			segNum,		/* number of new segs (system memory) */    caddr_t		blockStart,	/* start of seg block (user memory) */    int			blockLen	/* length of seg block (user memory) */    )    {    ZBUF_BLOCK_ID	zbufBlockNew;		/* new block header */    ZBUF_BLOCK_ID 	zbufBlock = NULL;	/* location to insert new hdr */    STATUS		status = ERROR;		/* return value */    int			ix;			/* counter for block init */    /* obtain exclusive access to zbuf segment pool structures */    if ((semTake (zbufPoolId->poolSem, WAIT_FOREVER)) == ERROR)	return (ERROR);    /* adjust segSize for mem allign - must be at least void * (see below) */    segSize = min (MEM_ROUND_UP(segSize), sizeof (void *));    if (blockStart == NULL)			/* if allocating from system */	{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
2023国产精华国产精品| 91麻豆精品一区二区三区| 九一九一国产精品| 久久精品国产网站| 精品免费国产一区二区三区四区| 日韩国产高清在线| 欧美一区二区高清| 国产精一区二区三区| 国产精品三级电影| 91国产成人在线| 日本欧美一区二区在线观看| 欧美一卡二卡三卡| 91精品国产综合久久久久久久久久 | 亚洲美女偷拍久久| 亚洲欧美中日韩| 亚洲欧美一区二区三区孕妇| 高清不卡一区二区| 中文字幕日韩欧美一区二区三区| 五月天一区二区| 欧美变态tickle挠乳网站| 国产福利一区二区| 一区二区三国产精华液| 91精品国产aⅴ一区二区| 国产一区二区视频在线| 日韩一区日韩二区| 欧美电影免费观看完整版| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 国产亚洲欧洲997久久综合| 一本一道久久a久久精品综合蜜臀| 亚洲一区二区三区爽爽爽爽爽| 欧美一区二区免费观在线| 粉嫩绯色av一区二区在线观看 | 五月激情丁香一区二区三区| 日韩免费性生活视频播放| 成人黄色国产精品网站大全在线免费观看| 亚洲黄色录像片| 久久久久成人黄色影片| 国产精品福利一区二区三区| 欧美精品一区二区久久婷婷| 不卡的av在线播放| 五月综合激情网| 欧美极品少妇xxxxⅹ高跟鞋| 男女视频一区二区| 中文字幕一区二区不卡| 国产suv精品一区二区6| 日韩一区二区三区观看| 欧美激情自拍偷拍| 国产呦精品一区二区三区网站| 67194成人在线观看| 日韩va欧美va亚洲va久久| 91免费版在线| 蜜桃视频在线观看一区| 在线精品视频一区二区三四| 精品一区二区在线播放| 婷婷久久综合九色综合绿巨人| 欧美国产欧美亚州国产日韩mv天天看完整| 这里是久久伊人| 色视频一区二区| av一二三不卡影片| 国产精品自拍毛片| 欧美午夜视频网站| 91视视频在线观看入口直接观看www| 久久99最新地址| 日韩成人av影视| 婷婷综合五月天| 亚洲精品免费在线| 综合av第一页| 中文字幕乱码亚洲精品一区| 精品国产凹凸成av人导航| 538prom精品视频线放| 欧美亚洲一区三区| 欧美在线色视频| 94-欧美-setu| 91亚洲午夜精品久久久久久| 韩国女主播一区| 久久电影网站中文字幕 | 这里只有精品视频在线观看| 91福利社在线观看| 91久久精品一区二区二区| 91一区二区三区在线观看| 国产剧情一区二区| 国产91色综合久久免费分享| 欧美日韩一区 二区 三区 久久精品 | 国产一区二区三区在线观看免费视频 | 日韩免费高清电影| 欧美一区二区日韩一区二区| 欧美一区日韩一区| 精品免费国产一区二区三区四区| 久久久精品tv| 97精品久久久久中文字幕| 色婷婷av一区二区三区gif| 91黄色免费看| 色香蕉成人二区免费| 丁香激情综合国产| 成人黄色片在线观看| 国产精品国产三级国产a| 精品剧情在线观看| 精品国产精品一区二区夜夜嗨| 久久精品国产在热久久| 伊人开心综合网| 亚洲一区二区三区影院| 午夜精品福利久久久| 精品一区二区三区免费观看| 国产精品一区二区91| 日本精品视频一区二区三区| 欧美精品视频www在线观看| 中文字幕一区二区三区在线不卡 | 日本一区二区三区在线观看| 国产精品久久久久久久久快鸭 | 亚洲精品老司机| 日韩国产一区二| 风流少妇一区二区| 91久久线看在观草草青青| 91精品国产入口在线| 国产三级欧美三级日产三级99| 最新日韩在线视频| 日本不卡一区二区三区| 国产不卡在线视频| 7777精品伊人久久久大香线蕉完整版 | 日本不卡中文字幕| 成人免费看视频| 欧美二区三区的天堂| 国产亚洲欧美日韩在线一区| 亚洲永久精品大片| 韩国女主播一区| 风间由美一区二区三区在线观看| 成人avav影音| 欧美一级二级三级蜜桃| 自拍视频在线观看一区二区| 欧美aaa在线| 91麻豆精东视频| 国产亚洲精品7777| 婷婷开心久久网| 日本韩国欧美一区| 久久婷婷一区二区三区| 亚洲va欧美va人人爽午夜| 一本大道久久a久久综合| 精品国产网站在线观看| 麻豆精品一区二区| 欧美日韩1区2区| 欧美日韩精品免费观看视频| 亚洲影视资源网| 91在线精品秘密一区二区| 国产色产综合色产在线视频| 日韩av一级片| 欧美日韩精品综合在线| 最近日韩中文字幕| 粉嫩av一区二区三区| 亚洲国产精品精华液2区45| 97精品久久久午夜一区二区三区| 香蕉加勒比综合久久| 亚洲国产综合色| a美女胸又www黄视频久久| 久久久久久久性| 麻豆精品一区二区综合av| 欧美日韩一二三| 亚洲一区欧美一区| 在线精品观看国产| 国产精品久久久久7777按摩| 国产精品自在在线| 久久久久9999亚洲精品| 国产乱国产乱300精品| 欧美成人激情免费网| 琪琪久久久久日韩精品| 欧美精品少妇一区二区三区| 视频一区二区不卡| 欧美精品v国产精品v日韩精品| 亚洲在线一区二区三区| 在线免费观看视频一区| 久久精品国产亚洲aⅴ| 欧美一区二区免费观在线| 日本不卡免费在线视频| 91精品久久久久久久91蜜桃| 日韩综合小视频| 日韩手机在线导航| 国产一区二区三区在线看麻豆| 2024国产精品视频| 国产91精品一区二区麻豆网站 | 欧美一区二区三区电影| 天天射综合影视| 91精品久久久久久久久99蜜臂| 久久精品国产网站| 中文字幕欧美日本乱码一线二线| 成人免费福利片| 亚洲精品久久久蜜桃| 欧美乱妇一区二区三区不卡视频| 美女脱光内衣内裤视频久久影院| 日韩视频在线观看一区二区| 国产一区二区福利视频| 最新中文字幕一区二区三区| 欧美三级视频在线| 亚洲欧美一区二区三区久本道91| 欧美疯狂做受xxxx富婆| 欧美tk—视频vk| 91在线观看美女| 亚洲精品国久久99热| 欧美日韩一区二区欧美激情| 韩国成人福利片在线播放| 国产精品色眯眯| 欧美探花视频资源|