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

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

?? cachemcf5407lib.c

?? vxworks5.5.1源代碼。完整源代碼
?? C
字號:
/* cacheMCF5407Lib.c - ColdFire 5407 cache management library *//* Copyright 1984-2000 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01c,07mar03,dee  fix SPR#86341 cache problem with breakpoints01b,02mar01,dh  Add more flexibility to cache scheme, similar to the "unified"                 version.01a,25oct00,dh   taken from Motorola BSP for 5407 (by Van Quache),		 "Tornado-ised" and cleaned up*//*DESCRIPTIONThe MCF5407's Harvard architecture uses separate data and instructioncaches.INTERNALThe MCF5407 has four access-control registers for controlling thecache, 2 for data and 2 for instructions. In addition, the CACRregister provides default cache operations for addresses that donot match the ranges specified in the ACRs.It is not possible to control the cache solely with the CACR register,because the ACRs are not sufficient to provide cache-inhibited operationin the various external ind internal memory and I/O regions. Thusthis library has been modified from the original Motorola design.The cache modes are set in the BSP using global variablesnormalCACR and normalACR[4]. The caches are enabled and disabledby this library using the DEC and IEC bits of CACR. In addition,whenever the instruction cache is operated upon, the same operationis applied to branch cache, if applicable and if the branch cacheis enabled.Note: In the Coldfire Core: the movec instruction is unidirectional.Control registers can be written, but not read. For this reason, wemaintain copies of these registers in memory.See the MCF5407 Coldfire User's Manual for cache details.For general information about caching, see the manual entry for cacheLib.INCLUDE FILES: cacheLib.hSEE ALSO: cacheLib, vmLib *//* LINTLIBRARY */#include "vxWorks.h"#include "errnoLib.h"#include "intLib.h"#include "stdlib.h"#include "cacheLib.h"#include "private/memPartLibP.h"#include "private/vmLibP.h"#include "private/funcBindP.h"/* These are the CACR bits we select for the data cache. */#define C_CACR_DATABITS ( C_CACR_DEC | C_CACR_DW | C_CACR_DESB | \			  C_CACR_DHLCK | C_CACR_DDCM )/* These are the CACR bits we select for the instruction cache. */#define C_CACR_INSTBITS ( C_CACR_BEC | C_CACR_IEC | C_CACR_DNFB | \			  C_CACR_IHLCK | C_CACR_IDCM )/* Note that the xCINVA and xDPI bits are NEVER selected - they are only   set when we explicitly need to do that kind of stuff */IMPORT ULONG	normalCACR;		/* Supplied by BSP */IMPORT ULONG	normalACR[4];		/* Supplied by BSP */IMPORT	void	cacheCACRSet(int);IMPORT	void	cacheACRSet(int, int);IMPORT	void	cacheWriteBufferFlush(void);IMPORT	void	cacheMCF5407DataPushAll(int nlines);IMPORT	void	cacheMCF5407DataPushLine(void* address);IMPORT	void	cacheMCF5407InstPushAll(int nlines);IMPORT	void	cacheMCF5407InstPushLine(void* address);LOCAL	ULONG	currentCACR = 0;LOCAL	ULONG	currentACR[4] = {0,0,0,0};LOCAL	ULONG	cacheDataLineMask = 0;LOCAL	ULONG	cacheInstLineMask = 0;LOCAL	ULONG	cacheDataSetLength = 0;LOCAL	ULONG	cacheInstSetLength = 0;LOCAL	int	cacheDataLineCount = 0;LOCAL	int	cacheInstLineCount = 0;LOCAL	int	cacheInstEnabled = 0;LOCAL	STATUS	cacheArchEnable(CACHE_TYPE cache);LOCAL	STATUS	cacheArchDisable(CACHE_TYPE cache);LOCAL	STATUS	cacheArchClear(CACHE_TYPE cache, void* address, size_t bytes);LOCAL	STATUS	cacheArchTextUpdate(void* address, size_t bytes);LOCAL	STATUS	cacheProbe(CACHE_TYPE cache);LOCAL	STATUS	cacheArchFlush(cache, address, bytes);/******************************************************************************** cacheMCF5407LibInit - initialize the MCF5407 cache library* * This routine initializes the cache library for Motorola ColdFire 5407* processors.  It initializes the function pointers and configures the* caches to the specified cache modes.  Modes should be set before caching* is enabled.** This function is called before the bss is cleared, so any variables* assigned to must be in the data segment, or their values will be lost.** RETURNS: OK.*/STATUS cacheMCF5407LibInit    (    CACHE_MODE	iMode,	/* instruction cache mode - NOT USED */    CACHE_MODE	dMode	/* data cache mode - NOT USED */    )    {    int i;    cacheLib.enableRtn		= cacheArchEnable;    cacheLib.disableRtn		= cacheArchDisable;    cacheLib.lockRtn		= NULL;    cacheLib.unlockRtn		= NULL;    cacheLib.clearRtn		= cacheArchClear;    cacheLib.dmaMallocRtn	= NULL;    cacheLib.dmaFreeRtn		= NULL;    cacheLib.dmaVirtToPhysRtn	= NULL;    cacheLib.dmaPhysToVirtRtn	= NULL;    cacheLib.textUpdateRtn	= cacheArchTextUpdate;    cacheLib.flushRtn		= cacheArchFlush;    cacheLib.invalidateRtn	= cacheArchClear;    cacheLib.pipeFlushRtn	= (FUNCPTR)cacheWriteBufferFlush;    cacheDataSetLength	= DATA_CACHE_SIZE / CACHE_SET_COUNT;	/* 2048 */    cacheDataLineCount	= cacheDataSetLength / CACHE_LINE_SIZE;	/* 128 */    cacheDataLineMask	= ((cacheDataSetLength - 1) & ~(CACHE_LINE_SIZE -1));	/* 0x07F0 */    cacheInstSetLength	= INSTRUCTION_CACHE_SIZE / CACHE_SET_COUNT;	/* 4096 */    cacheInstLineCount	= cacheInstSetLength / CACHE_LINE_SIZE;		/* 256 */    cacheInstLineMask	= ((cacheInstSetLength - 1) & ~(CACHE_LINE_SIZE -1));	/* 0x0FF0 */    /* Invalidate Data, Instruction, Branch cache */    cacheCACRSet(C_CACR_DCINVA | C_CACR_BCINVA | C_CACR_ICINVA);    /* Initialiase CACR and all ACRs with cache-disabled */    currentCACR = normalCACR & ~(C_CACR_DDPI | C_CACR_IDPI |	/* dis CPUSHL */				 C_CACR_DEC | C_CACR_DESB |	/* dis DATA */				 C_CACR_BEC |			/* dis BRANCH */				 C_CACR_IEC | C_CACR_DNFB );	/* dis INSTR */    cacheCACRSet(currentCACR);    for ( i=0; i<4; i++ )	cacheACRSet(i, (currentACR[i] = 0));    /* cacheDataMode, cacheDataEnabled, cacheMmu are used to configured in cacheFuncsSet */    cacheDataMode	= dMode;	/* CACHE_MODE cacheDataMode = CACHE_DISABLED (0) (cacheLib.c) */    cacheDataEnabled	= FALSE;	/* BOOL cacheDataEnabled = FALSE (cacheLib.c) */    cacheMmuAvailable	= FALSE;    cacheInstEnabled	= FALSE;    return (OK);    }/******************************************************************************** cacheArchEnable - enable the cache** This routine enables the specified (instruction or data) cache.** RETURNS: OK, or ERROR if the cache type is invalid or the cache control* is not supported.** NOMANUAL*/LOCAL STATUS cacheArchEnable    (    CACHE_TYPE	cache		/* cache to enable */    )    {    int lvl;    if ( cacheProbe(cache) != OK )	return (ERROR);    if ( cache == INSTRUCTION_CACHE )	{	if ( !cacheInstEnabled )	    {	    lvl = intLock();	    currentCACR = (currentCACR & C_CACR_DATABITS) |			  (normalCACR & C_CACR_INSTBITS );	    cacheCACRSet(currentCACR);	    cacheACRSet(2, (currentACR[2] = normalACR[2]));	    cacheACRSet(3, (currentACR[3] = normalACR[3]));	    cacheInstEnabled = TRUE;	    intUnlock(lvl);	    }	}    else    if ( cache == DATA_CACHE )	{	if ( !cacheDataEnabled )	    {	    lvl = intLock();	    currentCACR = (currentCACR & C_CACR_INSTBITS) |			  (normalCACR & C_CACR_DATABITS );	    cacheCACRSet(currentCACR);	    cacheACRSet(0, (currentACR[0] = normalACR[0]));	    cacheACRSet(1, (currentACR[1] = normalACR[1]));	    cacheDataEnabled	= TRUE;	    cacheFuncsSet();	/*Initialize cacheUsersFuncs and cacheDmaFuncs*/	    intUnlock(lvl);	    }	}    return (OK);    }/******************************************************************************** cacheArchDisable - disable the cache** This routine disables the specified (instruction or data) cache.** RETURNS: OK, or ERROR if the cache type is invalid or the cache control* is not supported.** NOMANUAL*/LOCAL STATUS cacheArchDisable    (    CACHE_TYPE	cache		/* cache to disable */    )    {    int lvl;    if ( cacheProbe(cache) != OK )	return (ERROR);    if ( cache == DATA_CACHE )	{	if ( cacheDataEnabled ) 	    {	    lvl = intLock();	    cacheMCF5407DataPushAll(cacheDataLineCount);	/* sets CACR to 0 */            cacheCACRSet(0);      /* clear out entire CACR */	    currentCACR = currentCACR & ~(C_CACR_DEC | C_CACR_DESB);	    cacheCACRSet(currentCACR);	    cacheDataEnabled = FALSE;	    cacheFuncsSet();	    intUnlock(lvl);	    }	}    else    if ( cache == INSTRUCTION_CACHE )	{	if ( cacheInstEnabled ) 	    {	    lvl = intLock();	    currentCACR = currentCACR & ~(C_CACR_BEC | C_CACR_IEC);	    cacheCACRSet(currentCACR);	    cacheInstEnabled = FALSE;	    intUnlock(lvl);	    }	}    return (OK);    }/******************************************************************************** cacheArchFlush - flush all entries from the cache** This routine flushes some or all entries from the cache.* * RETURNS: OK, or ERROR if the cache type is invalid or the cache control* is not supported.** NOMANUAL*/LOCAL STATUS cacheArchFlush    (    CACHE_TYPE	cache, 		/* cache to clear */    void *	address,	/* address to clear */    size_t	bytes		/* bytes to clear */    )    {    int oldLevel;    UINT line, end;    if ( bytes == 0 )	return (OK);    if ( cacheProbe(cache) != OK )	return (ERROR);    if ( cache == DATA_CACHE )	{	if ( !cacheDataEnabled )	    return OK;	oldLevel = intLock ();	/* Calculate the number of sets for data (128) */	line = ((UINT) address) & cacheDataLineMask;	end  = (((UINT) address) + bytes - 1) & cacheDataLineMask;	if ( ( bytes == ENTIRE_CACHE ) ||	     ( bytes >= cacheDataSetLength ) ||	     ( ( line == end ) && ( bytes > CACHE_LINE_SIZE ) ) )	    {	    /* Push the entire cache. */	    cacheMCF5407DataPushAll(cacheDataLineCount);	    }	else 	    {	    while (TRUE)	/* YUK! */		{		cacheMCF5407DataPushLine((void *)line);		if (line == end)		    break;		line = (line + CACHE_LINE_SIZE) & cacheDataLineMask;		}	    }	cacheWriteBufferFlush();	intUnlock (oldLevel);	}    else    if(cache == INSTRUCTION_CACHE)	{	if ( !cacheInstEnabled )	    return OK;	oldLevel = intLock();	/* calculate number of set for instruction (256) */	line = ((UINT) address) & cacheInstLineMask;	end  = (((UINT) address) + bytes - 1) & cacheInstLineMask;	if ( ( bytes == ENTIRE_CACHE ) ||	     ( bytes >= cacheInstSetLength ) ||	     ( ( line == end ) && ( bytes > CACHE_LINE_SIZE ) ) )	    {	    /* Push the entire cache. */	    cacheCACRSet(currentCACR | C_CACR_ICINVA);	    }	else	    {	    while (TRUE)	/* YUK! */		{		cacheMCF5407InstPushLine ((void *) line);		if (line == end)		    break;		line = (line + CACHE_LINE_SIZE) & cacheInstLineMask;		}	    }	intUnlock (oldLevel);	}    return (OK);}/******************************************************************************** cacheArchClear - clear all entries from the cache** This routine clears some or all entries from the cache.* * RETURNS: OK, or ERROR if the cache type is invalid or the cache control* is not supported.** NOMANUAL*/LOCAL STATUS cacheArchClear    (    CACHE_TYPE	cache, 		/* cache to clear */    void *	address,	/* address to clear */    size_t	bytes		/* bytes to clear */    )    {    int lvl;    if ( cacheProbe(cache) != OK )	return (ERROR);    if ( cache == DATA_CACHE )	{	if ( !cacheDataEnabled )	    return OK;	lvl = intLock();	cacheArchFlush(cache, address, bytes);	intUnlock(lvl);	}    else    if ( cache == INSTRUCTION_CACHE )	{	if ( !cacheInstEnabled )	    return OK;	lvl = intLock();	cacheArchFlush(cache, address, bytes);	intUnlock(lvl);	}    return (OK);    }/******************************************************************************** cacheProbe - test for the prescence of a type of cache** This routine returns status with regard to the prescence of a particular* type of cache.** RETURNS: OK, or ERROR if the cache type is invalid or the cache control* is not supported.** NOMANUAL*/LOCAL STATUS cacheProbe    (    CACHE_TYPE	cache 		/* cache to test */    )    {    if ((cache == INSTRUCTION_CACHE) || (cache == DATA_CACHE))        return (OK);    errno = S_cacheLib_INVALID_CACHE;			/* set errno */    return (ERROR);}/******************************************************************************** cacheArchTextUpdate - synchronize the instruction and data caches** Clears the data cache to force any changes into memory, and then* invalidates the instruction cache to make sure the newly loaded code* can be executed.** RETURNS: OK, or ERROR if the cache type is invalid or the cache control* is not supported.** NOMANUAL*/LOCAL STATUS cacheArchTextUpdate     (    void * address,	/* virtual address */    size_t bytes	/* number of bytes to update */    )    {    if(cacheArchClear(DATA_CACHE, address, bytes) == OK)	return (cacheInvalidate(INSTRUCTION_CACHE, address, bytes));    else	return ERROR;    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av不卡在线播放| 一区二区在线看| 在线免费不卡电影| 韩国精品久久久| 亚洲成人动漫精品| 亚洲天堂精品视频| 精品福利在线导航| 欧美三级日韩在线| 北条麻妃国产九九精品视频| 日本成人在线看| 亚洲永久免费av| 日韩一区欧美一区| 久久久99精品久久| 日韩欧美成人一区二区| 欧美色综合久久| 一道本成人在线| 成人91在线观看| 国产精品一区二区在线播放| 日本中文字幕一区二区视频| 亚洲国产一二三| 一区二区三区四区在线免费观看 | 日韩和的一区二区| 综合久久一区二区三区| 国产女主播视频一区二区| 欧美日韩国产精品自在自线| eeuss影院一区二区三区| 麻豆国产91在线播放| 水野朝阳av一区二区三区| 玉米视频成人免费看| 亚洲视频一二三区| 国产农村妇女精品| 在线播放亚洲一区| 欧美巨大另类极品videosbest | 精品久久久久一区| 91精品国产综合久久香蕉的特点 | 日韩精品一区二区三区视频| 欧美高清激情brazzers| 91欧美一区二区| 91麻豆视频网站| 在线观看成人免费视频| 99视频有精品| 99久久精品久久久久久清纯| 不卡的av在线| 国产成人一区二区精品非洲| 国产专区欧美精品| 国产在线不卡一区| 国产91在线|亚洲| 成人国产精品免费观看| 成人av在线网| 成人毛片视频在线观看| 成人毛片老司机大片| 不卡一二三区首页| 在线视频一区二区三| 欧美怡红院视频| 欧美日韩国产综合一区二区三区| 欧美日韩一区在线| 日韩精品一区二区三区视频播放| 欧美变态tickling挠脚心| 精品日韩在线一区| 国产精品免费视频一区| 最近日韩中文字幕| 亚洲v中文字幕| 久久精品国产色蜜蜜麻豆| 国产精品77777| 97久久超碰国产精品| 欧美日韩一区二区三区高清| 日韩欧美国产综合| 亚洲国产精品成人综合| 国产精品久久久久久久久久久免费看 | 韩国三级在线一区| 99视频热这里只有精品免费| 欧美日韩一区二区三区在线| 亚洲精品一区二区精华| 亚洲日本青草视频在线怡红院 | 中文字幕一区二区三区视频| 亚洲综合在线第一页| 美女视频黄久久| va亚洲va日韩不卡在线观看| 精品视频在线免费观看| 久久综合成人精品亚洲另类欧美 | 国模娜娜一区二区三区| av中文一区二区三区| 欧洲激情一区二区| 日韩欧美电影在线| 亚洲人成网站色在线观看| 免费人成精品欧美精品| av影院午夜一区| 日韩欧美在线不卡| 亚洲男人天堂av网| 激情丁香综合五月| 欧美无砖专区一中文字| 久久久久久久久久美女| 亚洲亚洲人成综合网络| 国产69精品一区二区亚洲孕妇| 欧美视频一区二区在线观看| 中文字幕欧美区| 久久国产剧场电影| 欧美午夜影院一区| 国产精品国产三级国产aⅴ中文 | 大桥未久av一区二区三区中文| 日韩三级视频在线观看| 亚洲男人的天堂网| 国产成人午夜视频| 日韩写真欧美这视频| 亚洲一区二区五区| av电影一区二区| 国产亚洲欧洲一区高清在线观看| 日韩高清在线一区| 欧美天天综合网| 亚洲男人的天堂网| 丁香激情综合五月| 久久久亚洲欧洲日产国码αv| 亚洲成人在线免费| 欧美曰成人黄网| 亚洲欧美日韩国产一区二区三区| 国产精品小仙女| 欧美电影免费观看完整版| 天天av天天翘天天综合网色鬼国产 | 成av人片一区二区| 久久精品亚洲乱码伦伦中文| 美腿丝袜亚洲三区| 欧美一级日韩免费不卡| 午夜久久久久久电影| 欧美在线高清视频| 一卡二卡欧美日韩| 在线观看一区二区视频| 亚洲裸体在线观看| 91丨porny丨国产| 日韩一区欧美小说| 一本大道久久a久久精品综合| 国产精品美女www爽爽爽| 懂色av一区二区三区免费看| 久久精品人人做人人综合| 国产乱码精品一区二区三| 2021中文字幕一区亚洲| 激情综合五月天| 久久久久一区二区三区四区| 九九九久久久精品| 久久精品夜色噜噜亚洲a∨ | 欧美男男青年gay1069videost| 一区二区三区四区视频精品免费| 一本久道中文字幕精品亚洲嫩| 亚洲欧美日韩一区二区| 在线观看一区二区精品视频| 午夜久久电影网| 日韩精品一区二区三区swag| 激情综合网激情| 久久精品一区蜜桃臀影院| 懂色av一区二区三区免费看| ●精品国产综合乱码久久久久| 91丝袜美腿高跟国产极品老师 | 国产成人一区在线| 亚洲婷婷在线视频| 欧美日韩性生活| 日韩成人av影视| 久久中文字幕电影| 99精品视频一区二区三区| 亚洲黄色av一区| 欧美一级高清片| 国产不卡高清在线观看视频| 亚洲视频精选在线| 91精品国产综合久久久久久久| 精品一区二区三区免费毛片爱| 国产日韩视频一区二区三区| 91丝袜国产在线播放| 亚洲成a天堂v人片| 久久综合狠狠综合| 在线欧美小视频| 国产一区二区在线观看免费| 中文字幕一区二区三区不卡| 欧美丝袜丝交足nylons图片| 麻豆精品国产传媒mv男同| 国产精品色眯眯| 在线观看91av| 成人午夜电影网站| 日韩精品电影一区亚洲| 国产无遮挡一区二区三区毛片日本 | 国产成人免费视频网站高清观看视频| 亚洲视频在线观看三级| 欧美一区二区三区喷汁尤物| 成人中文字幕合集| 天天做天天摸天天爽国产一区| 久久久久久免费毛片精品| 色婷婷综合激情| 国产在线精品一区二区| 一区二区三区丝袜| 国产亚洲综合色| 9191久久久久久久久久久| 成人三级伦理片| 免费成人美女在线观看.| 国产精品第一页第二页第三页| 欧美一区二区三区免费大片 | 秋霞电影一区二区| 亚洲欧美另类在线| 久久久久久久久免费| 欧美美女一区二区在线观看| av男人天堂一区| 国内精品免费**视频| 五月天亚洲婷婷| 一区二区三区小说|