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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? xcache_l.c

?? xilinx內(nèi)嵌CPU下的UCOS移植
?? C
字號:
/*-----------------------------------------------------------------------------        XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"      SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR      XILINX DEVICES.  BY PROVIDING THIS DESIGN, CODE, OR INFORMATION      AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION      OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS      IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,      AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE      FOR YOUR IMPLEMENTATION.  XILINX EXPRESSLY DISCLAIMS ANY      WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE      IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR      REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF      INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS      FOR A PARTICULAR PURPOSE.            (c) Copyright 2006 Xilinx, Inc.      All rights reserved.-----------------------------------------------------------------------------*/#include "xcache_l.h"#include "xpseudo_asm.h"#include "xreg440.h"#define DCACHE_SIZE     0x8000 // 32kB/****************************************************************************** Write to the Core-Configuration Register (CCR0)** @param    Value to be written to CCR0.  The bit fields are defined *           in xreg440.h** @return   None.** @note     ** None.*****************************************************************************//* special registers */void XCache_WriteCCR0(unsigned int val){  sync;  isync;  mtspr(XREG_SPR_CCR0, val);  sync;  isync;}/****************************************************************************** Enable the data cache. ** @param    Memory regions to be marked as cachable.  Each pair of adjacent*           bits in the regions variable stands for 256MB of memory. Setting*           either bit in the pair will enable caching for the corresponding *           region**           regions    --> cached address range*           -------------|--------------------------------------------------*           0x4000_0000  |               *           0x8000_0000  | [0, 0x0FFF_FFFF]*           0xC000_0000  |               *                        | *           0x0000_0001  |                         *           0x0000_0002  | [0xF000_0000, 0xFFFF_FFFF]*           0x0000_0003  |                         *                        |                         *           0x4000_0001  | *           0x4000_0002  | *           0x4000_0003  | *           0x8000_0001  | *           0x8000_0002  | [0, 0x0FFF_FFFF],[0xF000_0000, 0xFFFF_FFFF]*           0x8000_0003  |                                        *           0xC000_0001  |                                        *           0xC000_0002  | *           0xC000_0003  | *    * @return   None.** @note     ******************************************************************************/void XCache_EnableDCache(unsigned int regions){  int i;  int index;  int tlbword;  XCache_DisableDCache();   /* at this point the data cache is disabled and invalidated */  mtspr(XREG_SPR_DVLIM,0); /* set DVLIM to 0 */  mtspr(XREG_SPR_DNV0,0);  /* Set DNV0-3 */  mtspr(XREG_SPR_DNV1,0);  mtspr(XREG_SPR_DNV2,0);  mtspr(XREG_SPR_DNV3,0);  mtspr(XREG_SPR_DTV0,0);  /* Set DTV0-3 */  mtspr(XREG_SPR_DTV1,0);  mtspr(XREG_SPR_DTV2,0);  mtspr(XREG_SPR_DTV3,0);  for(i=15; i>=0 && regions !=0; i--) {   /* all TLB entries in 4GB of memory */    if((regions & 0x3) > 0) {             /* either bit in this region is set */      index = i+i+1;                      /* data page indices = 1,3,5,...,15 */      tlbword = tlbre(index, 2);      sync;      /* unset cache inhibit bit, leaves write-through bit as it is */      tlbwe(tlbword & 0xFFFFFBFF, index, 2);      isync;    }    regions = regions >> 2;                  /* check next region */  }}/****************************************************************************** Disable the data cache. ** @param    None*    * @return   None.** @note     ******************************************************************************/void XCache_DisableDCache(void){  unsigned int tlbword;  unsigned int i;  unsigned int tlbIndex;  unsigned int address;  unsigned int index;  unsigned int pagesCacheable = 0;  char dcdbtrh;  for(i=0; i<16; i++)             /* all TLB entries in 4GB of memory */  {    tlbIndex = i+i+1;             /* data page indices = 1,3,5...,15 */    tlbword = tlbre(tlbIndex, 2);    sync;    if((tlbword & 0x00000400) != 0x400)    /* if cache inhibit bit is not set */    {        if((tlbword & 0x00000800) != 0x800){ /* if not write through */	pagesCacheable++;      }      tlbwe(tlbword & ~0x00000800 | 0x00000400, tlbIndex, 2);  /* unset write-through bit and set cache inhibit bit */      isync;    }  }  /* flush dirty data cache lines */  if(pagesCacheable)  {    for(index=0; index<DCACHE_SIZE; index+=32) /* per cache line */      {	sync;	dcread(index);	isync;                   /* ensure dcread finishes before reading tag */	address = (mfspr(XREG_SPR_DCDBTRH));  /* read tag's real address */	if( (address | 0xffffff7f) == 0xffffffff ) {  /* if line is valid */          dcbf((address & 0xFFFFFF00)|index & 0xff);  /* flush if dirty */	  sync;                        /* ensure dcbf finishes */	}      }  }    /* data cache is effectively flushed at this point */  sync;   dccci(0);  /* invalidate data cache (clear all write               * through entries remaining.	      * (0) = dummy argument--not used by the PPC440	      * but needed for backward compatibility */  isync;}/****************************************************************************** Flush a data cache line. If the byte specified by the address (adr) * is cached by the data cache, the cacheline containing that byte is * invalidated.  If the cacheline is modified (dirty), the entire * contents of the cacheline are written to system memory before the * line is invalidated.** @param    Address to be flushed*    * @return   None.** @note     ******************************************************************************/void XCache_FlushDCacheLine(unsigned int adr){  dcbf(adr);  sync;  isync;}/****************************************************************************** Invalidate a data cache line. If the byte specified by the address (adr) * is cached by the data cache, the cacheline containing that byte is * invalidated.  If the cacheline is modified (dirty), the modified contents  * are lost and are NOT written to system memory before the line is * invalidated.** @param    Address to be flushed*    * @return   None.** @note     ******************************************************************************/void XCache_InvalidateDCacheLine(unsigned int adr){  dcbi(adr);  sync;  isync;}/****************************************************************************** Store a data cache line. If the byte specified by the address (adr) * is cached by the data cache and the cacheline is modified (dirty), * the entire contents of the cacheline are written to system memory.  * After the store completes, the cacheline is marked as unmodified * (not dirty).** @param    Address to be stored*    * @return   None.** @note     ******************************************************************************/void XCache_StoreDCacheLine(unsigned int adr){  dcbst(adr);  sync;  isync;}/***************************************************************************** Flush the data cache for the given address range.* If the bytes specified by the address (adr) are cached by the data cache, * the cacheline containing that byte is invalidated.  If the cacheline * is modified (dirty), the written to system memory first before the * before the line is invalidated.** @param    Start address of range to be flushed* @param    Length of range to be flushed in bytes*    * @return   None.** @note     ** Processor must be in real mode.****************************************************************************/void XCache_FlushDCacheRange(unsigned int adr, unsigned len){  const unsigned cacheline = 32;  unsigned int end;  if (len != 0)  {    /* Back the starting address up to the start of a cache line     * perform cache operations until adr+len     */    end = adr + len;    adr = adr & ~(cacheline - 1);    while (adr < end)    {      XCache_FlushDCacheLine(adr);      adr += cacheline;    }  }}/****************************************************************************** Invalidate the data cache for the given address range.* If the bytes specified by the address (adr) are cached by the data cache, * the cacheline containing that byte is invalidated.  If the cacheline * is modified (dirty), the modified contents are lost and are NOT * written to system memory before the line is invalidated.** @param    Start address of ragne to be invalidated* @param    Length of range to be invalidated in bytes*    * @return   None.** @note     ** Processor must be in real mode.****************************************************************************/void XCache_InvalidateDCacheRange(unsigned int adr, unsigned len){  const unsigned cacheline = 32;  unsigned int end;  if (len != 0)  {    /* Back the starting address up to the start of a cache line     * perform cache operations until adr+len     */    end = adr + len;    adr = adr & ~(cacheline - 1);    while (adr < end)    {      XCache_InvalidateDCacheLine(adr);      adr += cacheline;    }  }}/****************************************************************************** Enable the instruction cache. ** @param    Memory regions to be marked as cachable. Each pair of adjacent*           bits in the regions variable stands for 256MB of memory. Setting*           either bit in the pair will enable caching for the corresponding *           region**           regions    --> cached address range*           -------------|--------------------------------------------------*           0x4000_0000  |               *           0x8000_0000  | [0, 0x0FFF_FFFF]*           0xC000_0000  |               *                        | *           0x0000_0001  |                         *           0x0000_0002  | [0xF000_0000, 0xFFFF_FFFF]*           0x0000_0003  |                         *                        |                         *           0x4000_0001  | *           0x4000_0002  | *           0x4000_0003  | *           0x8000_0001  | *           0x8000_0002  | [0, 0x0FFF_FFFF],[0xF000_0000, 0xFFFF_FFFF]*           0x8000_0003  |                                        *           0xC000_0001  |                                        *           0xC000_0002  | *           0xC000_0003  | *    * @return   None.** @note     ******************************************************************************/void XCache_EnableICache(unsigned int regions){  int i;  int index;  int tlbword;  XCache_DisableICache();  /* at this point the instruction cache is disabled and invalidated */  mtspr(XREG_SPR_IVLIM,0); /* set IVLIM to 0 */  mtspr(XREG_SPR_INV0,0);  /* Set INV0-3 */  mtspr(XREG_SPR_INV1,0);  mtspr(XREG_SPR_INV2,0);  mtspr(XREG_SPR_INV3,0);  mtspr(XREG_SPR_ITV0,0);  /* Set ITV0-3 */  mtspr(XREG_SPR_ITV1,0);  mtspr(XREG_SPR_ITV2,0);  mtspr(XREG_SPR_ITV3,0);  for(i=15; i>=0 && regions != 0; i--) {  /* all TLB entries in 4GB of memory */    if((regions & 0x3) > 0) {            /* either bit in this region is set */      index = i+i;                /* instruction entry indices = 0,2,4,...,14 */      tlbword = tlbre(index, 2);      sync;      /* unset cache inhibit bit, leave write-through bit as it is */      tlbwe(tlbword & 0xFFFFFBFF, index, 2);      isync;    }    regions = regions >> 2;                  /* check next region */  }}/****************************************************************************** Disable the instruction cache. ** @param    None*    * @return   None.** @note     ******************************************************************************/void XCache_DisableICache(void){  int i;  int twoI;  int tlbword;    for(i=0; i<16; i++) {        /* all TLB entries in 4GB of memory */    twoI = i+i;                /* instruction entries = 0, 2,..., 14 */    tlbword = tlbre(twoI, 2);    sync;    tlbwe(tlbword | 0x0000400, twoI, 2);  /* set cache inhibit bit */    isync;  }  XCache_InvalidateICache();}/****************************************************************************** Invalidate the entire instruction cache. ** @param    None*    * @return   None.** @note     ******************************************************************************/void XCache_InvalidateICache(void){  sync;  iccci;  isync;}/****************************************************************************** Invalidate an instruction cache line.  If the instruction specified by the* parameter adr is cached by the instruction cache, the cacheline containing* that instruction is invalidated.** @param    None*    * @return   None.** @note     ******************************************************************************/void XCache_InvalidateICacheLine(unsigned int adr){  unsigned int oldMSR = mfmsr();  /* copy IS bit over DS bit */  sync;  mtmsr( (oldMSR & 0xffffffef) | ((oldMSR >> 1) & 0x00000010));  icbi(adr);  mtmsr(oldMSR); /* restore MSR */  isync;}/****************************************************************************** Fetches an instruction cache block(line) into the cache, if the input* address points to a cacheable instruction region.** @param    None*    * @return   None.** @note     ******************************************************************************/void XCache_TouchICacheBlock(unsigned int adr){  unsigned int oldMSR = mfmsr();  /* copy IS bit over DS bit */  sync;  mtmsr( (oldMSR & 0xffffffef) | ((oldMSR >> 1) & 0x00000010));  icbt(adr);  mtmsr(oldMSR); /* restore MSR */  isync;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩小视频在线观看专区| 亚洲第一主播视频| 亚洲午夜在线视频| 极品少妇一区二区| 欧美色视频在线| 中文字幕av资源一区| 美女网站在线免费欧美精品| 91麻豆文化传媒在线观看| 精品理论电影在线| 日韩国产一区二| 在线日韩av片| 中文字幕av免费专区久久| 日韩vs国产vs欧美| 欧美视频第二页| 亚洲手机成人高清视频| 国产福利视频一区二区三区| 欧美一区二区播放| 午夜精品福利在线| 欧美最猛性xxxxx直播| 中文字幕亚洲成人| 成人免费看黄yyy456| 精品国产亚洲在线| 免费高清不卡av| 欧美丰满嫩嫩电影| 亚洲成人免费电影| 欧美日韩午夜影院| 亚洲成a人v欧美综合天堂| 91视频com| 亚洲免费观看高清完整版在线观看熊 | 日韩午夜电影在线观看| 亚洲国产精品久久不卡毛片| 色综合久久天天| 亚洲精选在线视频| 欧美亚洲动漫精品| 天堂成人国产精品一区| 欧美嫩在线观看| 日韩精品午夜视频| 欧美变态口味重另类| 狠狠色丁香久久婷婷综| 亚洲精品一区二区三区四区高清| 经典三级一区二区| 国产欧美精品一区二区色综合朱莉| 国产91富婆露脸刺激对白| 国产日韩一级二级三级| 岛国av在线一区| 亚洲欧美视频在线观看视频| 欧美性猛交一区二区三区精品| 一区二区三区自拍| 欧美一区二区三区视频在线 | 一区二区成人在线| 欧美裸体一区二区三区| 久久国产综合精品| 久久久99精品免费观看不卡| 99久久婷婷国产精品综合| 一区二区在线观看免费视频播放| 精品视频全国免费看| 蜜桃久久av一区| 国产精品久久夜| 欧美无人高清视频在线观看| 麻豆成人在线观看| 国产精品久久久久久久久动漫 | 日日噜噜夜夜狠狠视频欧美人| 日韩欧美一区二区免费| eeuss鲁一区二区三区| 偷拍与自拍一区| 国产婷婷色一区二区三区 | 亚洲国产另类av| 久久亚洲精华国产精华液 | 懂色av一区二区夜夜嗨| 一区二区欧美视频| 久久先锋资源网| 欧美三级中文字幕在线观看| 激情文学综合插| 亚洲黄色录像片| 国产亚洲美州欧州综合国| 欧美视频一区在线| 风间由美一区二区av101| 亚洲国产精品久久久久秋霞影院| 国产日产欧美一区| 欧美一级黄色大片| 色婷婷精品大视频在线蜜桃视频| 极品少妇xxxx偷拍精品少妇| 香蕉久久一区二区不卡无毒影院| 欧美国产在线观看| 欧美不卡在线视频| 欧美视频自拍偷拍| 91一区二区在线| 国产精品一区久久久久| 图片区小说区国产精品视频| 亚洲欧美日韩国产综合| 国产亚洲一二三区| 日韩欧美一区二区免费| 欧美日本在线视频| 欧美亚洲动漫制服丝袜| 91麻豆蜜桃一区二区三区| 国产精品资源站在线| 免费高清在线一区| 天天射综合影视| 亚洲一区二区三区四区在线 | 久久综合狠狠综合久久综合88 | 欧日韩精品视频| av亚洲精华国产精华| 国产一区二区在线看| 日韩av网站在线观看| 亚洲网友自拍偷拍| 一区二区三区欧美激情| 亚洲欧美色一区| **欧美大码日韩| 国产精品美女久久久久aⅴ| 久久久久久久综合日本| 26uuu另类欧美亚洲曰本| 日韩免费一区二区| 精品国产乱码久久| 久久综合丝袜日本网| 久久久久88色偷偷免费| 精品国产乱码久久久久久图片| 日韩欧美你懂的| 久久只精品国产| 国产女人18毛片水真多成人如厕 | 99久久综合精品| 99久久精品久久久久久清纯| 成人av在线播放网址| av午夜一区麻豆| 日本二三区不卡| 欧美美女一区二区三区| 欧美精品亚洲二区| 日韩精品影音先锋| 久久久91精品国产一区二区精品 | 国产成都精品91一区二区三| 东方欧美亚洲色图在线| 成人自拍视频在线观看| 成人丝袜18视频在线观看| 99久久综合精品| 国产日韩高清在线| 亚洲欧洲av一区二区三区久久| 国产精品成人一区二区艾草 | 欧美性受极品xxxx喷水| 在线综合亚洲欧美在线视频| 日韩三级在线免费观看| 国产视频一区在线观看| 亚洲三级小视频| 首页国产欧美久久| 国产成人高清视频| 欧美在线免费视屏| 欧美一二三区在线| 国产日产欧美一区| 亚洲国产精品久久久男人的天堂| 久久精品99久久久| 色综合网色综合| 日韩一区二区三区电影| 国产精品嫩草久久久久| 亚洲五码中文字幕| 国产精品小仙女| 欧美亚洲一区三区| 国产欧美一区二区精品婷婷 | 国产成人无遮挡在线视频| 91福利在线导航| 亚洲精品一区二区三区影院| 亚洲免费在线观看| 国产精品99久久久| 欧美浪妇xxxx高跟鞋交| 国产精品三级电影| 另类中文字幕网| 91黄色在线观看| 国产日产亚洲精品系列| 日韩黄色一级片| 色综合中文字幕| 欧美激情艳妇裸体舞| 麻豆成人久久精品二区三区小说| 91小视频免费观看| 久久久久国产精品厨房| 香蕉久久夜色精品国产使用方法 | 国产麻豆成人传媒免费观看| 在线精品观看国产| 亚洲国产高清aⅴ视频| 日本亚洲欧美天堂免费| 色婷婷综合久久久久中文一区二区 | 在线观看国产日韩| 国产精品入口麻豆原神| 六月婷婷色综合| 7777精品伊人久久久大香线蕉完整版| 亚洲欧美一区二区视频| 国产麻豆一精品一av一免费| 宅男在线国产精品| 丝袜亚洲另类欧美综合| 91福利精品第一导航| 亚洲三级在线播放| 北条麻妃国产九九精品视频| 久久久久国产精品人| 国产精品中文字幕一区二区三区| 欧美一区二区三区免费在线看| 一区二区成人在线| 欧美自拍偷拍午夜视频| 亚洲色图丝袜美腿| 91免费版在线| 亚洲精品乱码久久久久久久久| 色综合色狠狠天天综合色| 国产精品伦一区二区三级视频| 911国产精品| 蜜臀av性久久久久蜜臀aⅴ|