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

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

?? flash.c

?? 完整的Bell實驗室的嵌入式文件系統(tǒng)TFS
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* This file contains all of the flash support code that does not need   to be relocated to RAM.  Two separate files (flash.c and flashpic.c)   are maintained because under certain compilers, they may need to be   compiled with different options to be made position independent.   NOTE: THESE FUNCTIONS ARE NOT RE-ENTRANT!!!  All of the FLASH routines   assume they can copy themselves into the array FlashFunc[]; hence, only   one operation can be active at any time.*/#include "config.h"#if INCLUDE_FLASH#include "cpu.h"#include "flash.h"typedef unsigned char uchar;typedef unsigned short ushort;typedef unsigned long ulong;typedef volatile unsigned char vuchar;typedef volatile unsigned short vushort;typedef volatile unsigned long vulong;typedef volatile unsigned int vuint;typedef volatile int vint;extern int FLASHTYPE();extern int ENDFLASHTYPE();extern int FLASHWRITE();extern int ENDFLASHWRITE();extern int FLASHEWRITE();extern int ENDFLASHEWRITE();extern int FLASHERASE();extern int ENDFLASHERASE();int FlashOpError();/* FlashFunc[]:   This array will contain the flash operation function that is executing.   Recall that to operate on the flash, you cannot be executing out of it.   The flash functions are copied here, then executed through the function   pointer flashfunc which is set to point to FlashFunc.*/long    FlashFunc[FLASHFUNCSIZE];int (*flashfunc)();/* FlashProtectWindow:   Must be set to allow any flash operation to be done on space assumed   to be boot code.*/int FlashProtectWindow;/* FlashBank[]:   This structure contains all of the information that must be made available   to the various flash operation commands.  It is initialized by flashtype()   and used thereafter by the other operations.*/struct  flashinfo FlashBank[FLASHBANKS];/* FlashNamId[]:   Used to correlate between the ID and a string representing the name   of the flash device.  */struct flashdesc FlashNamId[] = {        AMD29LV160B,    "AMD-29LV160B",        AMD29LV160T,    "AMD-29LV160T",};/* SectorSizes160B:    There are a total of 35 sectors for this part.  This table reflects the    size of each sector based on the fact that this configuration is for a    x32 configuration (2 devices are used, each in x16 mode).  */int SectorSizes160B[] = {        0x8000,  0x4000,  0x4000,  0x10000, 0x20000,        0x20000, 0x20000, 0x20000, 0x20000, 0x20000,        0x20000, 0x20000, 0x20000, 0x20000, 0x20000,        0x20000, 0x20000, 0x20000, 0x20000, 0x20000,        0x20000, 0x20000, 0x20000, 0x20000, 0x20000,        0x20000, 0x20000, 0x20000, 0x20000, 0x20000,        0x20000, 0x20000, 0x20000, 0x20000, 0x20000,};showflashtype(id)ulong id;{    int i;    for(i=0;i<sizeof FlashNamId/sizeof(struct flashdesc);i++) {        if (id == FlashNamId[i].id) {            printf("Device = %s\n",FlashNamId[i].desc);            return(0);        }    }    printf("Flash id 0x%04x not recognized\n",id);    return(-1);}showflashinfo(fdev)struct flashinfo *fdev;{    int i;    if (showflashtype(fdev->id) < 0)        return(-1);    printf("  Base addr   : 0x%08x\n",fdev->base);    printf("  Sectors     : %d\n",fdev->sectorcnt);    printf("  Bank width  : %d bytes\n",fdev->width);    printf("  Sector     Begin       End        Size     SW-Protected?\n");    for(i=0;i<fdev->sectorcnt;i++) {        printf("    %2d    0x%08x  0x%08x  0x%06x      %s\n",            i,fdev->sectors[i].begin,fdev->sectors[i].end,            fdev->sectors[i].size,            fdev->sectors[i].protected ? "yes" : " no");    }    return(0);}/* flashopload():   Used by all flash operations to load the appropriate flash function into   ram.  It first verifies that the request is not larger than the allocated   area (FlashFunc[]), then it copies, and verifies the copy.  Finally,   caches are flushed.   Note that this function is copying code into data space with the intent   that the code will be executed shortly.  This means that after the code   is copied to data space the data cache MUST be flushed (to insure that the   code is in physical memory) and the instruction cache MUST be invalidated   (to insure that there is no instruction cached from a previous run of   this function that may have copied different code to the data space).   The generic calls to preFlashopload() and postFlashopload() are used   to keep this function generic.*/flashopload(begin,end)ulong   *begin, *end;{    extern  ulong preFlashopload(), postFlashopload();    volatile ulong  *bp, *copy;    int ret, mode;    /* Verify space availability: */    if (((int)end - (int)begin) >= sizeof FlashFunc) {        printf("flashopload overflow ((0x%x-0x%x) > 0x%x)\n",            end,begin,sizeof FlashFunc);        return(-1);    }    ret = 0;    mode = preFlashopload((char *)FlashFunc,        (char *)(&FlashFunc[FLASHFUNCSIZE-1]));    /* Copy function() to RAM, then verify: */    copy = (ulong *)FlashFunc;    bp = begin;    while(bp <= end) {        *copy = *bp;        if (*copy++ != *bp++) {            printf("flashopload failed\n");            ret = -1;            break;        }    }    postFlashopload(mode,(char *)FlashFunc,        (char *)(&FlashFunc[FLASHFUNCSIZE-1]));    flashfunc = (int(*)())FlashFunc;    return(ret);}/* flashtype():   Copy the Flashtype() function to the array FlashFunc[], then use   the function pointer flashfunc to call the routine relocated to   RAM space.*/flashtype(fdev)struct flashinfo *fdev;{    int ret;    if (flashopload((ulong *)FLASHTYPE,(ulong *)ENDFLASHTYPE) < 0)        return(-1);    ret = flashfunc(fdev);    return(ret);}/* flasherase():   Copy the Flasherase() function to the array FlashFunc[], then use   the function pointer flashfunc to call the routine relocated to   RAM space.*/flasherase(fdev,snum)struct  flashinfo *fdev;int snum;{    if (flashopload((ulong *)FLASHERASE,(ulong *)ENDFLASHERASE) < 0)        return(-1);    return(flashfunc(fdev,snum));}/* flashwrite():   Copy the Flashwrite() function to the array FlashFunc[], then use   the function pointer flashfunc to call the routine relocated to   RAM space.   First make a few checks on the request, then write to flash if all   checks succeed.*/flashwrite(fdev,dest,src,bytecnt)struct  flashinfo *fdev;uchar   *src, *dest;long    bytecnt;{    int i, j, lowsector, highsector;    register uchar  *dp, *sp, *edp;    dp = dest;    sp = src;    edp = (dest + bytecnt) - 1;    /* If outside the devices space, return failed.. */    if ((edp < fdev->sectors[0].begin) ||        (dp > fdev->sectors[fdev->sectorcnt-1].end)) {        printf("flashwrite() failed: dest out of flash range\n");        return(-1);    }    /* Make sure the destination is not within a protected sector */    if (FlashProtectWindow == FLASH_PROTECT_WINDOW_CLOSED) {        /* First determine the sectors that overlap with the */        /* flash space to be written... */        lowsector = highsector = -1;        for(j=0;j<fdev->sectorcnt;j++) {            if ((dp >= fdev->sectors[j].begin) &&                (dp <= fdev->sectors[j].end))                lowsector = j;        }        for(j=0;j<fdev->sectorcnt;j++) {            if ((edp >= fdev->sectors[j].begin) &&                (edp <= fdev->sectors[j].end))                highsector = j;        }        if ((lowsector == -1) || (highsector == -1)) {            printf("flashwrite() failed: can't find sector\n");            return(-1);        }        /* Now that the range of affected sectors is known, */        /* verify that those sectors are not protected... */        for(j=lowsector;j<=highsector;j++) {            if (fdev->sectors[j].protected) {                printf("flashwrite() failed: sector protected\n");                return(-1);            }        }    }    /* Now make sure that there is no attempt to transition a bit */    /* in the affected range from 0 to 1...  A flash write can only */    /* bring bits low (erase brings them  high). */    while(dp < edp) {        if ((*dp & *sp) != *sp) {            printf("flashwrite() failed: bit 0->1 rqst denied.\n");            return(-1);        }        dp++;         sp++;    }    if (flashopload((ulong *)FLASHWRITE,(ulong *)ENDFLASHWRITE) < 0) {        printf("flashopload() failed\n");        return(-1);    }    return(flashfunc(fdev,dest,src,bytecnt));}/* flashewrite():   Copy the Flashewrite() function to the array FlashFunc[], then use   the function pointer flashfunc to call the routine relocated to   RAM space.*/flashewrite(fdev,dest,src,bytecnt)struct  flashinfo *fdev;ulong   *src, *dest;long    bytecnt;{    int i;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品日日鲁夜夜添| 日韩午夜电影av| 久久久久久久精| 国产曰批免费观看久久久| 欧美哺乳videos| 岛国精品在线播放| 日韩毛片在线免费观看| 色菇凉天天综合网| 午夜电影网亚洲视频| 欧美一区二区三区视频在线观看 | 国产激情视频一区二区三区欧美| 亚洲图片欧美一区| 色av成人天堂桃色av| 亚洲电影在线免费观看| 欧美日本不卡视频| 日韩国产在线观看一区| 亚洲精品免费一二三区| 国产一区二区女| 亚洲欧洲日韩一区二区三区| 99久久精品国产毛片| 精品精品欲导航| bt7086福利一区国产| 日日摸夜夜添夜夜添亚洲女人| 久久久久国色av免费看影院| 88在线观看91蜜桃国自产| 成人av手机在线观看| 蜜桃视频第一区免费观看| 久久久久国产一区二区三区四区| 91丝袜美腿高跟国产极品老师| 日韩一卡二卡三卡四卡| 欧美精品自拍偷拍动漫精品| av影院午夜一区| 91在线精品一区二区| 91精品91久久久中77777| 国产乱子轮精品视频| 日本中文字幕一区二区有限公司| 亚洲欧美综合网| 日韩av电影天堂| 亚洲欧洲日韩综合一区二区| 国产精品福利影院| 色综合咪咪久久| 国产精品成人一区二区三区夜夜夜| 亚洲电影你懂得| 91色婷婷久久久久合中文| 国产三级精品视频| 91小视频在线| 亚洲一区二区三区四区在线免费观看| 一本一本大道香蕉久在线精品 | 成人精品免费网站| 久久综合色播五月| 国产成人亚洲综合a∨婷婷| 久久久不卡网国产精品一区| 国产99精品国产| 国产精品看片你懂得| 97se亚洲国产综合自在线观| 亚洲综合丝袜美腿| 91精品1区2区| 亚洲图片一区二区| 久久久久成人黄色影片| 91麻豆免费观看| 激情图片小说一区| 国产精品免费av| 欧美日韩精品欧美日韩精品| 日本v片在线高清不卡在线观看| 欧美xxxx在线观看| 91小视频免费观看| 久久国产乱子精品免费女| 国产精品三级av| 日韩亚洲欧美在线| 一本色道亚洲精品aⅴ| 午夜av一区二区三区| 精品国精品国产尤物美女| 91热门视频在线观看| 国产在线日韩欧美| 日韩高清一级片| 亚洲香肠在线观看| 亚洲九九爱视频| 亚洲欧美日韩国产手机在线| 欧美日韩一区高清| 欧美日韩一二三区| 欧美主播一区二区三区美女| 国产成人精品影院| 韩国av一区二区三区| 蜜桃传媒麻豆第一区在线观看| 亚洲欧美一区二区三区国产精品 | 精品国产欧美一区二区| 欧美大度的电影原声| 欧美日韩一区在线观看| 91影视在线播放| 高潮精品一区videoshd| 国产精品12区| 老司机精品视频一区二区三区| 日本不卡不码高清免费观看| 亚洲国产cao| 夜夜夜精品看看| 丝袜美腿一区二区三区| 麻豆精品视频在线观看视频| 欧美a一区二区| 激情文学综合网| 91网站最新网址| 色偷偷一区二区三区| 欧美一区二区视频在线观看2020 | 成人黄色小视频在线观看| 99在线精品观看| 欧美色综合网站| 日韩一区二区不卡| 五月婷婷久久丁香| 国产一区二区福利视频| 国产激情偷乱视频一区二区三区| 成人sese在线| 日韩一级完整毛片| 亚洲人成网站在线| 国产一区二区福利| 日本道免费精品一区二区三区| 欧美福利电影网| 精品国产亚洲一区二区三区在线观看| 日韩美女视频在线| 亚洲乱码国产乱码精品精98午夜| 日韩中文字幕亚洲一区二区va在线| 黑人巨大精品欧美一区| 9i在线看片成人免费| 5566中文字幕一区二区电影| 国产日韩欧美制服另类| 亚洲大片在线观看| 欧美午夜精品久久久久久超碰| 久久精品亚洲国产奇米99| 亚洲国产视频一区二区| 成人免费观看男女羞羞视频| 日韩欧美高清一区| 欧美aaa在线| 日韩午夜激情视频| 偷窥国产亚洲免费视频| 国产一区在线视频| 亚洲欧美影音先锋| 成人综合婷婷国产精品久久 | 亚洲三级小视频| 9色porny自拍视频一区二区| 国产精品久久久久影院亚瑟 | 国产精品久久久久久妇女6080 | 久久综合精品国产一区二区三区| 日韩电影在线观看网站| 日韩欧美高清一区| 国模少妇一区二区三区| 国产亚洲一区二区三区| 99久久99久久精品免费观看| 亚洲码国产岛国毛片在线| 久久综合999| 成人理论电影网| 天天色 色综合| 久久综合九色综合97婷婷女人| 成人涩涩免费视频| 亚洲成人三级小说| 日本一区二区成人| 欧美精品欧美精品系列| 国产乱人伦偷精品视频不卡| 亚洲人成在线播放网站岛国| 日韩精品一区二区三区四区 | 精品入口麻豆88视频| 97精品超碰一区二区三区| 久久精品国产免费| 亚洲图片欧美视频| 国产精品黄色在线观看| 欧美老人xxxx18| 欧美日韩国产一级片| 99re成人在线| 欧美性感一类影片在线播放| 欧美日韩专区在线| 精品国产一二三区| 国产精品毛片a∨一区二区三区| 国产精品超碰97尤物18| 亚洲小说欧美激情另类| 免费观看成人鲁鲁鲁鲁鲁视频| 国产真实乱对白精彩久久| 成人永久看片免费视频天堂| 欧美无人高清视频在线观看| 欧美一二三区精品| 日韩一区中文字幕| 日韩成人精品在线| 99精品视频在线播放观看| 9191成人精品久久| 中文字幕在线不卡| 九一九一国产精品| 欧美午夜精品电影| 国产精品毛片高清在线完整版| 日日摸夜夜添夜夜添国产精品 | 久久亚洲一区二区三区明星换脸| 中文字幕在线免费不卡| 国内外成人在线| 欧美精选午夜久久久乱码6080| 日韩高清在线电影| 午夜激情一区二区| 国产精品综合一区二区三区| 国产iv一区二区三区| 欧美一区二区播放| 国产亚洲一区二区在线观看| 亚洲国产视频一区二区| 成人精品免费看| 日韩一级黄色大片| 亚洲人一二三区| 国产精品亚洲午夜一区二区三区|