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

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

?? semsmlib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* semSmLib.c - shared memory semaphore library (VxMP Option) *//* Copyright 1984-2002 Wind River Systems, Inc. *//*modification history--------------------01n,06may02,mas  cache flush and volatile fix (SPR 68334); bridge flush fix		 (SPR 68844)01m,24oct01,mas  doc update (SPR 71149)01l,14mar99,jdi  doc: removed refs to config.h and/or configAll.h (SPR 25663).01k,22feb99,wsl  doc: fixed typo in errno code01j,22mar94,pme  added WindView level event logging.01i,24feb93,jdi  doc tweaks.01h,08feb93,jdi  documentation cleanup.01g,29jan93,pme  added little endian support.01f,23nov92,jdi  documentation cleanup.01e,13nov92,dnw  added include of smObjLib.h01d,02oct92,pme  added SPARC support. documentation cleanup.01c,29sep92,pme  changed semSm[BC]Create to sem[BC]SmCreate		 comments cleanup01b,30jul92,pme  changed semSm[BC]Init to call qFifoGInit.		 added signal restarting.		 semSm{Create,Init} call semSmLibInit for robustness.		 documentation cleanup.01a,19jul92,pme  added semSmLibInit() to reduce coupling.                 reduced interrupt latency in semSmGive and semSmTake.                 merged shared counting and binary semaphores.                 code review clean up.                 written.*//*DESCRIPTIONThis library provides the interface to VxWorks shared memory binary andcounting semaphores.  Once a shared memory semaphore is created, thegeneric semaphore-handling routines provided in semLib are used tomanipulate it.  Shared memory binary semaphores are created usingsemBSmCreate().  Shared memory counting semaphores are created usingsemCSmCreate().Shared memory binary semaphores are used to:  (1) control mutuallyexclusive access to multiprocessor-shared data structures, or (2)synchronize multiple tasks running in a multiprocessor system.  Forgeneral information about binary semaphores, see the manual entrysemBLib.Shared memory counting semaphores are used for guarding multiple instancesof a resource used by multiple CPUs.  For general information about sharedcounting semaphores, see the manual entry for semCLib.For information about the generic semaphore-handling routines, see themanual entry for semLib.MEMORY REQUIREMENTSThe semaphore structure is allocated from a dedicated shared memory partition.The shared semaphore dedicated shared memory partition is initialized bythe shared memory objects master CPU.  The size of this partition isdefined by the maximum number of shared semaphores, set in the configurationparameter SM_OBJ_MAX_SEM .This memory partition is common to shared binary and counting semaphores,thus SM_OBJ_MAX_SEM must be set to the sum total of binary and countingsemaphores to be used in the system.RESTRICTIONSShared memory semaphores differ from local semaphores in the following ways:\is\i `Interrupt Use:'Shared semaphores may not be given, taken, or flushed at interrupt level.\i `Deletion:'There is no way to delete a shared semaphore and free its associatedshared memory.  Attempts to delete a shared semaphore return ERROR andset `errno' to S_smObjLib_NO_OBJECT_DESTROY .\i `Queuing Style:'The shared semaphore queuing style specified when the semaphore is created must be FIFO.\ieINTERRUPT LATENCYInternally, interrupts are locked while manipulating shared semaphore data structures, thus increasing local CPU interrupt latency.CONFIGURATIONBefore routines in this library can be called, the shared memory objectfacility must be initialized by calling usrSmObjInit().  This is doneautomatically during VxWorks initialization when the component INCLUDE_SM_OBJis included.AVAILABILITYThis module is distributed as a component of the unbundled shared memorysupport option, VxMP.INTERNALTo achieve full transparency, semBSmCreate() and semCSmCreate() returns a semaphore of type SEM_ID but the effective structure pointed to by this ID is a SM_SEMAPHORE.When a task blocks on a shared semaphore a data structure called sharedmemory object task control block (smObjTcb) is added to the shared semaphore pend queue.  This smObjTcb is allocated from a dedicated fixed block size shared memory partition the first time the taskblocks on a shared semaphore or after each restart signal or timeoutoccuring while taking a shared semaphore.In order to use the standard wind kernel routines we use a pseudo multi-wayqueue to manipulate the shared queues and nodes (actually shared TCBs). We have defined a new class of queue called qFifoG for which the queue headcontains :       - a pointer to qFifoGClass.       - a pointer to the Fifo pending queue associated with the         shared object where task is pending on.       - a pointer to the shared memory object pend queue lock.  This         pointer is initialized to NULL if we already have the lock.         This pointer is necessary because when a timeout expires,         when a signal is sent to the task, or when a task is deleted 	 Q_REMOVE is called to remove the shared TCB from the semaphore 	 pending list without having previously acquired semaphore 	 lock access.  Thus only qFifoGRemove(), which is called by Q_REMOVE ,         need to check if this pointer is NULL before manipulating the queue.- Shared Semaphore FlushThe issue here is to keep a per CPU semaphore flush indivisibility whilekeeping a reasonable interrupt latency.  Note that a system wide flushindivisibility is impossible to achieve.This implies that only one notification is made to any CPU where there'sone or more tasks pending on the flushed semaphore.Since no modifications are made to the semaphore status, semaphore flushis the same for binary and counting semaphores and is called semSmFlush().- Optional Facility:Since this facility is optional, 'flush', 'give' and 'take' routines arecalled via function pointers in semFlush(), semGive(), and semTake(),respectively, to avoid this code being imported into VxWorks when the VxMPoption is not available.Functions pointers are initialized by semSmLibInit() which is calledin smObjInit().routine structure: semBSmCreate       semCSmCreate |     |            |      |(o) semSmBInit     (o) semSmCInit         |                 |         \                 /          ------   --------                \ /             qFifoGInit                 |             smDllInit              semGive           semFlush                 semTake            |                 |        Interrupt       |         semSmGive         semSmFlush   /            semSmTake        /  |  |           /  | |      /              | |   \       /   *  |   --------   * |     /               | *    \      /       |  /             |    /                |       \      |\ smObjEventSend  smObjEventProcess       smObjTcbInit/|      | \    /   \             |       |   \         |      / |      |  \  *     -----  windReadyQPut |    *       (i)    /  |      |   -----------  \               |                  /   | windReadyQPut       \  -------------- |    windReadyQRemove  |                      |               \|                      |                 qFifoGRemove          |                  qFifoGPut                      |      \         |                      |                  smDllRemove *    smDllConcat             smDllPut        *                      *               (o)           (i)	|                      |                |             |   SM_OBJ_LOCK_TAKE    SM_OBJ_LOCK_GIVE   smMemPartAlloc smFixBlkPartAlloc	INCLUDE FILES: semSmLib.hSEE ALSO: semLib, semBLib, semCLib, smObjLib, semShow, usrSmObjInit(),\tb VxWorks Programmer's Guide: Shared Memory Objects, \tb VxWorks Programmer's Guide: Basic OS*//* LINTLIBRARY */#include "vxWorks.h"#include "errnoLib.h"#include "objLib.h"#include "classLib.h"#include "qFifoGLib.h"#include "semLib.h"#include "stdlib.h"#include "stdio.h"#include "string.h"#include "taskLib.h"#include "cacheLib.h"#include "intLib.h"#include "smObjLib.h"#include "netinet/in.h"#include "private/semSmLibP.h"#include "private/windLibP.h"#include "private/smObjLibP.h"#include "private/smMemLibP.h"#include "private/sigLibP.h"#include "private/eventP.h"/* locals */LOCAL BOOL  semSmLibInstalled;	/* protect from muliple inits *//******************************************************************************* semSmLibInit - initialize the shared semaphore management package** This routine initializes the shared memory semaphore library by installing* the addresses of its give, take, and flush routines for both binary and* counting semaphores in the kernel's semaphore function dispatch table.** SEE ALSO: smObjLibInit().** RETURNS: N/A** NOMANUAL*/void semSmLibInit (void)    {    if ((!semSmLibInstalled) & (semLibInit () == OK))	{    	/* fill the semaphore function tables */    	semGiveTbl  [SEM_TYPE_SM_BINARY]	= (FUNCPTR) semSmGive;    	semTakeTbl  [SEM_TYPE_SM_BINARY]	= (FUNCPTR) semSmTake;    	semFlushTbl [SEM_TYPE_SM_BINARY]	= (FUNCPTR) semSmFlush;    	semGiveTbl  [SEM_TYPE_SM_COUNTING]	= (FUNCPTR) semSmGive;    	semTakeTbl  [SEM_TYPE_SM_COUNTING]	= (FUNCPTR) semSmTake;    	semFlushTbl [SEM_TYPE_SM_COUNTING]	= (FUNCPTR) semSmFlush;	semSmLibInstalled = TRUE;	}    }/******************************************************************************* semBSmCreate - create and initialize a shared memory binary semaphore (VxMP Option)** This routine allocates and initializes a shared memory binary semaphore.* The semaphore is initialized to an <initialState> of either* SEM_FULL (available) or SEM_EMPTY (not available).  The shared semaphore* structure is allocated from the shared semaphore dedicated memory* partition.** The semaphore ID returned by this routine can be used directly by the* generic semaphore-handling routines in semLib -- semGive(), semTake(), and* semFlush() -- and the show routines, such as show() and semShow().** The queuing style for blocked tasks is set by <options>; the only* supported queuing style for shared memory semaphores is first-in-first-out,* selected by SEM_Q_FIFO .** Before this routine can be called, the shared memory objects facility must* be initialized (see semSmLib).** The maximum number of shared memory semaphores (binary plus counting) that* can be created is SM_OBJ_MAX_SEM , a configurable parameter.** AVAILABILITY* This routine is distributed as a component of the unbundled shared memory* support option, VxMP.* * RETURNS: The semaphore ID, or NULL if memory cannot be allocated * from the shared semaphore dedicated memory partition.* * ERRNO: S_memLib_NOT_ENOUGH_MEMORY, S_semLib_INVALID_QUEUE_TYPE,* S_semLib_INVALID_STATE, S_smObjLib_LOCK_TIMEOUT** SEE ALSO: semLib, semBLib, smObjLib, semShow,* \tb VxWorks Programmer's Guide: Basic OS** INTERNAL* The least significant bit of the semaphore id is set to 1 in order to* differentiate shared and local semaphores.*/SEM_ID semBSmCreate    (    int		options,	/* semaphore options */    SEM_B_STATE	initialState	/* initial semaphore state */    )    {    SM_SEM_ID   smSemId;    int         temp;           /* temp storage */    /*      * Allocate semaphore structure from shared semaphores     * dedicated shared memory partition.      */      smSemId = (SM_SEM_ID) smMemPartAlloc ((SM_PART_ID) smSemPartId,                                          sizeof (SM_SEMAPHORE));    if (smSemId == NULL)        {	return (NULL);        }    /* clear shared semaphore structure */    bzero ((char *) smSemId, sizeof (SM_SEMAPHORE));    /* initialize allocated semaphore */    if (semSmBInit ((SM_SEMAPHORE *) (smSemId), options, initialState) != OK)    	{    	smMemPartFree ((SM_PART_ID) smSemPartId, (char *) smSemId);    	return (NULL);    	}    /* update shared memory objects statistics */    CACHE_PIPE_FLUSH ();                        /* CACHE FLUSH   [SPR 68334] */    temp = pSmObjHdr->curNumSemB;               /* PCI bridge bug [SPR 68844]*/    pSmObjHdr->curNumSemB = htonl (ntohl (pSmObjHdr->curNumSemB) + 1);    CACHE_PIPE_FLUSH ();                        /* CACHE FLUSH   [SPR 68334] */    temp = pSmObjHdr->curNumSemB;               /* BRIDGE FLUSH  [SPR 68334] */    return ((SEM_ID) (SM_OBJ_ADRS_TO_ID (smSemId)));    }/******************************************************************************* semSmBInit - initialize a declared shared binary semaphore** The initialization of a static shared binary semaphore, or a shared binary* semaphore embedded in some larger shared object need not deal with* allocation.  This routine may be called to initialize such a semaphore.  The* semaphore is initialized to the specified initial state of either SEM_FULL* or SEM_EMPTY .** Binary semaphore options include the queuing style for blocked tasks.* For now, the only available shared semaphore queueing style is* first-in-first-out, type SEM_Q_FIFO defined as 0 in semLib.h.** The semaphore address parameter is the local address of a shared semaphore* structure. ** RETURNS: OK, or ERROR if queue type or initial state is invalid.* * SEE ALSO: semBSmCreate** ERRNO: S_semLib_INVALID_QUEUE_TYPE, S_semLib_INVALID_STATE   

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人免费视频网站 | 亚洲国产日产av| 色乱码一区二区三区88| 亚洲同性gay激情无套| 色综合久久久久综合体| 亚洲国产精品精华液网站| 欧美色爱综合网| 美日韩黄色大片| 国产欧美一区二区在线| 91老师片黄在线观看| 亚洲成人免费在线观看| 久久综合色鬼综合色| 波多野结衣在线aⅴ中文字幕不卡| 国产精品家庭影院| 欧美日韩在线直播| 国产美女一区二区| 亚洲精品一二三区| 精品国产乱码久久久久久蜜臀| 国产不卡在线播放| 亚洲第一会所有码转帖| 欧美精品一区二区三区蜜桃视频| 国产成人免费高清| 五月综合激情婷婷六月色窝| 久久久久国产精品免费免费搜索| 99久久精品一区| 青青草成人在线观看| 欧美国产一区在线| 欧美精品自拍偷拍动漫精品| 国产精品一区二区久久不卡| 亚洲影视在线观看| 国产亚洲精久久久久久| 欧美日韩小视频| 成人午夜视频免费看| 午夜精品久久久| 国产精品理伦片| 欧美一区二区三区色| 99久久精品免费看| 麻豆精品国产传媒mv男同 | 久久久久9999亚洲精品| 色一区在线观看| 国产成人av一区二区| 婷婷亚洲久悠悠色悠在线播放| 久久久亚洲精华液精华液精华液| 欧美在线播放高清精品| 国产成人福利片| 美女国产一区二区| 亚洲高清视频在线| 中文字幕在线不卡国产视频| 精品国产百合女同互慰| 欧美日韩极品在线观看一区| 色综合天天在线| 99久久精品国产麻豆演员表| 三级精品在线观看| 亚洲欧美偷拍三级| 亚洲国产精华液网站w| 欧美精品一区二区三区高清aⅴ| 91电影在线观看| av激情成人网| 丁香啪啪综合成人亚洲小说| 国产乱子伦视频一区二区三区| 日日摸夜夜添夜夜添精品视频| 亚洲精品成人在线| |精品福利一区二区三区| 国产三级精品三级在线专区| 久久美女高清视频| 国产欧美一区视频| 中文字幕欧美激情一区| 国产日韩精品一区二区三区 | 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 日韩精品成人一区二区在线| 樱桃国产成人精品视频| 中文字幕在线不卡| 国产精品黄色在线观看| 中文字幕在线一区免费| 国产女人18毛片水真多成人如厕| 久久久久国产精品麻豆ai换脸| 26uuu亚洲| 久久女同精品一区二区| 国产亚洲综合在线| 中文字幕欧美日本乱码一线二线| 欧美韩国日本综合| 亚洲桃色在线一区| 亚洲福利视频一区二区| 日韩电影免费在线看| 青青青爽久久午夜综合久久午夜| 麻豆91免费观看| 激情欧美一区二区三区在线观看| 经典三级视频一区| 成人av午夜电影| 91亚洲永久精品| 在线亚洲欧美专区二区| 欧美日本高清视频在线观看| 91麻豆精品国产自产在线观看一区| 欧美老女人在线| 日韩美女视频在线| 国产精品理论片在线观看| 依依成人精品视频| 日日摸夜夜添夜夜添国产精品| 美腿丝袜一区二区三区| 国产激情一区二区三区| av不卡免费在线观看| 欧美精选一区二区| 久久久精品黄色| 亚洲人成网站精品片在线观看| 日韩制服丝袜av| 国产精品小仙女| 在线观看成人免费视频| 精品成人私密视频| 亚洲欧洲日韩综合一区二区| 天天综合天天综合色| 国产乱妇无码大片在线观看| 不卡视频一二三四| 日韩一级高清毛片| 一区免费观看视频| 日本在线不卡一区| 成人综合在线观看| 欧美丰满少妇xxxbbb| 国产亚洲综合在线| 午夜精品在线视频一区| 国产精品一级片| 欧美三级韩国三级日本一级| 久久午夜国产精品| 性久久久久久久久久久久| 国产精品羞羞答答xxdd| 欧美欧美午夜aⅴ在线观看| 国产欧美日韩精品一区| 日韩中文字幕亚洲一区二区va在线 | 欧美日韩精品福利| 国产精品不卡在线| 极品销魂美女一区二区三区| 色悠悠亚洲一区二区| 国产欧美日韩精品在线| 欧美a级一区二区| 91福利国产精品| 亚洲欧美一区二区视频| 经典三级在线一区| 91精品国产91久久久久久最新毛片| 国产精品国产精品国产专区不片| 麻豆国产一区二区| 69堂国产成人免费视频| 亚洲精品国产无天堂网2021| 国产91精品一区二区麻豆网站| 欧美一区二区三区四区视频 | 国产精品美女久久久久aⅴ国产馆| 日本在线观看不卡视频| 欧美性色欧美a在线播放| 亚洲国产高清在线观看视频| 国产原创一区二区三区| 日韩午夜三级在线| 天堂久久久久va久久久久| 在线观看日韩高清av| 一区视频在线播放| 99国产精品久久久| 国产精品精品国产色婷婷| 高清av一区二区| 欧美激情综合网| 成人黄色免费短视频| 国产亚洲精品福利| 国产成人激情av| 国产欧美一区在线| 成人短视频下载| 国产精品成人免费在线| 99国产精品久久久久| 亚洲色图.com| 色婷婷久久久久swag精品| 国产精品久久久99| 一本色道久久综合亚洲aⅴ蜜桃 | 国产成人鲁色资源国产91色综 | 亚洲午夜久久久久久久久电影网 | 亚洲丝袜美腿综合| 色婷婷精品久久二区二区蜜臀av | 色乱码一区二区三区88| 一个色妞综合视频在线观看| 日本韩国一区二区| 亚洲成av人影院| 日韩一区二区三区免费观看| 狠狠色丁香久久婷婷综| 久久精品亚洲国产奇米99| 成人国产精品免费观看| 亚洲精品美国一| 欧美日韩高清一区二区三区| 奇米色777欧美一区二区| 精品处破学生在线二十三| 成人sese在线| 亚洲免费观看在线视频| 欧美日韩一二三| 韩国一区二区三区| 中文字幕一区二区不卡| 欧美三级资源在线| 韩日精品视频一区| 亚洲色欲色欲www| 欧美一区二区成人| 国产成人99久久亚洲综合精品| 日韩毛片视频在线看| 欧美三日本三级三级在线播放| 美国毛片一区二区| 中文字幕亚洲欧美在线不卡| 欧美日韩亚洲综合在线| 国产精品亚洲一区二区三区在线| 亚洲人xxxx|