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

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

?? cachearchlib.c

?? vxwork源代碼
?? C
字號:
/* cacheArchLib.c - I80X86 cache management library *//* Copyright 1984-2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01r,15apr02,pai  Removed sysCpuProbe() call, as the CPU probe is separated                 from the cache library configuration (SPR 74951).01q,07mar02,hdn  added CLFLUSH macros.  cleaned up (spr 73360)01p,04dec01,hdn  made SNOOP_ENABLE dataMode independent of CPU type		 added cacheArchDmaMallocSnoop() and cacheArchDmaFreeSnoop()01o,20nov01,hdn  doc clean up for 5.501n,02nov01,hdn  enabled SSE and SSE2.01m,23aug01,hdn  added PENTIUM4 support01l,15feb99,hdn  added support for PentiumPro's bus snoop.01k,09apr98,hdn  added support for PentiumPro.01j,17jun96,hdn  stopped to use a return value of sysCpuProbe().01i,21sep95,hdn  added support for NS486.01h,01nov94,hdn  added a check of sysProcessor for Pentium01g,27oct94,hdn  cleaned up.01f,04oct94,hdn  added a checking and setting the cache mode.01e,29may94,hdn  changed a macro I80486 to sysProcessor.01d,05nov93,hdn  added cacheArchFlush().01c,30jul93,hdn  added cacheArchDmaMalloc(), cacheArchDmaFree().01b,27jul93,hdn  added cacheArchClearEntry().01a,08jun93,hdn  written.*//*DESCRIPTIONThis library contains architecture-specific cache library functions forthe Intel 80X86 family caches.The 386 family does not have a cache, though it has the prefetch queue.  The 486 family includes a unified L1 cache for both instructions and data.The P5(Pentium) family includes separate L1 instruction and data caches.  The data cache supports a writeback or writethrough update policy.The P6(PentiumPro, II, III) family includes a separate L1 instruction and data caches, and unified internal L2 cache.  The MESI cache protocol maintains consistency in the L1 and L2 caches in both uni-processor andmulti-processor system.  The P7(Pentium4) family includes the trace cache that caches decoded instructions, L1 data cache and L2 unified cache.  The CLFLUSH instruction allows selected cache line to be flushed from memory.INCLUDE FILES: cacheLib.hSEE ALSO: cacheLib, vmLib, Intel Architecture Software Developer's Manual*//* LINTLIBRARY */#include "vxWorks.h"#include "errnoLib.h"#include "cacheLib.h"#include "stdlib.h"#include "private/memPartLibP.h"#include "private/vmLibP.h"#include "private/funcBindP.h"#include "regs.h"/* externals */IMPORT UINT sysProcessor;IMPORT CPUID sysCpuId;/* globals */int cacheFlushBytes = CLFLUSH_DEF_BYTES; /* def bytes flushed by CLFLUSH *//* forward declarations */LOCAL void * cacheArchDmaMallocSnoop	(size_t bytes);LOCAL STATUS cacheArchDmaFreeSnoop	(void * pBuf);/********************************************************************************* cacheArchLibInit - initialize the cache library* * This routine initializes the cache library for Intel 80X86* processors.  The caching mode CACHE_WRITETHROUGH is available for the x86* processor family.  It initializes the function pointers.** RETURNS: OK.*/STATUS cacheArchLibInit    (    CACHE_MODE	instMode,	/* instruction cache mode */    CACHE_MODE	dataMode	/* data cache mode */    )    {    static BOOL cacheArchLibInitDone = FALSE;    if (!cacheArchLibInitDone)			/* do it only once */        {	/* get bytes flushed by CLFLUSH instruction if supported */	if (sysCpuId.featuresEdx & CPUID_CLFLUSH)	    cacheFlushBytes = (sysCpuId.featuresEbx & CPUID_CHUNKS) >> 5;	cacheArchLibInitDone = TRUE;		/* mark the done-flag TRUE */        }    /* 386 family does not have cache and WBINVD instruction */    if (sysProcessor != X86CPU_386)	{        cacheLib.enableRtn	= cacheArchEnable;	/* cacheEnable() */        cacheLib.disableRtn	= cacheArchDisable;	/* cacheDisable() */        cacheLib.lockRtn	= cacheArchLock;	/* cacheLock() */        cacheLib.unlockRtn	= cacheArchUnlock;	/* cacheUnlock() */        cacheLib.dmaMallocRtn	= (FUNCPTR)cacheArchDmaMalloc;        cacheLib.dmaFreeRtn	= (FUNCPTR)cacheArchDmaFree;        cacheLib.dmaVirtToPhysRtn = NULL;        cacheLib.dmaPhysToVirtRtn = NULL;        cacheLib.textUpdateRtn	= NULL;	/* note: return type of cachePen4Flush() and cacheI86Flush() are void */        if (sysCpuId.featuresEdx & CPUID_CLFLUSH)	/* cacheFlush() */	    {            cacheLib.flushRtn	   = (FUNCPTR)cachePen4Flush;	/* w CLFLUSH */	    cacheLib.clearRtn	   = (FUNCPTR)cachePen4Clear;	/* w CLFLUSH */            cacheLib.invalidateRtn = (FUNCPTR)cachePen4Clear;	/* w CLFLUSH */	    }	else	    {            cacheLib.flushRtn	   = (FUNCPTR)cacheI86Flush;	/* w WBINVD */	    cacheLib.clearRtn	   = (FUNCPTR)cacheI86Clear;	/* w WBINVD */            cacheLib.invalidateRtn = (FUNCPTR)cacheI86Clear;	/* w WBINVD */	    }        cacheLib.pipeFlushRtn	= NULL;	}    /* fully coherent cache needs nothing */    if (dataMode & CACHE_SNOOP_ENABLE)	{        cacheLib.lockRtn	= NULL;			/* cacheLock() */        cacheLib.unlockRtn	= NULL;			/* cacheUnlock() */        cacheLib.clearRtn	= NULL;			/* cacheClear() */        cacheLib.dmaMallocRtn   = (FUNCPTR)cacheArchDmaMallocSnoop;        cacheLib.dmaFreeRtn	= (FUNCPTR)cacheArchDmaFreeSnoop;        cacheLib.flushRtn	= NULL;			/* cacheFlush() */        cacheLib.invalidateRtn  = NULL;			/* cacheClear() */	}    /* check for parameter errors */    if ((instMode & CACHE_WRITEALLOCATE)	|| 	(dataMode & CACHE_WRITEALLOCATE)	||        (instMode & CACHE_NO_WRITEALLOCATE)	|| 	(dataMode & CACHE_NO_WRITEALLOCATE)	||        (instMode & CACHE_BURST_ENABLE)		|| 	(dataMode & CACHE_BURST_ENABLE)		||        (instMode & CACHE_BURST_DISABLE)	|| 	(dataMode & CACHE_BURST_DISABLE))	return (ERROR);    /* reset to the known state(disabled), since the current mode is unknown */    if (sysProcessor != X86CPU_386)        cacheI86Reset ();			/* reset and disable a cache */    cacheDataMode	= dataMode;		/* save dataMode for enable */    cacheDataEnabled	= FALSE;		/* d-cache is currently off */    cacheMmuAvailable	= FALSE;		/* no mmu yet */    return (OK);    }/********************************************************************************* cacheArchEnable - enable a cache** This routine enables the cache.** RETURNS: OK.** NOMANUAL*/STATUS cacheArchEnable    (    CACHE_TYPE	cache		/* cache to enable */    )    {    cacheI86Enable ();    if (cache == DATA_CACHE)	{	cacheDataEnabled = TRUE;	cacheFuncsSet ();	}    return (OK);    }/********************************************************************************* cacheArchDisable - disable a cache** This routine disables the cache.** RETURNS: OK.** NOMANUAL*/STATUS cacheArchDisable    (    CACHE_TYPE	cache		/* cache to disable */    )    {    cacheI86Disable ();    if (cache == DATA_CACHE)	{	cacheDataEnabled = FALSE;		/* data cache is off */	cacheFuncsSet ();			/* update data function ptrs */	}    return (OK);    }/********************************************************************************* cacheArchLock - lock entries in a cache** This routine locks all entries in the cache.** RETURNS: OK.** NOMANUAL*/STATUS cacheArchLock    (    CACHE_TYPE	cache, 		/* cache to lock */    void *	address,	/* address to lock */    size_t	bytes		/* bytes to lock (ENTIRE_CACHE) */    )    {    cacheI86Lock ();    return (OK);    }/********************************************************************************* cacheArchUnlock - unlock a cache** This routine unlocks all entries in the cache.** RETURNS: OK.** NOMANUAL*/STATUS cacheArchUnlock    (    CACHE_TYPE	cache, 		/* cache to unlock */    void *	address,	/* address to unlock */    size_t	bytes		/* bytes to unlock (ENTIRE_CACHE) */    )    {    cacheI86Unlock ();    return (OK);    }/********************************************************************************* cacheArchClear - clear all entries from a cache** This routine clears all entries from the cache.  ** RETURNS: OK.** NOMANUAL*/STATUS cacheArchClear    (    CACHE_TYPE	cache, 		/* cache to clear */    void *	address,	/* address to clear */    size_t	bytes		/* bytes to clear */    )    {    if (sysCpuId.featuresEdx & CPUID_CLFLUSH)	cachePen4Clear (cache, address, bytes);    else	WRS_ASM ("wbinvd");    return (OK);    }/********************************************************************************* cacheArchFlush - flush all entries from a cache** This routine flushs all entries from the cache.  ** RETURNS: OK.** NOMANUAL*/STATUS cacheArchFlush    (    CACHE_TYPE	cache, 		/* cache to clear */    void *	address,	/* address to clear */    size_t	bytes		/* bytes to clear */    )    {    if (sysCpuId.featuresEdx & CPUID_CLFLUSH)	cachePen4Flush (cache, address, bytes);    else	WRS_ASM ("wbinvd");    return (OK);    }/********************************************************************************* cacheArchClearEntry - clear an entry from a cache** This routine clears a specified entry from the cache.* The 386 family processors do not have a cache, thus it does nothing.  The 486, * P5(Pentium), and P6(PentiumPro, II, III) family processors do have a cache but * does not support a line by line cache control, thus it performs WBINVD * instruction.  The P7(Pentium4) family processors support the line by line * cache control with CLFLUSH instruction, thus flushes the specified cache line.** RETURNS: OK*/STATUS cacheArchClearEntry    (    CACHE_TYPE	cache,		/* cache to clear entry for */    void *	address		/* entry to clear */    )    {    if (sysProcessor == X86CPU_386)        return (OK);    if (sysCpuId.featuresEdx & CPUID_CLFLUSH)	cachePen4Clear (cache, address, cacheFlushBytes);    else	WRS_ASM ("wbinvd");    return (OK);    }/********************************************************************************* cacheArchDmaMalloc - allocate a cache-safe buffer** This routine attempts to return a pointer to a section of memory* that will not experience cache coherency problems.  This routine* is only called when MMU support is available * for cache control.** INTERNAL* We check if the cache is actually on before allocating the memory.  It* is possible that the user wants Memory Management Unit (MMU)* support but does not need caching.** RETURNS: A pointer to a cache-safe buffer, or NULL.** SEE ALSO: cacheArchDmaFree(), cacheDmaMalloc()** NOMANUAL*/void *cacheArchDmaMalloc     (    size_t      bytes			/* size of cache-safe buffer */    )    {    void *pBuf;    int	  pageSize;    if ((pageSize = VM_PAGE_SIZE_GET ()) == ERROR)	return (NULL);    /* make sure bytes is a multiple of pageSize */    bytes = ROUND_UP (bytes, pageSize);    if ((_func_valloc == NULL) || 	((pBuf = (void *)(* _func_valloc) (bytes)) == NULL))	return (NULL);    VM_STATE_SET (NULL, pBuf, bytes,		  VM_STATE_MASK_CACHEABLE, VM_STATE_CACHEABLE_NOT);    return (pBuf);    }	/********************************************************************************* cacheArchDmaFree - free the buffer acquired by cacheArchDmaMalloc()** This routine returns to the free memory pool a block of memory previously* allocated with cacheArchDmaMalloc().  The buffer is marked cacheable.** RETURNS: OK, or ERROR if cacheArchDmaMalloc() cannot be undone.** SEE ALSO: cacheArchDmaMalloc(), cacheDmaFree()** NOMANUAL*/STATUS cacheArchDmaFree    (    void *pBuf		/* ptr returned by cacheArchDmaMalloc() */    )    {    BLOCK_HDR *	pHdr;			/* pointer to block header */    STATUS	status = OK;		/* return value */    if (vmLibInfo.vmLibInstalled)	{	pHdr = BLOCK_TO_HDR (pBuf);	status = VM_STATE_SET (NULL,pBuf,(pHdr->nWords * 2) - sizeof(BLOCK_HDR),			       VM_STATE_MASK_CACHEABLE, VM_STATE_CACHEABLE);	}    free (pBuf);			/* free buffer after modified */    return (status);    }/********************************************************************************* cacheArchDmaMallocSnoop - allocate a cache line aligned buffer** This routine attempts to return a pointer to a section of memory in the* SNOOP_ENABLED cache mode.  This routine is called regardless of the current* MMU or CACHE status.  And does not change cache attribute of the buffer.** RETURNS: A pointer to a cache line aligned buffer, or NULL.** SEE ALSO: cacheArchDmaFreeSnoop(), cacheDmaMalloc()** NOMANUAL*/LOCAL void * cacheArchDmaMallocSnoop     (    size_t      bytes			/* size of cache-safe buffer */    )    {    void * pBuf;    /* make sure bytes is a multiple of cache line size */    bytes = ROUND_UP (bytes, _CACHE_ALIGN_SIZE);    /* allocate memory at cache line boundary */    if ((pBuf = memalign (_CACHE_ALIGN_SIZE, bytes)) == NULL)	return (NULL);    return (pBuf);    }	/********************************************************************************* cacheArchDmaFreeSnoop - free the buffer acquired by cacheArchDmaMallocSnoop()** This routine returns to the free memory pool a block of memory previously* allocated with cacheArchDmaMallocSnoop().  The cache attribute of the buffer * does not change.** RETURNS: OK always.** SEE ALSO: cacheArchDmaMallocSnoop(), cacheDmaFree()** NOMANUAL*/LOCAL STATUS cacheArchDmaFreeSnoop    (    void * pBuf		/* ptr returned by cacheArchDmaMallocSnoop() */    )    {    free (pBuf);		/* free buffer */    return (OK);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产伦理精品不卡| 亚洲精品国产品国语在线app| 久久亚区不卡日本| 成人午夜大片免费观看| 欧美综合视频在线观看| 九色|91porny| 亚洲综合视频网| 国产日韩成人精品| 欧美一区二区三区色| av网站一区二区三区| 久久99深爱久久99精品| 亚洲一区二区三区视频在线| 国产日韩欧美制服另类| 日韩一级精品视频在线观看| 色综合久久中文字幕| 国产成人一级电影| 久久久久国产精品免费免费搜索| 欧美色图激情小说| 91老司机福利 在线| 久久99精品网久久| 亚洲超碰精品一区二区| 亚洲色图制服诱惑 | 99久久综合狠狠综合久久| 美女www一区二区| 国产人成一区二区三区影院| 久久久亚洲精品石原莉奈| 国产aⅴ综合色| 亚洲激情一二三区| 欧美亚洲高清一区| 亚洲女人的天堂| 9191国产精品| 日韩欧美中文一区二区| 日韩国产欧美视频| 欧美精品第1页| 色素色在线综合| 秋霞电影网一区二区| 亚洲一区免费观看| 亚洲欧美日韩在线不卡| 精品综合久久久久久8888| 亚洲福利国产精品| 亚洲综合小说图片| 亚洲一二三四久久| 一区二区三区在线影院| 亚洲男人的天堂一区二区| 亚洲欧洲av另类| ㊣最新国产の精品bt伙计久久| 国产天堂亚洲国产碰碰| 日本一区二区三区在线观看| 国产欧美一区二区精品性| 欧美国产精品专区| 国产精品情趣视频| 亚洲色图欧洲色图| 一区二区三区日韩欧美| 亚洲国产精品久久久男人的天堂 | 欧美激情一区二区在线| 国产丝袜欧美中文另类| 国产精品传媒在线| 一级女性全黄久久生活片免费| 亚洲一区欧美一区| 美女mm1313爽爽久久久蜜臀| 九九久久精品视频| 成人黄色电影在线| 欧美中文字幕一区二区三区亚洲| 在线免费观看日本欧美| 欧美一区二区网站| 国产视频一区在线观看| 18成人在线视频| 欧美午夜电影在线播放| 免费久久精品视频| 国产iv一区二区三区| 色综合久久天天综合网| 欧美喷水一区二区| 精品国产三级a在线观看| 欧美国产欧美综合| 久久久综合激的五月天| 欧美精品一区二区高清在线观看| 亚洲图片欧美综合| 日本欧美一区二区三区乱码| 美美哒免费高清在线观看视频一区二区 | 国产婷婷色一区二区三区四区| 亚洲精品老司机| 日韩精品一级二级| 国产中文字幕精品| 色综合天天在线| 91精品国产综合久久精品app| 2014亚洲片线观看视频免费| 日韩美女久久久| 久久se精品一区精品二区| 99视频精品免费视频| 99re热视频精品| 在线视频亚洲一区| 美国毛片一区二区| 91尤物视频在线观看| 91精品国产综合久久久久久漫画| 日韩一区二区视频在线观看| 自拍偷拍亚洲综合| 久久99久久久欧美国产| 欧美在线短视频| 欧美激情在线看| 国内成人自拍视频| 欧美肥大bbwbbw高潮| 国产精品女人毛片| 国内外成人在线| 色婷婷精品久久二区二区蜜臀av | 国产亚洲人成网站| 日韩欧美国产成人一区二区| 波多野结衣一区二区三区| 欧美午夜电影网| 亚洲激情自拍偷拍| 国产精品不卡在线| 国产精品毛片a∨一区二区三区| 色中色一区二区| 欧美亚洲另类激情小说| 欧美国产日韩a欧美在线观看| 久久精品理论片| 欧美区在线观看| 亚洲免费在线视频| 波多野结衣在线一区| 久久久综合九色合综国产精品| 午夜精品福利一区二区蜜股av| 色综合视频一区二区三区高清| 国产欧美日韩亚州综合| 狠狠狠色丁香婷婷综合久久五月| 欧美喷水一区二区| 性做久久久久久久久| 日本韩国欧美在线| 天堂一区二区在线| 欧美亚洲国产bt| 亚洲一卡二卡三卡四卡五卡| 一本一道综合狠狠老| 中文一区在线播放| 成人性生交大片免费看视频在线| 日韩精品在线一区二区| 日韩国产欧美在线播放| 91精品在线观看入口| 亚洲mv在线观看| 91麻豆精品国产91久久久更新时间 | 久久精品亚洲麻豆av一区二区 | 成人18视频日本| 99视频精品在线| 中文字幕中文字幕在线一区 | 日韩午夜激情av| 欧美a级一区二区| 日韩欧美电影在线| 精品午夜一区二区三区在线观看 | 日韩一区二区免费在线电影| 天堂成人国产精品一区| 91精选在线观看| 蜜臀久久久99精品久久久久久| 欧美一级在线视频| 狠狠色综合色综合网络| 国产日韩精品一区二区三区在线| 国产精品自在在线| 国产蜜臀97一区二区三区 | 欧美精品一区二区三区视频| 狠狠色丁香婷综合久久| 国产精品美女久久福利网站| 色综合久久88色综合天天免费| 亚洲777理论| 日韩欧美国产综合在线一区二区三区| 久久www免费人成看片高清| 国产欧美日韩视频一区二区| 91豆麻精品91久久久久久| 亚欧色一区w666天堂| 精品播放一区二区| 亚洲韩国一区二区三区| 美洲天堂一区二卡三卡四卡视频| 久久久精品黄色| 成人国产精品免费观看视频| 亚洲另类色综合网站| 欧美麻豆精品久久久久久| 韩国成人福利片在线播放| 中文字幕精品—区二区四季| 日本二三区不卡| 日本aⅴ精品一区二区三区 | 色偷偷久久一区二区三区| 亚洲综合激情小说| 精品国产伦一区二区三区观看方式 | 一区二区三区中文免费| 日韩欧美综合在线| 波多野结衣中文字幕一区 | 日本欧美在线看| 欧美一区二区三区在线观看 | 91同城在线观看| 亚洲国产美国国产综合一区二区 | 国产精品人成在线观看免费| 欧美视频中文字幕| 国产在线视频精品一区| 亚洲精品久久嫩草网站秘色| 精品福利一区二区三区免费视频| 99国产精品久| 久久99久久精品欧美| 一区二区三区欧美激情| 久久久久88色偷偷免费| 欧美日韩一二三| 国产精品亚洲一区二区三区在线| 亚洲一二三四久久| 国产精品传媒视频| 26uuu国产电影一区二区| 欧美日韩另类一区|