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

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

?? flash.c

?? 完整的Bell實驗室的嵌入式文件系統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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内久久婷婷综合| 石原莉奈在线亚洲三区| 国产一区二区视频在线播放| 欧美精品一区二区精品网| 美国三级日本三级久久99 | 日本不卡中文字幕| 久久久久久久久久久久久久久99 | 91免费视频观看| 亚洲主播在线观看| 欧美电影精品一区二区| 成人丝袜18视频在线观看| 亚洲免费伊人电影| 欧美一级免费观看| 日本一道高清亚洲日美韩| 视频一区在线视频| 精品午夜久久福利影院| 国产成人亚洲综合a∨猫咪| 中文字幕不卡一区| 91行情网站电视在线观看高清版| 中文字幕一区在线| 另类小说图片综合网| 国模少妇一区二区三区| 欧美精品丝袜中出| 精品国产91九色蝌蚪| 成人h动漫精品一区二| 99久久久精品| 9191精品国产综合久久久久久 | 美女视频第一区二区三区免费观看网站| 成人精品视频网站| 亚洲国产精品99久久久久久久久 | 精品久久五月天| 亚洲国产精品v| 国产精品自产自拍| 欧美日韩中文字幕一区| 精品国免费一区二区三区| 天堂蜜桃一区二区三区| 精品视频一区二区三区免费| 亚洲亚洲精品在线观看| 久久精品国产99| 精品成人一区二区| 国产一区二区在线免费观看| 久久久久99精品国产片| 国产精品综合视频| 国产午夜精品美女毛片视频| 一区二区三区欧美| 福利一区二区在线观看| 91精品欧美综合在线观看最新 | 国产精品国产三级国产aⅴ入口| 一区二区三区美女视频| 在线亚洲一区观看| 亚洲电影第三页| av中文字幕不卡| 精品国产百合女同互慰| 高清成人免费视频| 一区二区三区中文字幕电影| 精品视频1区2区| 日本不卡一区二区三区高清视频| 国产资源在线一区| 国产精品乱码一区二三区小蝌蚪| 美日韩黄色大片| 久久久久久久久久久久久夜| av亚洲精华国产精华精华| 亚洲在线成人精品| 国产精品不卡在线观看| 欧美日韩国产一区二区三区地区| 国产精品色眯眯| 欧洲中文字幕精品| 亚洲狠狠丁香婷婷综合久久久| 成人综合婷婷国产精品久久| 亚洲精品国产高清久久伦理二区| 欧美午夜一区二区三区| 亚洲一区二区三区自拍| 日韩欧美综合在线| 99久久精品国产一区| 爽好久久久欧美精品| 欧美国产日产图区| 欧美一区二区视频观看视频| 国产成人免费在线视频| 亚洲电影第三页| 国产欧美一区二区三区在线老狼| 久久99精品视频| 亚洲欧美日韩国产另类专区| 久久综合色之久久综合| 国内不卡的二区三区中文字幕| 亚洲另类一区二区| 国产亚洲欧美日韩俺去了| 精品1区2区3区| 白白色 亚洲乱淫| 精品亚洲成av人在线观看| 亚洲一区二区三区在线播放| 久久久综合视频| 制服.丝袜.亚洲.另类.中文 | 色狠狠色噜噜噜综合网| 精品一区二区三区久久久| 亚洲在线视频免费观看| 国产精品国产精品国产专区不蜜| 一卡二卡欧美日韩| 国产精品视频九色porn| 日韩精品一区二区三区视频| 色婷婷av一区二区三区之一色屋| 亚洲色图视频免费播放| 欧美日韩一区小说| 色婷婷亚洲综合| 不卡高清视频专区| 成人av影视在线观看| 国产福利不卡视频| 国产毛片精品国产一区二区三区| 日本va欧美va精品发布| 亚洲v精品v日韩v欧美v专区| 亚洲一区二区av在线| 一区二区三区影院| 亚洲另类在线一区| 亚洲在线视频网站| 亚洲v精品v日韩v欧美v专区 | 一本在线高清不卡dvd| www.亚洲激情.com| 成人app在线观看| 91亚洲永久精品| 91麻豆国产自产在线观看| 91免费版在线看| 91在线观看免费视频| 波多野结衣中文一区| 国产一区不卡精品| 高清国产午夜精品久久久久久| 精品一区二区三区av| 日本在线不卡视频| 五月婷婷激情综合| 中文字幕不卡三区| 欧美国产日本视频| 国产亚洲女人久久久久毛片| 精品国产污污免费网站入口| 欧美电影在线免费观看| 在线一区二区三区四区| 欧美男生操女生| 欧美日韩成人一区二区| 欧美乱妇23p| 欧美精品黑人性xxxx| 欧美精品一区二区三区高清aⅴ | 天天亚洲美女在线视频| 亚洲成人在线观看视频| 亚洲国产成人av| 亚洲欧美韩国综合色| 五月婷婷激情综合网| 日韩制服丝袜av| 日产欧产美韩系列久久99| 日本欧美一区二区| 日韩高清在线一区| 884aa四虎影成人精品一区| 91精品国产综合久久久蜜臀粉嫩 | 日韩av不卡在线观看| 三级久久三级久久久| 日本色综合中文字幕| 另类小说欧美激情| 国产一区二区三区免费在线观看 | 艳妇臀荡乳欲伦亚洲一区| 亚洲777理论| 久久99久久精品| av不卡免费在线观看| 欧美色综合网站| 日韩视频免费观看高清在线视频| 精品国产自在久精品国产| 国产日本欧美一区二区| 偷窥国产亚洲免费视频| 狠狠色狠狠色综合系列| k8久久久一区二区三区| 欧美猛男gaygay网站| 欧美日韩色综合| 亚洲国产成人午夜在线一区| 一区二区三区久久久| 久久精品国产亚洲5555| 成人97人人超碰人人99| 97久久超碰国产精品| 日韩免费高清视频| 中文字幕不卡三区| 日韩国产在线观看一区| 国产精品一区二区在线观看不卡| 欧美日韩一区精品| 久久久91精品国产一区二区精品| 亚洲激情五月婷婷| 国产在线精品免费| 色狠狠色噜噜噜综合网| 日韩一区在线免费观看| 美女任你摸久久| 色乱码一区二区三区88 | 免费成人美女在线观看| 在线一区二区三区| 国产日产欧美一区二区视频| 欧美aaaaa成人免费观看视频| 成人性视频网站| 亚洲素人一区二区| 国产一区二区视频在线| 欧美日韩一本到| 国产精品色呦呦| 美日韩黄色大片| 日韩视频中午一区| 亚洲444eee在线观看| 99视频精品全部免费在线| 精品国产1区2区3区| 久久精品国产99久久6| 欧美色综合天天久久综合精品|