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

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

?? semlib.c

?? vxworks 5.5 kernel code
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* semLib.c - general semaphore library *//* Copyright 1984-2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02j,09nov01,dee  add CPU_FAMILY != COLDFIRE in portable test02i,26oct01,bwa  Added semEvLib and eventLib to the list of 'SEE ALSO'                 modules.02h,12oct01,cjj  Added documentation regarding S_eventLib_EVENTSEND_FAILED                 error02g,06sep01,bwa  Added VxWorks events support.02f,16nov98,cdp  make ARM CPUs with ARM_THUMB==TRUE use portable routines.02f,03mar00,zl   merged SH support into T202e,05oct98,jmp  doc: cleanup.02d,17feb98,cdp  undo 02c: put ARM back in list of optimised CPUs.02c,21oct97,kkk  undo 02d, take out ARM from list of optimized CPUs.02d,19may97,jpd  added ARM to list of optimised CPUs.02c,17oct96,dgp  doc: add errnos for user-visible routines per SPR 689302b,13jun96,ms   conditionally compiled the windview instrumentation 02a,22oct95,jdi  doc: added bit values for semTake() timeout param (SPR 4276).01z,19mar95,dvs  removed tron references.01y,03feb95,rhp  edit SEMAPHORE DELETION manpage text, duplicate under semDelete()01x,18jan95,rhp  Doc errno value on semTake() return due to timeout (SPR#1930)01w,09jun93,hdn  added a support for I80X8601z,14apr94,smb  fixed class dereferencing for instrumentation macros01y,15mar94,smb  modified instrumentation macros01x,24jan94,smb  added instrumentation macros01w,10dec93,smb  added instrumentation01v,29jan93,pme  added little endian support for shared sempahores.01u,20jan93,jdi  documentation cleanup for 5.1.01t,13nov92,dnw  added include of smObjLib.h01s,02oct92,pme  added reference to shared semaphores documentation.01r,22jul92,pme  made semDestroy return S_smObjLib_NO_OBJECT_DESTROY when		 trying to destroy a shared semaphore.01q,19jul92,pme  added shared memory semaphores support.01p,04jul92,jcf  tables now initialized to null to reduce coupling.01o,26may92,rrr  the tree shuffle01n,15sep91,ajm  added MIPS to list of optimized CPU's01m,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed includes to have absolute path from h/		  -fixed #else and #endif		  -changed VOID to void		  -changed copyright notice01l,26sep91,hdn  added conditional flag for TRON optimized code.01k,15aug91,del  changed interface to qInit to pass all "optional" args.01j,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by jcf.01i,24mar91,jdi  documentation cleanup.01h,05oct90,dnw  made semTerminate() be NOMANUAL.01g,28aug90,jcf  documentation.01f,10aug90,dnw  corrected forward declaration of semQFlushDefer().01e,03aug90,jcf  documentation.01d,05jul90,jcf  optimized version now available.01c,26jun90,jcf  merged into one semaphore class.		 added semFlush ()01b,11may90,jcf  fixed up PORTABLE definition.01a,20oct89,jcf  written based on v1g of semLib.*//*DESCRIPTIONSemaphores are the basis for synchronization and mutual exclusion inVxWorks.  They are powerful in their simplicity and form the foundationfor numerous VxWorks facilities.Different semaphore types serve different needs, and while the behaviorof the types differs, their basic interface is the same.  This libraryprovides semaphore routines common to all VxWorks semaphore types.  Forall types, the two basic operations are semTake() and semGive(), theacquisition or relinquishing of a semaphore.Semaphore creation and initialization is handled by other libraries,depending on the type of semaphore used.  These libraries containfull functional descriptions of the semaphore types:    semBLib  - binary semaphores    semCLib  - counting semaphores    semMLib  - mutual exclusion semaphores    semSmLib - shared memory semaphoresBinary semaphores offer the greatest speed and the broadest applicability.The semLib library provides all other semaphore operations, includingroutines for semaphore control, deletion, and information.  Semaphoresmust be validated before any semaphore operation can be undertaken.  Aninvalid semaphore ID results in ERROR, and an appropriate `errno' is set.SEMAPHORE CONTROLThe semTake() call acquires a specified semaphore, blocking the callingtask or making the semaphore unavailable.  All semaphore types support atimeout on the semTake() operation.  The timeout is specified as thenumber of ticks to remain blocked on the semaphore.  Timeouts ofWAIT_FOREVER and NO_WAIT codify common timeouts.  If a semTake() timesout, it returns ERROR.  Refer to the library of the specific semaphore type for the exact behavior of this operation.The semGive() call relinquishes a specified semaphore, unblocking a pendedtask or making the semaphore available.  Refer to the library of thespecific semaphore type for the exact behavior of this operation.The semFlush() call may be used to atomically unblock all tasks pended ona semaphore queue, i.e., all tasks will be unblocked before any are allowedto run.  It may be thought of as a broadcast operation insynchronization applications.  The state of the semaphore is unchanged bythe use of semFlush(); it is not analogous to semGive().SEMAPHORE DELETIONThe semDelete() call terminates a semaphore and deallocates anyassociated memory.  The deletion of a semaphore unblocks tasks pendedon that semaphore; the routines which were pended return ERROR.  Takecare when deleting semaphores, particularly those used for mutualexclusion, to avoid deleting a semaphore out from under a task thatalready has taken (owns) that semaphore.  Applications should adoptthe protocol of only deleting semaphores that the deleting task hassuccessfully taken.SEMAPHORE INFORMATIONThe semInfo() call is a useful debugging aid, reporting all tasksblocked on a specified semaphore.  It provides a snapshot of the queue atthe time of the call, but because semaphores are dynamic, the informationmay be out of date by the time it is available.  As with the current state ofthe semaphore, use of the queue of pended tasks should be restricted todebugging uses only.VXWORKS EVENTSIf a task has registered for receiving events with a semaphore, events will besent when that semaphore becomes available. By becoming available, it isimplied that there is a change of state. For a binary semaphore, there is only a change of state when a semGive() is done on a semaphore that was taken. For a counting semaphore, there is always a change of state when the semaphore is available, since the count is incremented each time. For a mutex, a semGive() can only be performed if the current task is the owner, implying that the semaphore has been taken; thus, there is always a change of state.INTERNAL:	WINDVIEW INSTRUMENTATIONLevel 1:	semGive() causes EVENT_SEMGIVE		(portable only)	semTake() causes EVENT_SEMTAKE		(portable only)	semFlush() causes EVENT_SEMFLUSH	semDestroy() causes EVENT_SEMDELETELevel 2:	semGive() causes EVENT_OBJ_SEMGIVE	(portable only)	semTake() causes EVENT_OBJ_SEMTAKE	(portable only)	semFlush() causes EVENT_OBJ_SEMFLUSH	Level 3:	N/AINCLUDE FILES: semLib.hSEE ALSO: taskLib, semBLib, semCLib, semMLib, semSmLib, semEvLib, eventLib,.pG "Basic OS"*/#include "vxWorks.h"#include "taskLib.h"#include "qLib.h"#include "intLib.h"#include "errno.h"#include "smObjLib.h"#include "private/eventLibP.h"#include "private/classLibP.h"#include "private/eventP.h"#include "private/objLibP.h"#include "private/semLibP.h"#include "private/windLibP.h"#include "private/workQLibP.h"#include "private/semSmLibP.h"/* optimized version available for 680X0, MIPS, i86, SH, *//* COLDFIRE and ARM (excluding Thumb) */#if (defined(PORTABLE) || \     ((CPU_FAMILY != MC680X0) && \      (CPU_FAMILY != MIPS) && \      (CPU_FAMILY != I80X86) && \      (CPU_FAMILY != SH) && \      (CPU_FAMILY != COLDFIRE) && \      (CPU_FAMILY != ARM)) || \     ((CPU_FAMILY == ARM) && ARM_THUMB))#define semLib_PORTABLE#endif/* locals */LOCAL BOOL	semLibInstalled;		/* protect from muliple inits *//* globals */OBJ_CLASS semClass;				/* semaphore object class */CLASS_ID  semClassId = &semClass;		/* semaphore class ID */#ifdef	WV_INSTRUMENTATIONOBJ_CLASS semInstClass;				/* semaphore object class */CLASS_ID  semInstClassId = &semInstClass;	/* semaphore class ID */#endifFUNCPTR semGiveTbl [MAX_SEM_TYPE] =		/* semGive() methods by type */    {    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid    };FUNCPTR semTakeTbl [MAX_SEM_TYPE] =		/* semTake() methods by type */    {    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid    };FUNCPTR semFlushTbl [MAX_SEM_TYPE] =		/* semFlush() methods by type */    {    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid    };FUNCPTR semGiveDeferTbl [MAX_SEM_TYPE] =	/* semGiveDefer() methods */    {    (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL,    (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL    };FUNCPTR semFlushDeferTbl [MAX_SEM_TYPE] =	/* semFlushDefer() methods */    {    (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL,    (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL    };/********************************************************************************* semLibInit - initialize the semaphore management package** This routine initializes the semaphore object class.  No semaphore* operation will work until this is called.  This routine is called during* system configuration within kernelInit().  This routine should only be* called once.** SEE ALSO: classLib* NOMANUAL*/STATUS semLibInit (void)    {    if ((!semLibInstalled) &&	(classInit (semClassId, sizeof(SEMAPHORE), OFFSET(SEMAPHORE,objCore),         (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) semDestroy) == OK))	{#ifdef	WV_INSTRUMENTATION	/* initialise instrumented class for semaphores */	semClassId->initRtn = semInstClassId;        classInstrument (semClassId, semInstClassId);#endif	semEvLibInit (); /* pull semaphore-related events lib in kernel */	semLibInstalled = TRUE;	}    return ((semLibInstalled) ? OK : ERROR);    }#ifdef semLib_PORTABLE/********************************************************************************* semGive - give a semaphore** This routine performs the give operation on a specified semaphore.* Depending on the type of semaphore, the state of the semaphore and of the* pending tasks may be affected.  If no tasks are pending on the sempahore and* a task has previously registered to receive events from the semaphore, these* events are sent in the context of this call.  This may result in the* unpending of the task waiting for the events.  If the semaphore fails to* send events and if it was created using the SEM_EVENTSEND_ERR_NOTIFY * option, ERROR is returned even though the give operation was successful.* The behavior of semGive() is discussed fully in the library description * of the specific semaphore type being used.** RETURNS: OK on success or ERROR otherwise** ERRNO:* .iP "S_intLib_NOT_ISR_CALLABLE"* Routine was called from an ISR for a mutex semaphore.* .iP "S_objLib_OBJ_ID_ERROR"* Semaphore ID is invalid.* .iP "S_semLib_INVALID_OPERATION"* Current task not owner of mutex semaphore.* .iP "S_eventLib_EVENTSEND_FAILED"* Semaphore failed to send events to the registered task.  This errno * value can only exist if the semaphore was created with the * SEM_EVENTSEND_ERR_NOTIFY option.* .LP** SEE ALSO: semBLib, semCLib, semMLib, semSmLib, semEvStart*/STATUS semGive    (    SEM_ID semId        /* semaphore ID to give */    )    {    SM_SEM_ID  smObjSemId;	/* shared semaphore ID */    /* check if semaphore is shared */    if (ID_IS_SHARED (semId))  	{	smObjSemId = (SM_SEM_ID) SM_OBJ_ID_TO_ADRS(semId);	return ((*semGiveTbl[ntohl (smObjSemId->objType) & SEM_TYPE_MASK])		(smObjSemId));	}    /* otherwise the semaphore is local */#ifdef	WV_INSTRUMENTATION    /* windview - level 1 event logging */    EVT_OBJ_3 (OBJ, semId, semClassId, EVENT_SEMGIVE, semId, 		semId->state, semId->recurse);#endif    if (kernelState)	return (semGiveDefer (semId));      /* defer semaphore give */    else	return((* semGiveTbl[semId->semType & SEM_TYPE_MASK]) (semId));    }/********************************************************************************* semTake - take a semaphore** This routine performs the take operation on a specified semaphore.* Depending on the type of semaphore, the state of the semaphore and* the calling task may be affected.  The behavior of semTake() is* discussed fully in the library description of the specific semaphore * type being used.** A timeout in ticks may be specified.  If a task times out, semTake() will* return ERROR.  Timeouts of WAIT_FOREVER (-1) and NO_WAIT (0) indicate to wait* indefinitely or not to wait at all.** When semTake() returns due to timeout, it sets the errno to* S_objLib_OBJ_TIMEOUT (defined in objLib.h).* * The semTake() routine is not callable from interrupt service routines.** RETURNS: OK, or ERROR if the semaphore ID is invalid or the task timed out.** ERRNO: S_intLib_NOT_ISR_CALLABLE, S_objLib_OBJ_ID_ERROR,*        S_objLib_OBJ_UNAVAILABLE** SEE ALSO: semBLib, semCLib, semMLib, semSmLib*/STATUS semTake    (    SEM_ID semId,       /* semaphore ID to take */    int timeout         /* timeout in ticks */    )    {    SM_SEM_ID  smObjSemId;      /* shared semaphore ID */    /* check if semaphore is global (shared) */    if (ID_IS_SHARED (semId))	{	smObjSemId = (SM_SEM_ID) SM_OBJ_ID_TO_ADRS(semId);        return ((* semTakeTbl[ntohl (smObjSemId->objType) & SEM_TYPE_MASK ]) 		 (smObjSemId, timeout));	}    /* otherwise sempahore is local */#ifdef	WV_INSTRUMENTATION    /* windview - level 1 event logging */    EVT_OBJ_3 (OBJ, semId, semClassId, EVENT_SEMTAKE, semId, 		semId->state, semId->recurse);#endif    return ((* (semTakeTbl[semId->semType & SEM_TYPE_MASK])) (semId, timeout));    }#endif	/* semLib_PORTABLE *//********************************************************************************* semFlush - unblock every task pended on a semaphore** This routine atomically unblocks all tasks pended on a specified* semaphore, i.e., all tasks will be unblocked before any is allowed

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一本一道久久香蕉| 国产成人亚洲综合色影视| 亚洲成a人在线观看| 婷婷六月综合亚洲| 国产精品99久久久久| 欧美日韩亚洲综合一区| 欧美xxxxxxxxx| 国产精品久久久久久久久动漫 | 成人av网站在线观看免费| 一本久久精品一区二区| 欧美一区欧美二区| 亚洲欧洲精品一区二区三区不卡 | 精品入口麻豆88视频| 国产乱码字幕精品高清av| 国产精品伦理一区二区| 日本大胆欧美人术艺术动态| 成人av小说网| 性久久久久久久| 欧美xxx久久| 色一情一伦一子一伦一区| 日韩高清中文字幕一区| 国产片一区二区| 久久精品国产亚洲aⅴ| 欧美亚洲图片小说| 亚洲欧美乱综合| 丁香激情综合五月| 久久婷婷色综合| 日本va欧美va精品| 欧美嫩在线观看| 亚洲国产一二三| 色8久久精品久久久久久蜜| 亚洲人亚洲人成电影网站色| 成人免费视频一区二区| 午夜精品国产更新| 国产精品美女久久久久久久久久久| 欧美日韩美少妇| 波多野结衣中文一区| 日韩欧美一级二级| 蜜桃精品视频在线观看| 日韩一卡二卡三卡四卡| 久久国产精品色| 亚洲精品少妇30p| 91在线观看美女| 亚洲一区二区三区小说| 欧美性一级生活| 国产大陆a不卡| 日本不卡一区二区三区 | 国产女人18毛片水真多成人如厕| 欧美群妇大交群中文字幕| 99久久夜色精品国产网站| 亚洲人午夜精品天堂一二香蕉| 精品裸体舞一区二区三区| 欧美日韩另类国产亚洲欧美一级| 成人丝袜视频网| 激情综合色综合久久| 国产精品久久久久aaaa樱花| 日韩久久久久久| 91精品国产免费| 在线免费观看不卡av| 日韩精品视频网站| 精品福利一区二区三区| 粉嫩久久99精品久久久久久夜| 亚洲精品日日夜夜| 亚洲欧洲美洲综合色网| 国产精品久久久久久久久快鸭| 久久蜜臀中文字幕| 欧美在线|欧美| 色综合久久久久综合| 国产 日韩 欧美大片| 国产呦萝稀缺另类资源| 国产一区视频网站| 经典三级视频一区| 激情综合亚洲精品| 黑人精品欧美一区二区蜜桃 | 成人黄色在线视频| 国产精品一二三在| 国产成人日日夜夜| 大胆亚洲人体视频| 成人aaaa免费全部观看| 99久久婷婷国产| 色香蕉久久蜜桃| 欧美在线短视频| 欧美日韩精品一区二区| 91精品国产综合久久精品app | 国产成人精品在线看| 国产剧情在线观看一区二区 | 96av麻豆蜜桃一区二区| 91农村精品一区二区在线| 色域天天综合网| 欧美日韩精品一区视频| 欧美一级二级三级乱码| 久久综合色综合88| 国产精品天干天干在观线| 亚洲人吸女人奶水| 天堂一区二区在线| 久久狠狠亚洲综合| 不卡视频一二三| 欧美午夜不卡视频| 亚洲精品一区二区三区99 | 亚洲精品国产a| 三级影片在线观看欧美日韩一区二区| 视频在线观看一区二区三区| 精品午夜一区二区三区在线观看 | 欧美日免费三级在线| 一区二区三区日本| 欧美性猛片aaaaaaa做受| 91成人在线观看喷潮| 日韩一区二区三区四区五区六区| www欧美成人18+| 亚洲美女免费视频| 美女视频黄 久久| 不卡av在线免费观看| 欧美精品日日鲁夜夜添| 欧美亚洲一区二区三区四区| 日韩欧美在线观看一区二区三区| 亚洲国产精品成人综合色在线婷婷| 久久在线观看免费| 亚洲一区自拍偷拍| 国产另类ts人妖一区二区| 欧洲亚洲国产日韩| 久久先锋影音av鲁色资源网| 一区二区三区91| 国产精品一二三| 精品视频1区2区| 国产精品久久综合| 久久99热狠狠色一区二区| 91免费国产视频网站| 精品国产乱码久久久久久图片 | 青青草97国产精品免费观看| 国产91综合网| 91麻豆精品国产91久久久久| 国产精品美女久久福利网站| 蜜臀99久久精品久久久久久软件| 在线一区二区三区四区| 国产三级精品视频| 日本视频在线一区| 在线观看欧美日本| 国产精品少妇自拍| 国产综合一区二区| 欧美一区2区视频在线观看| 亚洲男帅同性gay1069| 国产成人亚洲精品狼色在线| 欧美一区二区三区在线视频| 亚洲精品视频观看| 99视频在线精品| 国产欧美一区二区精品仙草咪 | 国产精品初高中害羞小美女文| 美女看a上一区| 欧美麻豆精品久久久久久| 亚洲免费观看高清| 91丨porny丨户外露出| 国产欧美一区二区三区网站| 国精产品一区一区三区mba桃花| 欧美一二三区在线观看| 日韩va欧美va亚洲va久久| 精品视频999| 午夜精品久久久久久久久久久| 在线观看av一区二区| 亚洲精品欧美专区| 91国偷自产一区二区三区成为亚洲经典| 中文字幕一区视频| 成人精品小蝌蚪| 国产精品久久久久久久浪潮网站 | 3d动漫精品啪啪1区2区免费 | 99久久精品久久久久久清纯| 国产精品国产三级国产aⅴ中文 | 亚洲成a人片在线观看中文| 色综合久久精品| 亚洲一本大道在线| 欧美老年两性高潮| 五月天婷婷综合| 日韩精品一区二区三区视频| 毛片一区二区三区| 久久影院午夜片一区| 国产91在线观看丝袜| 成人免费在线观看入口| 91视频com| 亚洲18色成人| 欧美电影免费观看高清完整版在 | 日韩欧美精品在线| 国产精品资源在线看| 国产精品拍天天在线| 91久久精品一区二区三| 首页综合国产亚洲丝袜| 日韩欧美国产小视频| 懂色av一区二区三区免费看| 成人免费小视频| 欧美日韩在线免费视频| 美女www一区二区| 国产精品美女久久福利网站| 欧美亚洲国产一卡| 青青青爽久久午夜综合久久午夜| 精品久久久影院| 97久久精品人人澡人人爽| 亚洲成av人片观看| 精品国产自在久精品国产| 成人app在线观看| 首页国产丝袜综合| 亚洲国产成人午夜在线一区 | 精品午夜一区二区三区在线观看|