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

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

?? smfixblklib.c

?? vxworks的完整的源代碼
?? C
字號:
/* smFixBlkLib.c - VxWorks fixed block shared memory manager (VxMP Option) *//* Copyright 1984-2002 Wind River Systems, Inc. *//*modification history--------------------01g,03may02,mas  cache flush and volatile fix (SPR 68334); bridge flush fix		 (SPR 68844)01f,24oct01,mas  doc update (SPR 71149)01e,20sep01,jws  correct partition spin-lock tries calc (SPR68418)01d,29jan93,pme  added little endian support.                 added #include "private/smObjLibP.h".		 changed MEM_ROUND_UP() to ROUND_UP() in smFixBlkPartInit().01c,02oct92,pme  added SPARC support.01b,27jul92,pme  added lock timeout failure notification.01a,19jul92,pme  written.*//*DESCRIPTIONThis library provides a simple facility for managing the allocation of fixed size blocks of shared memory from ranges of memory called fixed block size shared memory partitions.There are no user callable routines.A shared memory fixed block partition is created when the shared memory object facility (VxMP) is installed during system startup by VxWorksinitialization code calling smObjSetup().This memory allocator is only used to allocate shared TCBs in shared memoryand is provided to give a lower interrupt lattency than the standard variable block size shared memory manager.The allocation of a block is done via smFixBlkPartAlloc() and freeing a blockis done via smFixBlkPartFree().AVAILABILITYThis module is distributed as a component of the unbundled shared memorysupport option, VxMP.INTERNALThe fixed block memory partition header is stored in the shared memory headerreachable by all CPUs in the system.There is no overhead per allocated block since blocks have no headers. Thefirst 8 bytes of each block are used as doubly linked list nodes when blocks are in the free list but they are part of the block when it isallocated to user.No validity checking is done on blocks passed to smFixBlkPartFree().INCLUDE FILE: smFixBlkLib.hSEE ALSO: smObjLibNOROUTINES*//* includes */#include "vxWorks.h"#include "memLib.h"#include "smObjLib.h"#include "smLib.h"#include "intLib.h"#include "smMemLib.h"#include "string.h"#include "taskLib.h"#include "cacheLib.h"#include "errno.h"#include "netinet/in.h"#include "private/smObjLibP.h"#include "private/smFixBlkLibP.h"/* defines */				/* locals *//* number of tries to get access to a shared fixed block memory partition */LOCAL int smFixBlkSpinTries;/******************************************************************************** smFixBlkPartInit - initialize a fixed block shared memory partition** smFixBlkPartInit initializes a shared fixed block memory partition.* This function is used in smObjInit to initialize the shared TCB* partition.* * <gPartId> is the global (system wide) identifier of the partition to * initialize. Its value is the global address of the partition structure. ** <pPool> is the global address of shared memory dedicated to * the fixed block partition.** <poolSize> is the size in bytes of shared memory dedicated to the partition.** <blockSize> is the size in bytes of each block in the partition.** NOMANUAL*/void smFixBlkPartInit     (    SM_FIX_BLK_PART_ID gPartId,   /* global id of partition to initialize */    char *             pPool,     /* global adress of memory pool */    unsigned           poolSize,  /* pool size in bytes */    unsigned           blockSize  /* block size in bytes */    )    {    SM_FIX_BLK_PART_ID volatile partId; /* local addr of partition to init */    int                         memLeft;    char *                      tmp;    int                         numBlock = 0;    int                         temp;   /* temp storage */    partId = (SM_FIX_BLK_PART_ID volatile) GLOB_TO_LOC_ADRS (gPartId);    /* initialize partition descriptor */    bzero ((char *) partId, sizeof (SM_FIX_BLK_PART));    partId->blockSize = htonl (blockSize);    /* insure that the pool starts on an even byte boundary */    tmp       = (char *) ROUND_UP (pPool, 4);	/* get actual start */    poolSize -= tmp - pPool;			/* adjust length */    pPool     = (char *) GLOB_TO_LOC_ADRS (tmp);/* convert to local address */    memLeft = poolSize;    /* initialize free list */    smDllInit (&partId->freeList);    /* Insert blocks in the free list */    while (memLeft >= blockSize)	{        smDllAdd (&partId->freeList, (SM_DL_NODE *) pPool);	numBlock ++;	pPool += blockSize;	memLeft -= blockSize;	}    /*     * initialize number of tries to get partition spin-lock     * smObjSpinTries has been set to config param SM_OBJ_MAX_TRIES     * before the call to this routine     */    smFixBlkSpinTries = smObjSpinTries;    partId->totalBlocks = htonl (numBlock);    partId->objType = htonl (MEM_PART_TYPE_SM_FIX);    partId->verify = (UINT32) htonl (LOC_TO_GLOB_ADRS (partId));    CACHE_PIPE_FLUSH ();                        /* CACHE FLUSH   [SPR 68334] */    temp = partId->verify;                      /* BRIDGE FLUSH  [SPR 68334] */    } /******************************************************************************** smFixBlkPartAlloc - allocate a block of memory from fixed block partition** From a specified fixed block shared partition, this routine * allocates one block of memory whose size is equal to the partition blockSize.* The fixed block partition must have been previously initialized * with smFixBlkPartInit().** <gPartId> is the global (system wide) identifier of the partition to * use. Its value is the global address of the partition structure. ** RETURNS:* A local adress of a block, or* NULL if the call fails.** ERRNO:**   S_objLib_OBJ_ID_ERROR**   S_memLib_NOT_ENOUGH_MEMORY**   S_smObjLib_LOCK_TIMEOUT** SEE ALSO: smFixBlkPartInit()** NOMANUAL*/void * smFixBlkPartAlloc     (    SM_FIX_BLK_PART_ID gPartId /* global id of partition to allocate from */    )    {    SM_FIX_BLK_PART_ID volatile partId; /* local address of partition */    void *			pBlock; /* local addr of allocated block */    int                         level;    int                         temp;   /* temp storage */    partId = (SM_FIX_BLK_PART_ID volatile) GLOB_TO_LOC_ADRS (gPartId);    CACHE_PIPE_FLUSH ();                        /* CACHE FLUSH   [SPR 68334] */    temp = partId->verify;                      /* PCI bridge bug [SPR 68844]*/    if (SM_OBJ_VERIFY (partId) != OK)        return (NULL);    /* ENTER LOCKED SECTION */	    if (smLockTake ((int *) &partId->lock, smObjTasRoutine, 		   smFixBlkSpinTries, &level) != OK)	{	smObjTimeoutLogMsg ("smFixBlkPartAlloc", (char *) &partId->lock);	return (NULL);				/* can't take lock */	}    pBlock = (void *) smDllGet (&partId->freeList); /* get a free block */    if (pBlock == LOC_NULL)			/* no more free blocks */	{        /* EXIT LOCKED SECTION */        SM_OBJ_LOCK_GIVE ((SM_SEM_ID) &partId->lock, level);	errno = S_memLib_NOT_ENOUGH_MEMORY;	return (NULL);	}    /* update allocation statistics */    CACHE_PIPE_FLUSH ();                        /* CACHE FLUSH   [SPR 68334] */    temp = partId->curBlocksAllocated;          /* PCI bridge bug [SPR 68844]*/    partId->curBlocksAllocated = htonl (ntohl (partId->curBlocksAllocated) +1);    partId->cumBlocksAllocated = htonl (ntohl (partId->cumBlocksAllocated) +1);    CACHE_PIPE_FLUSH ();                        /* CACHE FLUSH   [SPR 68334] */    temp = partId->curBlocksAllocated;          /* BRIDGE FLUSH  [SPR 68334] */    /* EXIT LOCKED SECTION */    SM_OBJ_LOCK_GIVE ((SM_SEM_ID) &partId->lock, level);    return ((void *) pBlock);    }/******************************************************************************** smFixBlkPartFree - give back a block to a fixed block shared partition** This routine takes a block of memory previously allocated with* smFixBlkPartAlloc() and returns it to the shared partition's free memory list.** <gPartId> is the global (system wide) identifier of the partition to * use. Its value is the global address of the partition structure. ** <pBlock> is a local address of a shared memory block previously allocated* by smFixBlkPartAlloc.** WARNING: No validy check is done on <pBlock>.** RETURNS: OK or ERROR if partition id is invalid.** ERRNO:**   S_objLib_OBJ_ID_ERROR:**   S_smObjLib_LOCK_TIMEOUT:** NOMANUAL*/STATUS smFixBlkPartFree     (    SM_FIX_BLK_PART_ID gPartId, /* global id of partition to use */    char *             pBlock   /* pointer to block of memory to be freed */    )    {    SM_FIX_BLK_PART_ID volatile partId; /* local address of partition to use */    int                         level;    int                         temp;   /* temp storage */    partId = (SM_FIX_BLK_PART_ID volatile) GLOB_TO_LOC_ADRS (gPartId);    CACHE_PIPE_FLUSH ();                        /* CACHE FLUSH   [SPR 68334] */    temp = partId->verify;                      /* PCI bridge bug [SPR 68844]*/    if (SM_OBJ_VERIFY (partId) != OK)        return (ERROR);    if (pBlock == NULL)	return (OK);				/* ANSI C compatibility */    /*      * If attempt to take lock fails here we only return ERROR,     * we do not notify the failure since this function is only called     * in taskDelete which will send a WARNING.     */    						/* ENTER LOCKED SECTION */	    if (smLockTake ((int *) &partId->lock, smObjTasRoutine,                    smFixBlkSpinTries, &level) != OK)	return (ERROR);				/* can't take lock */    /* add the block to the free list */    smDllInsert ((SM_DL_LIST *) &partId->freeList, (SM_DL_NODE *) NULL,		 (SM_DL_NODE *) (pBlock));    /* adjust allocation statistics */    CACHE_PIPE_FLUSH ();                        /* CACHE FLUSH   [SPR 68334] */    temp = partId->curBlocksAllocated;          /* PCI bridge bug [SPR 68844]*/    partId->curBlocksAllocated = htonl (ntohl (partId->curBlocksAllocated) - 1);    CACHE_PIPE_FLUSH ();                        /* CACHE FLUSH   [SPR 68334] */    temp = partId->curBlocksAllocated;          /* BRIDGE FLUSH  [SPR 68334] */    /* EXIT LOCKED SECTION */    SM_OBJ_LOCK_GIVE ((SM_SEM_ID) &partId->lock, level);    return (OK);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一二三四五| 精品不卡在线视频| 国产亚洲午夜高清国产拍精品| 婷婷久久综合九色综合绿巨人| 国内精品写真在线观看| 欧美一区国产二区| 日本一不卡视频| 欧美福利视频导航| 石原莉奈一区二区三区在线观看 | 久久激情五月激情| 欧美亚洲一区二区三区四区| 亚洲视频一区二区在线观看| 不卡一卡二卡三乱码免费网站| 亚洲国产精品精华液2区45| 国产精品一二三在| 欧美国产亚洲另类动漫| 国产精品羞羞答答xxdd| 久久久青草青青国产亚洲免观| 狠狠色狠狠色综合系列| 久久久久9999亚洲精品| 高清视频一区二区| 国产精品传媒视频| 色综合久久九月婷婷色综合| 伊人开心综合网| 777午夜精品免费视频| 奇米精品一区二区三区四区 | 国产色产综合色产在线视频| 91在线视频免费91| 五月婷婷激情综合| 亚洲国产高清不卡| 5月丁香婷婷综合| proumb性欧美在线观看| 日产精品久久久久久久性色| 中文一区二区完整视频在线观看| 欧美色图激情小说| 国v精品久久久网| 免费日本视频一区| 亚洲欧美电影一区二区| 亚洲精品在线电影| 欧美日韩黄视频| 成人激情校园春色| 麻豆国产一区二区| 亚洲精品中文字幕乱码三区| 精品乱人伦一区二区三区| 91污在线观看| 成人免费看视频| 久久99日本精品| 午夜伦欧美伦电影理论片| 亚洲日本丝袜连裤袜办公室| 26uuu亚洲| 9191精品国产综合久久久久久 | 色欧美片视频在线观看| 国产一区久久久| 日本中文字幕一区二区视频 | 久久综合色之久久综合| 欧美另类高清zo欧美| 91免费视频网| 99在线热播精品免费| 国产精品一区二区久久不卡| 日产国产高清一区二区三区| 亚洲国产精品久久一线不卡| 亚洲色图都市小说| 中文字幕在线视频一区| 欧美国产精品一区二区三区| 精品国产91九色蝌蚪| 欧美一区二区三区在| 精品视频一区三区九区| 91传媒视频在线播放| 91在线视频网址| 91网站最新地址| 91猫先生在线| 色悠悠亚洲一区二区| 91浏览器打开| 色婷婷综合久久久中文一区二区| 成人av电影在线| 成人免费观看男女羞羞视频| 成人一道本在线| 93久久精品日日躁夜夜躁欧美| 成人的网站免费观看| 97国产一区二区| 一本一道综合狠狠老| 色拍拍在线精品视频8848| 91久久一区二区| 欧美日韩一区在线观看| 欧美三级一区二区| 在线成人午夜影院| 欧美大片一区二区| 久久久噜噜噜久噜久久综合| 精品91自产拍在线观看一区| 久久久蜜桃精品| **网站欧美大片在线观看| 亚洲视频一二区| 亚洲6080在线| 久久99精品久久久久久久久久久久| 免费日韩伦理电影| 国产成人精品在线看| 成人天堂资源www在线| 99国产精品久久久久久久久久| 在线视频一区二区三区| 欧美色图免费看| 精品国产污网站| 欧美国产日产图区| 亚洲国产综合色| 久久不见久久见免费视频1| 国产 日韩 欧美大片| 欧美在线免费观看亚洲| 91精品国产欧美一区二区 | 久久久久久夜精品精品免费| 国产精品国产三级国产普通话99| 亚洲欧美日韩久久| 日本欧美在线观看| 风间由美性色一区二区三区| 欧美性xxxxx极品少妇| 精品国产免费人成电影在线观看四季| 国产精品天天摸av网| 一个色综合网站| 精品一区二区三区久久| 91麻豆免费视频| 日韩欧美中文字幕精品| 国产蜜臀av在线一区二区三区| 亚洲综合在线第一页| 精品亚洲aⅴ乱码一区二区三区| 成人app在线| 欧美一级电影网站| 亚洲手机成人高清视频| 极品瑜伽女神91| 在线观看精品一区| 国产欧美日韩精品a在线观看| 一区二区三区丝袜| 国产精品一区一区三区| 欧美日韩在线播| 亚洲欧美另类久久久精品| 美女在线视频一区| 欧美日韩亚洲综合一区| 亚洲国产电影在线观看| 久久精品国产免费| 欧美日韩欧美一区二区| 国产精品女同一区二区三区| 蜜乳av一区二区三区| 日本高清成人免费播放| 国产视频视频一区| 久久成人羞羞网站| 7777精品伊人久久久大香线蕉 | 精品视频在线免费观看| 国产精品久久久久久久久图文区| 久久99精品国产.久久久久久 | 一区二区三区在线观看国产| 国产精品996| 精品少妇一区二区三区免费观看| 亚洲永久免费av| 91视频在线看| 国产精品传媒视频| 成人av在线电影| 国产欧美精品一区二区色综合朱莉| 麻豆精品一区二区三区| 欧美男女性生活在线直播观看| 亚洲欧美乱综合| 色偷偷久久人人79超碰人人澡| 中文字幕一区免费在线观看| 成人高清在线视频| 中文av一区二区| 不卡一区二区在线| 中文字幕色av一区二区三区| 粉嫩13p一区二区三区| 欧美国产视频在线| 成人黄色在线视频| 亚洲视频免费在线| 91麻豆国产自产在线观看| 日本一区二区三区免费乱视频| 国产成人精品三级麻豆| 国产日产欧美一区| 成人性色生活片免费看爆迷你毛片| 日本一区二区在线不卡| zzijzzij亚洲日本少妇熟睡| 亚洲欧洲日本在线| 色欧美日韩亚洲| 五月天婷婷综合| 5858s免费视频成人| 麻豆精品新av中文字幕| 久久亚洲欧美国产精品乐播 | 日韩女同互慰一区二区| 久久www免费人成看片高清| 久久久综合精品| 丰满少妇在线播放bd日韩电影| 亚洲色图欧美激情| 9191精品国产综合久久久久久| 蜜桃91丨九色丨蝌蚪91桃色| 久久久五月婷婷| 色综合久久天天| 免费观看一级特黄欧美大片| 精品国产区一区| 成人h动漫精品一区二| 日韩理论片一区二区| 欧美日韩二区三区| 狠狠久久亚洲欧美| 中文字幕欧美日韩一区| 在线观看一区二区视频| 免费看欧美女人艹b| 中文字幕日韩av资源站| 91精品黄色片免费大全|