亚洲欧美第一页_禁久久精品乱码_粉嫩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 Flashtype16();extern int EndFlashtype16();extern int Flashwrite16();extern int EndFlashwrite16();extern int Flashewrite16();extern int EndFlashewrite16();extern int Flasherase16();extern int EndFlasherase16();int FlashOpError(), FlashWidthNotSupported();/* 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[] = {        AMD29F800B, "AMD-29F800B",        AMD29F800T, "AMD-29F800T",};int SectorSizes800B[] = {        0x4000, 0x2000, 0x2000, 0x8000,        0x10000, 0x10000, 0x10000, 0x10000,        0x10000, 0x10000, 0x10000, 0x10000,        0x10000, 0x10000, 0x10000, 0x10000,        0x10000, 0x10000, 0x10000};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\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 *)Flashtype16,(ulong *)EndFlashtype16) < 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 *)Flasherase16,(ulong *)EndFlasherase16) < 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 *)Flashwrite16,(ulong *)EndFlashwrite16) < 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;    /* Source and destination addresses must be long-aligned. */    if (((int)src & 3) || ((int)dest & 3))        return(-1);    /* If the protection window is closed, then verify that no protected */    /* sectors will be written over... */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av电影天堂一区二区在线| 亚洲综合一二区| 91精品欧美久久久久久动漫| 91豆麻精品91久久久久久| www.av精品| 99久久精品99国产精品| 99麻豆久久久国产精品免费优播| 国产精品99久久久久久有的能看 | 国产东北露脸精品视频| 另类中文字幕网| 国产在线国偷精品产拍免费yy| 久久99精品久久久久久国产越南 | 国产综合色在线视频区| 国产制服丝袜一区| 国内外成人在线视频| 琪琪久久久久日韩精品| 精品一区二区三区在线视频| 国产在线视频精品一区| 懂色av噜噜一区二区三区av| 成人一级黄色片| 色婷婷av久久久久久久| 欧美色国产精品| 欧美一区日本一区韩国一区| 久久人人爽爽爽人久久久| 欧美国产成人在线| 亚洲影视在线观看| 蜜臀久久久久久久| 成人性生交大片免费看中文网站| 成人午夜在线播放| 在线免费观看日本欧美| 欧美一区二区三区四区五区 | 亚洲精品一区二区三区蜜桃下载 | 欧美精品在线视频| 久久婷婷综合激情| 亚洲摸摸操操av| 日本欧美一区二区三区| 国产91综合网| 91福利视频网站| 久久免费视频色| 亚洲第一搞黄网站| 成人av网站免费观看| 欧美日韩精品福利| 国产精品国产a级| 日韩av电影免费观看高清完整版 | 亚洲欧美福利一区二区| 蜜桃av一区二区在线观看| 丁香亚洲综合激情啪啪综合| 欧美日韩在线免费视频| 国产清纯美女被跳蛋高潮一区二区久久w | 国产一区二区美女诱惑| 色偷偷成人一区二区三区91| 日韩欧美久久一区| 一区二区三区在线视频播放| 国产一区二区免费在线| 5566中文字幕一区二区电影| 亚洲欧洲日韩在线| 国产美女在线精品| 欧美一区在线视频| 亚洲国产欧美一区二区三区丁香婷| 国产高清亚洲一区| 欧美精品一区二区三区蜜桃| 亚洲成va人在线观看| 色又黄又爽网站www久久| 久久久99精品免费观看不卡| 日本一道高清亚洲日美韩| 色综合久久中文综合久久牛| 中文字幕免费不卡| 国产九九视频一区二区三区| 日韩精品一区二区三区蜜臀| 亚洲电影在线免费观看| 91国产免费看| 亚洲精品久久久蜜桃| 99久久久无码国产精品| 欧美国产一区视频在线观看| 韩国一区二区在线观看| 精品久久久久一区二区国产| 美女视频黄 久久| 日韩欧美成人一区二区| 日本强好片久久久久久aaa| 欧美日韩一级片在线观看| 一区二区三区中文字幕| 91国内精品野花午夜精品| 亚洲女人小视频在线观看| 99热精品国产| 一区二区三区在线视频播放| 色欧美片视频在线观看在线视频| 国产精品久久久久久久第一福利| 暴力调教一区二区三区| 亚洲视频中文字幕| 欧美日韩在线播| 日韩中文字幕1| 欧美xxxxx牲另类人与| 国产精品亚洲一区二区三区妖精| 欧美国产一区二区| 在线一区二区三区| 日韩av一区二区在线影视| 欧美成人综合网站| 成人午夜av影视| 亚洲午夜久久久| 欧美精三区欧美精三区| 狠狠久久亚洲欧美| 成人欧美一区二区三区白人| 欧美特级限制片免费在线观看| 亚洲电影在线免费观看| 精品对白一区国产伦| 99在线精品视频| 午夜视频一区在线观看| 精品三级在线观看| 91小宝寻花一区二区三区| 亚洲第一主播视频| 久久伊人中文字幕| 91国产免费看| 久久超级碰视频| 国产精品国产自产拍在线| 欧美亚洲综合在线| 国产一区二区三区蝌蚪| 亚洲一二三四久久| 久久久不卡网国产精品一区| 在线一区二区三区四区五区| 久久99久久99| 亚洲精品国产一区二区三区四区在线 | 日本少妇一区二区| 亚洲欧洲韩国日本视频| 91精品国产91久久久久久最新毛片 | 欧美日韩国产另类不卡| 国产成人av电影在线| 亚洲国产成人精品视频| 国产偷国产偷精品高清尤物 | 天堂午夜影视日韩欧美一区二区| 久久久91精品国产一区二区精品 | 欧美大度的电影原声| 色哟哟国产精品| 国产又粗又猛又爽又黄91精品| 亚洲v日本v欧美v久久精品| 欧美国产欧美综合| 精品国产乱码久久久久久夜甘婷婷 | 国产精品亚洲视频| 蜜桃视频一区二区| 亚洲成人av一区二区| 亚洲欧美日韩久久精品| 久久亚洲精华国产精华液 | 91免费在线播放| 国内成人精品2018免费看| 亚洲成人一区在线| 中文字幕一区二区三区乱码在线| 欧美视频在线观看一区二区| 国产精品99久久久久| 狠狠色2019综合网| 性欧美疯狂xxxxbbbb| 国产精品久久久久7777按摩| 欧美一区二区观看视频| 欧美一级精品在线| 欧美日韩一级片在线观看| 不卡大黄网站免费看| 国产曰批免费观看久久久| 美女视频黄 久久| 亚洲va韩国va欧美va精品| 国产精品国产三级国产普通话99| 欧美xingq一区二区| 欧美一区二区在线视频| 精品视频一区二区三区免费| 欧美日韩在线免费视频| 色琪琪一区二区三区亚洲区| av亚洲精华国产精华精| 国产91对白在线观看九色| 成人黄色av电影| 国产精品亚洲一区二区三区妖精 | 欧美日韩一区三区四区| 97久久精品人人做人人爽 | 欧美日韩在线不卡| 欧美最新大片在线看| 99视频在线精品| 99精品欧美一区二区三区综合在线| 国产精品一区二区久久不卡| 偷拍一区二区三区| 午夜影院久久久| 午夜av电影一区| 亚瑟在线精品视频| 国产精品一级黄| 成人性视频网站| 91美女精品福利| 91国产免费看| 精品免费国产二区三区| 精品国产伦理网| 中日韩免费视频中文字幕| 国产精品视频一二三| 国产精品久久久久久久浪潮网站| 国产精品传媒在线| 亚洲综合在线观看视频| 午夜精品影院在线观看| 美女在线观看视频一区二区| 狠狠v欧美v日韩v亚洲ⅴ| 国产福利视频一区二区三区| 成人听书哪个软件好| 国产精品白丝av| 91在线精品一区二区| 99re热这里只有精品免费视频| 欧美日韩国产经典色站一区二区三区| 正在播放一区二区| 久久精品综合网|