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

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

?? smlib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
** smDetach - detach CPU from shared memory** This routine ends the "attachment" between the calling CPU and* the shared memory area specified by <pSmDesc>.  No further shared* memory operations may be performed until a subsequent smAttach()* is completed.** RETURNS: OK, or ERROR.** ERRNO: S_smLib_NOT_ATTACHED*/STATUS smDetach    (    SM_DESC *	pSmDesc       /* ptr to shared mem descriptor */    )    {    SM_CPU_DESC volatile * pCpuDesc;  /* ptr to cpu descriptor in sh mem hdr*/    int			   temp;      /* temp value */    /* Check that this cpu is connected to shared memory */    if (pSmDesc->status != SM_CPU_ATTACHED)        {        errno = S_smLib_NOT_ATTACHED;        return (ERROR);                         /* local cpu is not attached */        }    /* get addr of cpu descriptor */    pCpuDesc = (SM_CPU_DESC volatile *) &((pSmDesc->cpuTblLocalAdrs) \                                           [pSmDesc->cpuNum]);    pCpuDesc->status = htonl (SM_CPU_NOT_ATTACHED);/* mark as not attached */    pSmDesc->status  = SM_CPU_NOT_ATTACHED;       /* also mark sh mem descr */    CACHE_PIPE_FLUSH ();			/* FLUSH BUFFER  [SPR 68334] */    temp = pCpuDesc->status;			/* BRIDGE FLUSH  [SPR 68334] */    return (OK);    }/******************************************************************************** smInfoGet - get current status information about shared memory** This routine obtains various pieces of information which describe the* current state of the shared memory area specified by <pSmDesc>.  The* current information is returned in a special data structure, SM_INFO,* whose address is specified by <pInfo>.  The structure must have been* allocated before this routine is called.** RETURNS: OK, or ERROR if this CPU is not attached to shared memory area.** ERRNO: S_smLib_NOT_ATTACHED*/STATUS smInfoGet    (    SM_DESC *	pSmDesc,	/* ptr to shared memory descriptor */    SM_INFO *	pInfo		/* ptr to info structure to fill */    )    {    SM_HDR volatile *	   pHdr;	/* ptr to shared memory header */    SM_CPU_DESC volatile * pCpuDesc;	/* ptr to cpu descriptor */    int			   ix;		/* index variable */    int			   temp;        /* temp value */    /* Check that this cpu is connected to shared memory */    if (pSmDesc->status != SM_CPU_ATTACHED)	{	errno = S_smLib_NOT_ATTACHED;	return (ERROR);				/* local cpu is not attached */	}    /* Get protocol version number */    CACHE_PIPE_FLUSH ();			/* FLUSH BUFFER  [SPR 68334] */    temp = pSmDesc->anchorLocalAdrs->version;	/* PCI bridge bug [SPR 68844]*/    pInfo->version = ntohl (pSmDesc->anchorLocalAdrs->version);    /* Get info from shared memory header */    pHdr = (SM_HDR volatile *) pSmDesc->headerLocalAdrs;    pInfo->tasType     = ntohl (pHdr->tasType);	   /* test-and-set method */    pInfo->maxCpus     = ntohl (pHdr->maxCpus);	   /* max number of cpu's */    /* Get count of attached cpu's starting with first cpu table entry */    pCpuDesc = (SM_CPU_DESC volatile *) pSmDesc->cpuTblLocalAdrs;    pInfo->attachedCpus = 0;    for (ix = 0;  ix < pInfo->maxCpus;  ix++)	{	if (ntohl (pCpuDesc->status) == SM_CPU_ATTACHED)	    pInfo->attachedCpus++;	pCpuDesc++;				/* next entry */	}    return (OK);    }/******************************************************************************** smCpuInfoGet - get information about a single CPU using shared memory** This routine obtains a variety of information describing the CPU specified* by <cpuNum>.  If <cpuNum> is NONE (-1), this routine returns information* about the local (calling) CPU.  The information is returned in a special* structure, SM_CPU_INFO, whose address is specified by <pCpuInfo>.  (The* structure must have been allocated before this routine is called.)** RETURNS: OK, or ERROR.** ERRNO: S_smLib_NOT_ATTACHED, S_smLib_INVALID_CPU_NUMBER*/STATUS smCpuInfoGet    (    SM_DESC *		pSmDesc,	/* ptr to shared memory descriptor */    int			cpuNum,		/* number of cpu to get info about */    SM_CPU_INFO *	pCpuInfo	/* cpu info structure to fill */    )    {    SM_CPU_DESC volatile * pCpuDesc;	/* ptr to cpu descriptor */    int			   temp;        /* temp value */    /* Check that the local cpu is connected to shared memory */    if (pSmDesc->status != SM_CPU_ATTACHED)	{	errno = S_smLib_NOT_ATTACHED;	return (ERROR);				/* local cpu is not attached */	}    /* Report on local cpu if NONE specified */    if (cpuNum == NONE)        {	cpuNum = pSmDesc->cpuNum;        }    /* Get info from cpu descriptor */    if (cpuNum < 0  ||  cpuNum >= pSmDesc->maxCpus)	{	errno = S_smLib_INVALID_CPU_NUMBER;	return (ERROR);				/* cpu number out of range */	}    /* get address of cpu descr */    pCpuDesc = (SM_CPU_DESC volatile *) &(pSmDesc->cpuTblLocalAdrs [cpuNum]);    pCpuInfo->cpuNum  = cpuNum;			   /* actual cpu number */    CACHE_PIPE_FLUSH ();			/* FLUSH BUFFER  [SPR 68334] */    temp = pCpuDesc->status;			/* PCI bridge bug [SPR 68844]*/    pCpuInfo->status  = ntohl (pCpuDesc->status);  /* attached/not attached */    pCpuInfo->intType = ntohl (pCpuDesc->intType); /* interrupt type */    pCpuInfo->intArg1 = ntohl (pCpuDesc->intArg1); /* interrupt argument #1 */    pCpuInfo->intArg2 = ntohl (pCpuDesc->intArg2); /* interrupt argument #2 */    pCpuInfo->intArg3 = ntohl (pCpuDesc->intArg3); /* interrupt argument #3 */    return (OK);    }/******************************************************************************** smLockTake - take a mutual exclusion lock** This routine repeatedly attempts to obtain a mutual exclusion lock* by using the specified test-and-set routine.  If the lock is not* obtained within the specified number of attempts, an error is returned.** If the lock was successfully taken, interrupts will be disabled when* this routine returns and the old interrupt mask level will be copied* to the location pointed to by <pOldLvl>.** If the lock was not taken, interrupts will be enabled upon return (at* the interrupt level which was in effect prior to calling this routine).** This routine does not set errno.** INTERNAL ** RETURNS: OK, or ERROR if lock not taken.*/STATUS smLockTake    (    int *	lockLocalAdrs,	/* local addr of lock */    FUNCPTR	tasRoutine,	/* test-and-set routine to use */    int		numTries,	/* number of times to try to take lock */    int	*	pOldLvl		/* where to put old int lvl if success */    )    {    int         oldLvl;         /* previous interrupt level */    int         delay;          /* time between tries to get lock */    int         ix;		/* index */    int		dummy = 0;	/* dummy counter for delay */    volatile int dummy2;	/* dummy to avoid warning in delay */    int         curNumTries;    /* current number of tries */     /* First try to get lock. */     oldLvl = intLock ();                /* lock out interrupts */    if ((*tasRoutine) (lockLocalAdrs) == TRUE)        {        *pOldLvl = oldLvl;              /* pass back old int level */	/*	 * XXXdat These PIPE_FLUSH operations should not be needed.	 * The tasRoutine should be taking care of the cache issues	 * related to tas activity.	 */	CACHE_PIPE_FLUSH ();		/* flush write buffer */        dummy2 = *(int *)lockLocalAdrs; /* BRIDGE FLUSH  [SPR 68334] */        return (OK);            	/* done! */        }    intUnlock (oldLvl);         /* unlock interrupts before retry */     /*      * The first try has failed so now we insert a decrementing     * delay between each tries to reduce bus contention and deadlock.     *     * Set maximum delay to a different value for each processor.      * Note that this scheme gives a lowest priority to CPUs with     * high processor number. A better version would implement     * a random delay.     */     delay = smLockTakeDelayMin;    curNumTries = 1;     do        {        for (ix = 0; ix <= delay; ix++) /* delay loop */	    dummy2 = dummy++;           /* volatile!! */         oldLvl = intLock ();            /* lock out interrupts */         if ((*tasRoutine) (lockLocalAdrs) == TRUE)            {            *pOldLvl = oldLvl;          /* pass back old int level */	    CACHE_PIPE_FLUSH ();	/* flush write buffer */            dummy2 = *(int *)lockLocalAdrs; /* BRIDGE FLUSH  [SPR 68334] */            return (OK);                /* done! */            }         intUnlock (oldLvl);             /* unlock interrupts before retry */ 	/* Exponential delay, with a limit */	delay <<= 1;	if (delay > smLockTakeDelayMax)	    {	    delay = smLockTakeDelayMin;	    }        curNumTries++;         /* keep track of maximum number of attempts */        if (curNumTries > smCurMaxTries)            {            smCurMaxTries = curNumTries;            }         } while (--numTries > 0);       /* do for spec'd number of tries */     return (ERROR);                     /* cannot take lock */    }/******************************************************************************** smLockGive - give a mutual exclusion lock** This routine gives up a mutual exclusion lock taken previously by smLockTake.** RETURNS: N/A*/void smLockGive    (    int *	lockLocalAdrs,		/* local address of lock */    FUNCPTR	tasClearRoutine,	/* test and set clear routine to use */    int		oldLvl			/* old interrupt level */    )    {    int volatile * pLockv = (int volatile *) lockLocalAdrs;    int            temp;			/* temp value */    if (tasClearRoutine != NULL)	/* hardware test-and-set */        {	(*tasClearRoutine) (lockLocalAdrs);        }    else        {    	*pLockv = 0;        }    CACHE_PIPE_FLUSH ();		/* FLUSH BUFFER  [SPR 68334] */    temp = *pLockv;			/* BRIDGE FLUSH  [SPR 68334] */    intUnlock (oldLvl);    }/******************************************************************************** smRegionFind - find a shared memory region.** This routine finds the shared memory region associated with* <anchorLocalAdrs>.** RETURNS:  index of the region, or ERROR if not found*/LOCAL int smRegionFind    (    SM_ANCHOR *	anchorLocalAdrs		/* local address of anchor */    )    {    int		ix;			/* index */    for (ix = 0; (smRegions [ix].anchor != NULL) && (ix < smRegionsMax); ix++)	{	if (smRegions [ix].anchor == anchorLocalAdrs)	    {	    return (ix);			/* region already initialized*/	    }	}    return (ERROR);    }/******************************************************************************** smRegionGet - get a shared memory region** smRegionGet reserves a space in the smRegion table for a shared memory* region specified by <anchorLocalAdrs>.** RETURNS: the index of the region, or ERROR if out of space.*/LOCAL int smRegionGet    (    SM_ANCHOR *	anchorLocalAdrs		/* anchor address */    )    {    int		ix;			/* index */    for (ix = 0; (smRegions [ix].anchor != NULL) && (ix < smRegionsMax); ix++)	;    if (ix == smRegionsMax)	{	printf ("Out of shared memory regions!!\n");	errno = S_smLib_NO_REGIONS;	return (ERROR);				/* no space in table */	}    smRegions [ix].anchor = anchorLocalAdrs;    return (ix);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲柠檬福利资源导航| 国精产品一区一区三区mba桃花| 日韩 欧美一区二区三区| 成人黄色小视频| 欧美日韩精品一区二区天天拍小说| 26uuu欧美日本| 亚洲一二三四区不卡| 成人污视频在线观看| 欧美一区二区三区四区在线观看| 亚洲天天做日日做天天谢日日欢 | 国产曰批免费观看久久久| 91在线丨porny丨国产| 久久久久久久精| 日韩激情av在线| 欧美亚洲高清一区| 亚洲人成伊人成综合网小说| 成人在线视频一区| 久久久久久日产精品| 日本欧美韩国一区三区| 欧美日韩中文字幕一区二区| 亚洲欧美另类久久久精品| 成人综合婷婷国产精品久久蜜臀 | 成人免费毛片aaaaa**| 欧美电影免费观看高清完整版在 | 日韩一级片在线播放| 亚洲地区一二三色| 欧美午夜精品一区二区三区| 亚洲欧美色综合| 91麻豆国产精品久久| 一区免费观看视频| av午夜精品一区二区三区| 国产精品久久久久婷婷| 成人av电影在线网| 最新不卡av在线| 色成人在线视频| 一区二区三区成人在线视频| 欧美自拍丝袜亚洲| 丝袜亚洲另类欧美综合| 欧美一区二区三区视频| 毛片一区二区三区| 欧美精品一区二区不卡 | 91视频一区二区| 亚洲男女一区二区三区| 欧美中文字幕亚洲一区二区va在线| 亚洲精选视频在线| 欧美视频一区二| 日本不卡1234视频| 亚洲精品一区二区三区福利| 国产精品影视在线观看| 中文字幕一区二区三区蜜月| 99久久婷婷国产综合精品电影 | 国产日韩欧美a| 97久久久精品综合88久久| 一区二区三区蜜桃网| 91精品国产色综合久久不卡电影| 六月丁香婷婷色狠狠久久| 国产欧美一区二区在线| 欧美系列在线观看| 精品一区二区三区视频在线观看| 久久久久国产精品厨房| 91蜜桃在线免费视频| 日本亚洲视频在线| 国产精品久久久久久久浪潮网站| 在线免费观看日本欧美| 裸体一区二区三区| 亚洲图片另类小说| 欧美一区二区成人6969| 成人毛片视频在线观看| 午夜精品视频一区| 国产精品久久久久影院老司| 91精品欧美久久久久久动漫| 国产精品18久久久久久久久久久久 | 伊人性伊人情综合网| 91精品欧美久久久久久动漫| 岛国av在线一区| 蜜臀av性久久久久蜜臀aⅴ| 国产精品第四页| 欧美一区二区三区视频在线观看| 99精品黄色片免费大全| 麻豆91在线观看| 一区二区在线观看av| 久久午夜老司机| 欧美肥妇bbw| 99精品国产热久久91蜜凸| 久久se精品一区精品二区| 亚洲国产欧美在线| ㊣最新国产の精品bt伙计久久| 欧美电影精品一区二区| 欧美网站一区二区| 一本色道亚洲精品aⅴ| 风间由美一区二区av101| 蜜臀精品一区二区三区在线观看 | 国产精品入口麻豆九色| 日韩欧美一区在线观看| 在线观看国产91| 成人免费看视频| 欧美精品在线观看一区二区| 免费不卡在线观看| 欧美日韩综合在线免费观看| av不卡一区二区三区| 免费在线观看一区| 亚洲18影院在线观看| 亚洲一区二区三区爽爽爽爽爽| 中文字幕欧美国产| 久久亚洲一区二区三区四区| 日韩一区二区视频| 3atv在线一区二区三区| 欧美男男青年gay1069videost | 免费观看91视频大全| 日韩在线一二三区| 亚洲成人在线免费| 亚洲国产精品久久不卡毛片 | 精品一区二区免费| 久久国产精品第一页| 美女被吸乳得到大胸91| 日本 国产 欧美色综合| 免费日韩伦理电影| 美女视频一区二区三区| 美腿丝袜亚洲一区| 国产裸体歌舞团一区二区| 国产老女人精品毛片久久| 国产精品一区二区无线| 成人国产视频在线观看| 色婷婷狠狠综合| 欧美色爱综合网| 日韩欧美中文字幕精品| 久久亚洲综合色| 中文字幕制服丝袜一区二区三区 | 在线视频观看一区| 欧美午夜一区二区三区| 成人小视频免费观看| 一本大道久久精品懂色aⅴ| 成人短视频下载| 欧美色综合网站| 91精品国产欧美日韩| 久久女同精品一区二区| 欧美激情一区三区| 一区二区三区av电影| 视频一区中文字幕| 国产一区二区三区精品欧美日韩一区二区三区 | 亚洲欧洲精品成人久久奇米网| 亚洲色图制服丝袜| 偷窥国产亚洲免费视频| 久久9热精品视频| 色哟哟一区二区| 91精品国产91久久久久久最新毛片 | 国产情人综合久久777777| 中文字幕中文字幕在线一区| 亚洲一区二区三区四区的| 激情都市一区二区| 91蜜桃网址入口| 日韩亚洲电影在线| 日韩美女啊v在线免费观看| 日韩va欧美va亚洲va久久| 国产激情视频一区二区三区欧美 | 亚洲午夜精品一区二区三区他趣| 久久精品国产精品亚洲精品| 99精品国产99久久久久久白柏| 欧美高清你懂得| 中文字幕成人在线观看| 亚洲成av人片在www色猫咪| 国产一区二区三区国产| 欧美人妖巨大在线| 国产精品美女久久福利网站| 日本视频在线一区| 99久久国产综合精品色伊 | 麻豆精品一区二区综合av| 色激情天天射综合网| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 国产精品久久久久久久久搜平片| 亚洲午夜久久久久久久久久久| 另类小说欧美激情| 欧美日韩在线综合| 亚洲欧洲一区二区在线播放| 狠狠色丁香婷综合久久| 欧美三级韩国三级日本三斤| 国产精品麻豆久久久| 久久97超碰色| 在线观看91精品国产麻豆| 亚洲黄色免费网站| 欧美日韩一区精品| 亚洲欧美综合在线精品| 国产在线看一区| 日韩欧美国产一区二区三区| 一区二区三区日韩在线观看| 不卡视频在线看| 久久免费看少妇高潮| 日韩国产在线观看一区| 91国内精品野花午夜精品| 中文字幕av资源一区| 国产成人免费9x9x人网站视频| 精品免费国产一区二区三区四区| 日韩vs国产vs欧美| 5566中文字幕一区二区电影| 亚洲伊人伊色伊影伊综合网| 91九色最新地址| 亚洲夂夂婷婷色拍ww47| 欧美在线视频不卡| 香港成人在线视频| 欧美日韩国产首页在线观看|