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

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

?? msgqlib.c

?? VxWorks BSP框架源代碼包含頭文件和驅動
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* msgQLib.c - message queue library *//* Copyright 1990-2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02n,10dec01,bwa  Added comment about MSG_Q_EVENTSEND_ERR_NOTIFY msgQCreate                 option (SPR 72058).02m,26oct01,bwa  Added msgQEvLib and eventLib to the list of 'SEE ALSO'                 modules.02l,12oct01,cjj  Added documentation regarding S_eventLib_EVENTSEND_FAILED                 error02k,09oct01,gls  merged in 02j, 02i, 02h, 02g below from AE.02j,22feb01,ahm  ensured errno does'nt change if msgQDelete() is successful                 (SPR#34643)02i,19sep00,bwa  passed extra argument (msgQid) to calls to qJobGet()                 added errnoSet after calls to qJobGet()(SPR #34057) 02h,06sep00,aeg  doc: mentioned INCLUDE_MSG_Q component name.02g,11aug00,aeg  fixed updating of timeout stats in msgQSend/Receive (SPR 33683)02f,07sep01,bwa  Added VxWorks events support. Fixed SPR #31241 (corrected		 msgQReceive comment for NO_WAIT).02e,18dec00,pes  Correct compiler warnings02d,19may98,drm  merged code from 3rd party to add distributed message queue                  support.                 - merged code was originally based on version 02a 02c,11may98,cjtc fix problem with problem fix!! Multiple calls to object                 instrumentation in msgQDestroy02b,11may98,nps  fixed msgQDestroy instrumentation anomaly.02c,17apr98,rlp  canceled msgQInit and msgQSend modifications for backward                 compatibility.02b,04nov97,rlp  modified msgQInit and msgQSend for tracking messages sent.02a,24jun96,sbs  made windview instrumentation conditionally compiled01z,22oct95,jdi  doc: added bit values for options (SPR 4276).02d,14apr94,smb  fixed class dereferencing for instrumentation macros02c,15mar94,smb  modified instrumentation macros02b,24jan94,smb  added instrumentation macros02a,18jan94,smb  added instrumentation corrections for msgQDelete01z,10dec93,smb  added instrumentation01y,30jun93,jmm  changed msgQDestroy to look at msgQ as well as freeQ (spr 2070)01x,02feb93,jdi  documentation cleanup for 5.1.01w,13nov92,jcf  package init called with object creation.01v,19oct92,pme  added reference to shared message queue documentation.01u,23aug92,jcf  balanced taskSafe with taskUnsafe.01t,11aug92,jcf  fixed msgQDestroy safety problem.01s,30jul92,rrr  added restart and msgQ fix01r,29jul92,pme  added NULL function pointer check for smObj routines.01q,29jul92,jcf  package init called with object initialization.01p,22jul92,pme  made msgQDestroy return S_smObjLib_NO_OBJECT_DESTROY when		 trying to destroy a shared message queue.01o,19jul92,pme  added shared message queue support.01n,18jul92,smb  Changed errno.h to errnoLib.h.01m,04jul92,jcf	 show routine removed.01l,26may92,rrr  the tree shuffle01k,13dec91,gae  ANSI fixes.  01j,19nov91,rrr  shut up some ansi warnings.01i,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed includes to have absolute path from h/		  -changed VOID to void		  -changed copyright notice01h,10aug91,del  changed interface to qInit to pass all "optional" args.01g,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by dnw.01f,22jan91,jaa	 documentation.01e,08oct90,dnw  lint01d,01oct90,dnw  fixed bug of msgQSend() not returning ERROR on timeout.		 removed msgQSendArgs()/ReceiveArgs().		 reordered parameters of msgQ{Send,Receive}().		 simplified msgQInfoGet() interface.		 added msgQNumMsgs().		 made msgQDestroy() LOCAL.		 made msgQ{LibInit,Init,Terminate}() be NOMANUAL.		 finished documentation.01c,19jul90,dnw  added VARARGS to msgQ{Send,Receive}Args()01b,19jul90,dnw  changed call to objAlloc() to objAllocExtra()		 made msgQShow() prettier		 lint01a,10may90,dnw  written*//*DESCRIPTIONThis library contains routines  for creating and using message queues, the primary intertask communication mechanism within a single CPU.  Messagequeues allow a variable number of messages (varying in length) to bequeued in first-in-first-out (FIFO) order.  Any task or interrupt serviceroutine can send messages to a message queue.  Any task can receivemessages from a message queue.  Multiple tasks can send to and receivefrom the same message queue.  Full-duplex communication between two tasksgenerally requires two message queues, one for each direction.To provide message queue support for a system, VxWorks must be configuredwith the INCLUDE_MSG_Q component.CREATING AND USING MESSAGE QUEUESA message queue is created with msgQCreate().  Its parameters specify themaximum number of messages that can be queued to that message queue and the maximum length in bytes of each message.  Enough buffer space will be pre-allocated to accommodate the specified number of messages of specified length.A task or interrupt service routine sends a message to a message queuewith msgQSend().  If no tasks are waiting for messages on the message queue,the message is simply added to the buffer of messages for that queue.If any tasks are already waiting to receive a message from the messagequeue, the message is immediately delivered to the first waiting task.A task receives a message from a message queue with msgQReceive().If any messages are already available in the message queue's buffer,the first message is immediately dequeued and returned to the caller.If no messages are available, the calling task will block and be added toa queue of tasks waiting for messages.  This queue of waiting tasks canbe ordered either by task priority or FIFO, as specified in an optionparameter when the queue is created.TIMEOUTSBoth msgQSend() and msgQReceive() take timeout parameters.  When sending amessage, if no buffer space is available to queue the message, the timeoutspecifies how many ticks to wait for space to become available.  Whenreceiving a message, the timeout specifies how many ticks to wait if nomessage is immediately available.  The <timeout> parameter canhave the special values NO_WAIT (0) or WAIT_FOREVER (-1).  NO_WAIT means the routine should return immediately; WAIT_FOREVER means the routineshould never time out.URGENT MESSAGESThe msgQSend() routine allows the priority of a message to be specifiedas either normal or urgent, MSG_PRI_NORMAL (0) and MSG_PRI_URGENT (1),respectively.  Normal priority messages are added to the tail of the listof queued messages, while urgent priority messages are added to the headof the list.VXWORKS EVENTSIf a task has registered with a message queue via msgQEvStart(), events willbe sent to that task when a message arrives on that message queue, on thecondition that no other task is pending on the queue.INTERNAL:	WINDVIEW INSTRUMENTATIONLevel 1:	msgQCreate() causes EVENT_MSGQCREATE	msgQDestroy() causes EVENT_MSGQDELETE	msgQSend() causes EVENT_MSGQSEND	msgQReceive() causes EVENT_MSGQRECEIVELevel 2:	N/ALevel 3:	N/AINCLUDE FILES: msgQLib.hSEE ALSO: pipeDrv, msgQSmLib, msgQEvLib, eventLib,.pG "Basic OS"*/#include "vxWorks.h"#include "stdlib.h"#include "string.h"#include "taskLib.h"#include "intLib.h"#include "smObjLib.h"#include "errnoLib.h"#include "private/eventLibP.h"#include "private/classLibP.h"#include "private/objLibP.h"#include "private/msgQLibP.h"#include "private/msgQSmLibP.h"#include "private/distObjTypeP.h"#include "private/sigLibP.h"#include "private/eventP.h"#include "private/windLibP.h"#include "private/kernelLibP.h"/* locals */LOCAL OBJ_CLASS msgQClass;/* globals */CLASS_ID msgQClassId = &msgQClass;/* Instrumentation locals and globals */#ifdef WV_INSTRUMENTATIONLOCAL OBJ_CLASS msgQInstClass;CLASS_ID msgQInstClassId = &msgQInstClass;#endif/* shared memory objects function pointers */FUNCPTR  msgQSmSendRtn;FUNCPTR  msgQSmReceiveRtn;FUNCPTR  msgQSmNumMsgsRtn;/* distributed objects function pointers */FUNCPTR  msgQDistSendRtn;FUNCPTR  msgQDistReceiveRtn;FUNCPTR  msgQDistNumMsgsRtn;/* forward declarations */LOCAL STATUS msgQDestroy (MSG_Q_ID msgQId, BOOL dealloc);/* locals */LOCAL BOOL msgQLibInstalled;	/* protect from muliple inits *//********************************************************************************* msgQLibInit - initialize message queue library** This routine initializes message queue facility.* It is called once in kernelInit().** RETURNS: OK or ERROR** NOMANUAL*/STATUS msgQLibInit (void)    {    /* initialize shared memory objects function pointers */    if (!msgQLibInstalled)	{	if (classInit (msgQClassId, sizeof (MSG_Q), OFFSET (MSG_Q, objCore),		       (FUNCPTR)msgQCreate, (FUNCPTR)msgQInit,		       (FUNCPTR)msgQDestroy) == OK)	    {#ifdef WV_INSTRUMENTATION	    /* Instrumented class for windview */	    msgQClassId->initRtn = msgQInstClassId;            classInstrument (msgQClassId,msgQInstClassId);#endif	    msgQEvLibInit (); /* pull msgQLib in kernel */	    msgQLibInstalled = TRUE;	    }	}    return ((msgQLibInstalled) ? OK : ERROR);    }/********************************************************************************* msgQCreate - create and initialize a message queue** This routine creates a message queue capable of holding up to <maxMsgs>* messages, each up to <maxMsgLength> bytes long.  The routine returns * a message queue ID used to identify the created message queue in all * subsequent calls to routines in this library.  The queue can be created * with the following options:* .iP "MSG_Q_FIFO  (0x00)" 8* queue pended tasks in FIFO order.* .iP "MSG_Q_PRIORITY  (0x01)"* queue pended tasks in priority order.* .iP "MSG_Q_EVENTSEND_ERR_NOTIFY (0x02)"* When a message is sent, if a task is registered for events and the* actual sending of events fails, a value of ERROR is returned and the errno* is set accordingly. This option is off by default.* .LP** RETURNS:* MSG_Q_ID, or NULL if error.** ERRNO: S_memLib_NOT_ENOUGH_MEMORY, S_intLib_NOT_ISR_CALLABLE** SEE ALSO: msgQSmLib*/MSG_Q_ID msgQCreate    (    int         maxMsgs,        /* max messages that can be queued */    int         maxMsgLength,   /* max bytes in a message */    int         options         /* message queue options */    )    {    MSG_Q_ID	msgQId;    void *	pPool;		/* pointer to memory for messages */    UINT	size = (UINT) maxMsgs * MSG_NODE_SIZE (maxMsgLength);    if (INT_RESTRICT () != OK)		/* restrict ISR from calling */	return (NULL);    if ((!msgQLibInstalled) && (msgQLibInit () != OK))	return (NULL);			/* package init problem */    if ((msgQId = (MSG_Q_ID)objAllocExtra (msgQClassId, size, &pPool)) == NULL)	return (NULL);    if (msgQInit (msgQId, maxMsgs, maxMsgLength, options, pPool) != OK)	{	objFree (msgQClassId, (char *) msgQId);	return (NULL);	}#ifdef WV_INSTRUMENTATION    /* windview - level 1 event logging routine */    EVT_OBJ_4 (OBJ, msgQId, msgQClassId, EVENT_MSGQCREATE, 		msgQId, maxMsgs, maxMsgLength, options);#endif    return ((MSG_Q_ID) msgQId);    }/********************************************************************************* msgQInit - initialize a message queue** This routine initializes a message queue data structure.  Like msgQCreate()* the resulting message queue is capable of holding up to <maxMsgs> messages,* each of up to <maxMsgLength> bytes long.* However, instead of dynamically allocating the MSG_Q data structure,* this routine takes a pointer <pMsgQ> to the MSG_Q data structure to be* initialized, and a pointer <pMsgPool> to the buffer to be use to hold* queued messages.  <pMsgPool> must point to a 4 byte aligned buffer* that is (<maxMsgs> * MSG_NODE_SIZE (<maxMsgLength>)).** The queue can be created with the following options:**	MSG_Q_FIFO	queue pended tasks in FIFO order*	MSG_Q_PRIORITY	queue pended tasks in priority order** RETURNS: OK or ERROR.** ERRNO: S_msgQLib_INVALID_QUEUE_TYPE** SEE ALSO: msgQCreate()** NOMANUAL*/STATUS msgQInit    (    FAST MSG_Q *pMsgQ,          /* pointer to msg queue to initialize */    int         maxMsgs,        /* max messages that can be queued */    int         maxMsgLength,   /* max bytes in a message */    int         options,        /* message queue options */    void *      pMsgPool        /* pointer to memory for messages */    )    {    FAST int		nodeSize = MSG_NODE_SIZE (maxMsgLength);    FAST int		ix;    FAST Q_CLASS_ID	msgQType;    if ((!msgQLibInstalled) && (msgQLibInit () != OK))	return (ERROR);				/* package init problem */    bzero ((char *) pMsgQ, sizeof (*pMsgQ));	/* clear out msg q structure */    /* initialize internal job queues */    switch (options & MSG_Q_TYPE_MASK)        {        case MSG_Q_FIFO:	msgQType = Q_FIFO;	break;        case MSG_Q_PRIORITY:	msgQType = Q_PRI_LIST;	break;        default:            errnoSet (S_msgQLib_INVALID_QUEUE_TYPE);	    return (ERROR);        }    if ((qInit ((Q_HEAD *) &pMsgQ->msgQ, qJobClassId, msgQType,	 0, 0, 0, 0, 0, 0, 0, 0, 0) != OK) ||	(qInit ((Q_HEAD *) &pMsgQ->freeQ, qJobClassId, msgQType,	 0, 0, 0, 0, 0, 0, 0, 0, 0) != OK))	return (ERROR);    /* put msg nodes on free list */    for (ix = 0; ix < maxMsgs; ix++)	{	qJobPut (pMsgQ, &pMsgQ->freeQ, (Q_JOB_NODE *) pMsgPool,		 Q_JOB_PRI_DONT_CARE);	pMsgPool = (void *) (((char *) pMsgPool) + nodeSize);	}    /* initialize rest of msg q */    pMsgQ->options	= options;    pMsgQ->maxMsgs	= maxMsgs;    pMsgQ->maxMsgLength	= maxMsgLength;    eventInit (&pMsgQ->events);#ifdef WV_INSTRUMENTATION    if (wvObjIsEnabled)    {    /* windview - connect level 1 event logging routine */    objCoreInit (&pMsgQ->objCore, msgQInstClassId);    }    else#endif    objCoreInit (&pMsgQ->objCore, msgQClassId);    return (OK);    }/******************************************************************************** msgQTerminate - terminate message queue** This routine terminates a static message queue that was initialized with* msgQInit.** RETURNS: OK or ERROR.** NOMANUAL*/STATUS msgQTerminate    (    MSG_Q_ID msgQId     /* message queue id to terminate */    )    {    return (msgQDestroy (msgQId, FALSE));    }/********************************************************************************* msgQDelete - delete a message queue** This routine deletes a message queue.  All tasks pending on either* msgQSend(), msgQReceive() or pending for the reception of events* meant to be sent from the message queue will unblock and return* ERROR.  When this function returns, <msgQId> is no longer a valid * message queue ID.** RETURNS: OK on success or ERROR otherwise.** ERRNO:* .iP "S_objLib_OBJ_ID_ERROR"* Message queue ID is invalid* .iP "S_intLib_NOT_ISR_CALLABLE"* Routine cannot be called from ISR* .iP "S_distLib_NO_OBJECT_DESTROY"* Deleting a distributed message queue is not permitted* .iP "S_smObjLib_NO_OBJECT_DESTROY"* Deleting a shared message queue is not permitted* SEE ALSO: msgQSmLib*/STATUS msgQDelete    (    MSG_Q_ID msgQId     /* message queue to delete */    )    {    return (msgQDestroy (msgQId, TRUE));    }/********************************************************************************* msgQDestroy - destroy message queue** RETURNS: OK or ERROR.** ERRNO: S_distLib_NO_OBJECT_DESTROY**/LOCAL STATUS msgQDestroy    (    MSG_Q_ID msgQId,    /* message queue to destroy */    BOOL     dealloc    /* deallocate memory associated with message queue */    )    {    Q_JOB_NODE *pNode;    FAST int	timeout;    FAST int	nMsgs;    int errnoCopy;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品视频在线播放观看| 日韩不卡手机在线v区| 欧美videos中文字幕| 精品视频一区二区不卡| 91成人免费电影| 在线观看91精品国产入口| 欧美亚洲日本一区| 911国产精品| 日韩精品一区二区三区视频| 91麻豆精品国产91久久久使用方法| 欧美日韩一卡二卡三卡| 欧美一区二区视频观看视频| 欧美大片一区二区三区| 久久久国产一区二区三区四区小说 | 天天色综合天天| 日产精品久久久久久久性色| 久久激情五月婷婷| 国产白丝精品91爽爽久久 | 日韩影院在线观看| 精品一区二区三区在线播放| 丁香亚洲综合激情啪啪综合| 色婷婷综合久色| 这里是久久伊人| 久久久久亚洲蜜桃| 亚洲精品国产a久久久久久| 日本视频在线一区| 丰满白嫩尤物一区二区| 色综合av在线| 欧美mv日韩mv亚洲| 亚洲男人天堂av网| 另类小说视频一区二区| 99在线精品免费| 欧美一区二区三区喷汁尤物| 中文在线免费一区三区高中清不卡| 一个色在线综合| 韩国中文字幕2020精品| 精品伦理精品一区| 国产日韩精品一区二区浪潮av| 一区二区激情小说| 国产精品资源在线观看| 欧美伊人精品成人久久综合97| 欧美变态凌虐bdsm| 亚洲综合一区在线| 国产成人综合自拍| 欧美一区二区三区免费在线看| 欧美在线免费播放| 欧美大片国产精品| 一区二区视频在线看| 国产剧情av麻豆香蕉精品| 欧美日韩国产高清一区| 国产精品麻豆久久久| 日本免费新一区视频| 日本韩国一区二区| 成人欧美一区二区三区黑人麻豆 | 欧美精品日日鲁夜夜添| 中文字幕亚洲电影| 激情小说亚洲一区| 欧美日韩精品欧美日韩精品一综合| 国产清纯白嫩初高生在线观看91| 偷拍日韩校园综合在线| 91麻豆福利精品推荐| 国产欧美日韩另类视频免费观看| 视频在线在亚洲| 在线免费视频一区二区| 国产精品理论在线观看| 国产成人综合精品三级| 精品国产一二三| 蜜桃视频一区二区三区在线观看| 免费在线一区观看| 蜜臀av亚洲一区中文字幕| 欧美性色黄大片手机版| 一区二区三区中文在线观看| 91丝袜美女网| 一区二区三区在线观看网站| 99久精品国产| 亚洲丝袜精品丝袜在线| 91在线免费看| 中文字幕一区二区三区在线不卡 | av不卡免费在线观看| 亚洲国产精品t66y| 成人av在线播放网址| 欧美韩国日本不卡| 色综合夜色一区| 亚洲免费在线视频| 欧美日韩视频在线观看一区二区三区| 亚洲欧美激情在线| 欧美午夜视频网站| 日本视频中文字幕一区二区三区| 91精品国模一区二区三区| 免费观看91视频大全| 久久精品亚洲乱码伦伦中文| 国产.精品.日韩.另类.中文.在线.播放 | 欧美一区二区三区的| 麻豆一区二区三| 久久在线免费观看| 色综合天天性综合| 奇米影视7777精品一区二区| 久久久亚洲精品石原莉奈| 成人性色生活片免费看爆迷你毛片| 综合中文字幕亚洲| 欧美久久久久免费| 国产成人av资源| 亚洲宅男天堂在线观看无病毒| 宅男在线国产精品| 成人免费视频视频在线观看免费| 亚洲一区二区在线视频| 日韩一级片网址| 成人午夜av在线| 亚洲成人av一区二区三区| 日韩一区二区三区在线| 国产精品一区二区久激情瑜伽| 一区二区三区在线播放| 日韩精品影音先锋| www.在线欧美| 午夜精彩视频在线观看不卡| 欧美成人精品二区三区99精品| 色哟哟在线观看一区二区三区| 午夜精品久久一牛影视| 国产性做久久久久久| 欧美日韩国产区一| 成人午夜电影网站| 久久电影网站中文字幕| 一区二区日韩电影| 国产欧美一区二区精品性色| 欧美精品丝袜中出| 在线日韩av片| av福利精品导航| 国产精品一区二区久激情瑜伽| 亚洲成人免费影院| 亚洲视频一区二区在线| 久久在线观看免费| 日韩欧美亚洲另类制服综合在线| 色婷婷久久久久swag精品| 成人免费视频国产在线观看| 麻豆国产精品视频| 偷拍一区二区三区| 亚洲一区视频在线| 亚洲欧美国产77777| 国产精品国产自产拍高清av| 国产日韩欧美在线一区| 精品av综合导航| 欧美一区二区三区婷婷月色| 在线亚洲+欧美+日本专区| 91丨九色丨蝌蚪富婆spa| 成人午夜免费av| eeuss影院一区二区三区| 国产麻豆成人传媒免费观看| 日本美女一区二区三区视频| 日韩国产精品久久久久久亚洲| 亚洲黄色免费电影| 亚洲图片欧美色图| 亚洲国产aⅴ成人精品无吗| 亚洲视频一区在线观看| 亚洲欧美成人一区二区三区| 亚洲欧美成aⅴ人在线观看| 亚洲乱码精品一二三四区日韩在线| 国产精品久久久久久亚洲毛片| 中文字幕中文字幕在线一区 | 亚洲一区二区三区中文字幕在线| 自拍偷自拍亚洲精品播放| 国产精品成人免费在线| 亚洲日本乱码在线观看| 亚洲综合在线视频| 亚洲二区在线观看| 日韩高清一区二区| 韩国精品主播一区二区在线观看| 国产一区在线观看麻豆| 国产成人福利片| 色婷婷久久久久swag精品| 91国偷自产一区二区三区成为亚洲经典| 日本韩国欧美三级| 欧美日韩夫妻久久| 久久色视频免费观看| 国产精品美女久久久久久久久 | 精品国产凹凸成av人网站| 久久亚洲二区三区| 国产精品美女久久久久久 | 欧美一级日韩不卡播放免费| 日韩精品一区二区三区视频播放 | 亚洲欧美激情小说另类| 午夜在线电影亚洲一区| 国产精品亚洲а∨天堂免在线| 波多野结衣91| 911精品国产一区二区在线| 久久精品亚洲国产奇米99| 亚洲免费电影在线| 奇米888四色在线精品| 成人高清免费观看| 欧美一区二区三区四区久久| 国产午夜精品久久久久久久| 亚洲一区二区三区小说| 久久99在线观看| 欧洲精品在线观看| 日本一区二区视频在线| 亚洲观看高清完整版在线观看| 国产999精品久久| 欧美一卡二卡在线| 亚洲免费毛片网站| 国产河南妇女毛片精品久久久| 欧美午夜精品久久久久久孕妇|