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

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

?? tfs.c

?? flash文件系統實現
?? C
?? 第 1 頁 / 共 5 頁
字號:
    /* If the incoming TDEV pointer is NULL, then we can assume a global     * clear and go ahead and cleanup everything; otherwise, we just return     * here.     */    if (tdp != (TDEV *)0)        return;    /* Turn off tracing. */    tfsTrace = 0;    /* Init the time retrieval function pointers to their dummy values. */    tfsGetAtime = dummyAtime;    tfsGetLtime = dummyLtime;    /* Default to using standard docommand() within scripts. */     //comment by xxd 2003/9/10    //tfsDocommand = docommand;    /* Start off with a buffer for 16 files.  This is probably more than     * will be used, so it avoids reallocations in tfsreorder().     */    tfsAlistSize = 16;    tfsAlist = (TFILE **)malloc((tfsAlistSize+1) * sizeof(TFILE **));    if (!tfsAlist) {        printf("tfsclear(): tfsAlist allocation failed\n");        tfsAlistSize = 0;    }}/* tfsstalecheck(): *  Called at startup to clean up any file that may be in STALE mode. *  A file is stale if it was in the process of being modified *  and a power hit occurred.  Refer to notes in tfsadd() for details. *  There are a few cases to be covered here... *  1. there is no stale file; so there is nothing to do. *  2. there is a stale file, but no other file with the same name... *      In this case, the stale file must be copied to another file (with the *      TFS_NSTALE flag set) and the stale file is deleted. *  3. there is stale file and another file with the same name... *      In this case, the stale file is simply deleted because the other file *      with the same name is newer. */ static voidtfsstalecheck(int verbose){    int     err;    ulong   flags;    TDEV    *tdp;    TFILE   *tfp, *tfpa;    char    buf[16];    tfpa = (TFILE *)0;    for(tdp=tfsDeviceTbl;tdp->start != TFSEOT;tdp++) {        tfp = (TFILE *)tdp->start;        tfpa = (TFILE *)0;        while(validtfshdr(tfp)) {            if (TFS_FILEEXISTS(tfp)) {                if (tfpa) {                    if (!strcmp(TFS_NAME(tfp),TFS_NAME(tfpa))) {                        _tfsunlink(TFS_NAME(tfpa));                        return;                    }                }                else if (TFS_STALE(tfp)) {                    tfpa = tfp;                }            }            tfp = nextfp(tfp,tdp);        }        if (tfpa)            break;    }    if (tfpa) {        char    name[TFSNAMESIZE+1];        strcpy(name,TFS_NAME(tfpa));        if (verbose)            printf("TFS stale fixup (%s)...\n",name);        flags = TFS_FLAGS(tfpa) | TFS_NSTALE;        err = tfsadd(TFS_NAME(tfpa),TFS_INFO(tfpa),tfsflagsbtoa(flags,buf),            (uchar *)(TFS_BASE(tfpa)),TFS_SIZE(tfpa));        /* If rewrite was successful, then remove the stale one;         * else, leave it there and report the error.         */        if (err == TFS_OKAY) {            _tfsunlink(TFS_NAME(tfpa));        }        else {            printf("TFS stalecheck(%s) error: %s\n",name,tfserrmsg(err));        }    }}/* tfsdevtblinit(): *  Transfer the information in tfsdevtbl (in tfsdev.h) to tfsDeviceTbl[]. *  In most cases, this will be a simple copy.  If the device flag is set *  to indicate that the initalization is dynamic, then use the flash  *  ops to retrieve the information from the specified bank. * *  For dynamic configuration, the "start" member of the tfsdev structure *  must be set in tfsdev.h and the "devinfo & TFS_DEVINFO_BANKMASK" area *  must contain the number of the last flash bank that is to be part of *  the TFS device.  Typically this value is the same bank number as the *  starting bank, but it could span across multiple contiguous banks *  if the hardware is set up that way. * *  To support the use of top-boot devices, plus the TFS requirement that *  the SPARE sector be at-least as large as any other sector in the device, *  this code will automatically step down the sector list until it finds *  the first large sector below all the small ones usually at the top of *  a top-boot device.  The call to lastlargesector() takes care of this. * *  NOTE: *   This dynamic configuration assumes that the end of the TFS space is *   just below the beginning of the spare space. * */voidtfsdevtblinit(void){    int     i, startsector, endsector, bank;    TDEV    *tDp, *tdp;    for(i=0;i<TFSDEVTOT;i++) {        tdp = &tfsdevtbl[i];        tDp = &tfsDeviceTbl[i];        *tDp = *tdp;        if (i == TFSDEVTOT-1)            break;        if (tdp->devinfo & TFS_DEVINFO_DYNAMIC) {            bank = tDp->devinfo & TFS_DEVINFO_BANKMASK;            /* The spare sector may not be the last sector in the device...             * device.  Especially if the device is TopBoot type.             */            if (lastlargesector(bank,&endsector,                (int *)&tDp->sparesize,(uchar **)&tDp->spare) == -1)                break;            tDp->end = tDp->spare - 1;            if (addrtosector((uchar *)tDp->start,&startsector,0,0) == -1)                break;            tDp->sectorcount = endsector - startsector;        }    }}/* tfsstartup(): *  Called at system startup to get things properly initialized. */voidtfsstartup(){    tfsdevtblinit();    tfsclear((TDEV *)0);    tfsfixup(3,0);    tfsstalecheck(1);}/* tfsexec: Treat the file as machine code that is COFF or ELF. */static inttfsexec(TFILE *fp,int verbose){    int err, (*entry)();    long    address;    err = tfsloadebin(fp,verbose,&address,0);    if (err != TFS_OKAY)        return(err);    entry = (int(*)())address;    ctxAPP();           /* Change context to APPLICATION. */    entry();            /* Call entrypoint (may not return). */    ctxMON();           /* Change context to APPLICATION. */    return(TFS_OKAY);}/* tfsmemset(): *  Superset of memset().  Includes verbose option plus verification after *  set. */inttfsmemset(uchar *to,uchar val,int count,int verbose,int verifyonly){    int     failed;    uchar   *end;    failed = 0;    if (verbose) {        printf("%s %7d bytes  at  0x%08lx to 0x%02x",            verifyonly ? "vrfy" : "set ",count,(ulong)to,val);    }    if (count == 0)        goto done;    end = to+count;    if (verifyonly) {        while(to < end) {            if (*to++ != val) {                failed = 1;                break;            }        }    }    else {        while(to < end) {            *to = val;            if (*to++ != val) {                failed = 1;                break;            }        }    }done:    if (verbose) {        if (failed)            printf(" failed");        else if (verifyonly)            printf(" OK");        printf("\n");    }    if (failed)        return(TFSERR_MEMFAIL);    else        return(TFS_OKAY);}/* tfsmemcpy(): *  Superset of memcpy().  Includes verbose option plus verification after *  copy.  Takes advantage of address alignment when possible. */inttfsmemcpy(uchar *to,uchar *from,int count,int verbose,int verifyonly){    int err;    register uchar  *end;    if (verbose)        printf("%s %7d bytes from 0x%08lx to 0x%08lx",            verifyonly ? "vrfy" : "copy", count,(ulong)from,(ulong)to);    if (verifyonly) {        while(count) {            if (*to != *from)                break;            to++;            from++;            count--;        }        if (count) {            if (verbose) {                printf(" FAILED\n");                printf("            (0x%02x @ 0x%08lx should be 0x%02x)\n",                    *to,(ulong)to,*from);            }            return(TFSERR_MEMFAIL);        }        else            if (verbose)                printf(" OK\n");            return(TFS_OKAY);    }    if (count == 0)        goto done;    if (to != from) {        err = 0;        if (!((int)to & 3) && !((int)from & 3) && !(count & 3)) {            register ulong  *lto, *lfrom, *lend;                count >>= 2;            lto = (ulong *)to;            lfrom = (ulong *)from;            lend = lto + count;            while(lto < lend) {                *lto = *lfrom;                if (*lto != *lfrom) {                    err = 1;                    break;                }                lto++;                lfrom++;            }        }        else if (!((int)to & 1) && !((int)from & 1) && !(count & 1)) {            register ushort *sto, *sfrom, *send;                count >>= 1;            sto = (ushort *)to;            sfrom = (ushort *)from;            send = sto + count;            while(sto < send) {                *sto = *sfrom;                if (*sto != *sfrom) {                    err = 1;                    break;                }                sto++;                sfrom++;            }        }        else {            end = to + count;            while(to < end) {                *to = *from;                if (*to != *from) {                    err = 1;                    break;                }                to++;                from++;            }        }        if (err) {            if (verbose)                printf(" failed\n");            return(TFSERR_MEMFAIL);        }    }done:    if (verbose)        printf("\n");    return(TFS_OKAY);}/* struct tfsran:    Used by tfsrunboot only.  No need to put this in tfs.h. */struct tfsran {    char name[TFSNAMESIZE+1];};/* tfsrunboot(): *  This function is called at monitor startup.  It scans the list of *  files built by tfsreorder() and executes each file in the list that has *  the BRUN flag set.  As each file is run its name is added to the *  ranlist[] table. *   *  After each file is run, there is a check made to see if the flash has *  been modified.  If yes, then tfsreorder() is run again and we start  *  over at the top of the list of files organized by tfsreorder().  As *  we step through the tfsAlist[] array, if the file has a BRUN flag set *  but it is already in the ranlist[] table, it is not run again. *      *  This scheme allows a file in the initial list of BRUN files to modify *  the file list without confusing the list of files that are to be run. *  Files (even new BRUN files) can be added to the list by some other BRUN *  file, and these new files will be run. */inttfsrunboot(){    static  struct  tfsran *ranlist;    char    *argv[2];    int     rancnt, aidx, ridx, err, fmodcnt;    /* The argv[] array is used by tfsrun(); argv[0] is name of file to be     * executed, argv[1] must be nulled to indicate no command line args     * passed to the BRUN file/script.     */    argv[1] = (char *)0;    /* Keep a local copy of tfsFmodCount so that we can determine if flash     * was modified by one of the BRUN files executed.     */    fmodcnt = tfsFmodCount;    /* Create list of file pointers (tfsAlist[]) in alphabetical order     * based on name...     */    if ((err = tfsreorder()) < 0) {        printf("tfsrunboot() reorder1: %s\n",tfserrmsg(err));        return(-1);    }    /* Clear the ranlist pointer. This pointer is the base address of a     * list of file names that have been run.     */    rancnt = 0;    ranlist = (struct tfsran *)0;restartloop:    for (aidx=0;tfsAlist[aidx];aidx++) {        char    fname[TFSNAMESIZE+1];        int     alreadyran;        TFILE   *fp;        struct  tfsran *rp;        fp = tfsAlist[aidx];        strcpy(fname,TFS_NAME(fp));        /* If the file has no BRUN flag set, just continue.  If a BRUN flag         * is set, then see if the file has already been run.  If yes, then         * just continue; else run the file.         */        alreadyran = 0;        if (fp->flags & (TFS_BRUN | TFS_QRYBRUN)) {            for(ridx=0;ridx<rancnt;ridx++) {                if (!strcmp(ranlist[ridx].name,fname)) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久er热在这里只有精品66| 亚洲欧美另类久久久精品 | 激情六月婷婷综合| 日韩一区二区电影网| 日韩av一区二区在线影视| 91麻豆精品国产91久久久久久 | 另类欧美日韩国产在线| 精品欧美一区二区在线观看| 精品一区二区久久| 中文字幕精品在线不卡| 91一区二区三区在线播放| 亚洲国产中文字幕在线视频综合| 欧美色图12p| 久久99精品久久久久久国产越南| 国产日产欧产精品推荐色| 成人国产精品免费观看动漫| 亚洲免费大片在线观看| 69久久夜色精品国产69蝌蚪网| 久久福利视频一区二区| 国产精品欧美久久久久一区二区 | 成人美女视频在线观看| 亚洲欧美电影一区二区| 欧美日韩电影在线播放| 韩国在线一区二区| 国产精品萝li| 欧美一二三四在线| 不卡在线观看av| 日本亚洲视频在线| 亚洲日本欧美天堂| 日韩一区二区三区av| 9i在线看片成人免费| 日韩福利电影在线观看| 国产精品毛片a∨一区二区三区| 欧美人牲a欧美精品| 风间由美一区二区av101| 午夜精品一区二区三区电影天堂| 久久久久久日产精品| 欧美人与禽zozo性伦| 成人黄动漫网站免费app| 免费欧美在线视频| 亚洲综合999| 中国色在线观看另类| 91精品国产乱码久久蜜臀| 不卡一区中文字幕| 亚洲天堂网中文字| 欧美一级xxx| 99re热视频这里只精品| 蜜臀a∨国产成人精品| 亚洲欧洲日本在线| 欧美剧在线免费观看网站| 国产风韵犹存在线视精品| 亚洲欧美另类综合偷拍| 日韩美一区二区三区| 一本色道久久综合亚洲91| 久久精品99国产精品日本| 亚洲色图一区二区| 久久一区二区视频| 欧美探花视频资源| 成人影视亚洲图片在线| 日韩av网站在线观看| 亚洲特级片在线| 久久久久久电影| 欧美日韩中文字幕精品| 91视频观看视频| 黑人巨大精品欧美一区| 亚洲高清免费视频| 国产精品国产三级国产aⅴ无密码| 欧美日韩成人一区二区| 99精品视频在线观看免费| 久久国产精品72免费观看| 亚洲成人免费影院| 自拍偷拍欧美精品| 国产无一区二区| 日韩午夜电影在线观看| 欧美在线免费观看亚洲| 99精品国产热久久91蜜凸| 国产高清不卡一区二区| 激情偷乱视频一区二区三区| 免费在线观看成人| 亚洲成人动漫av| 亚洲免费av网站| 国产精品国产馆在线真实露脸| 日韩欧美国产三级电影视频| 日韩欧美高清dvd碟片| 欧美日韩大陆一区二区| 在线看国产日韩| 在线免费视频一区二区| 97aⅴ精品视频一二三区| 激情小说亚洲一区| 国内精品伊人久久久久av一坑| 免费看日韩精品| 日韩电影在线观看一区| 三级欧美韩日大片在线看| 日日嗨av一区二区三区四区| 午夜日韩在线电影| 调教+趴+乳夹+国产+精品| 亚洲午夜影视影院在线观看| 一区二区免费看| 亚洲第一狼人社区| 首页亚洲欧美制服丝腿| 日韩av成人高清| 蜜桃av噜噜一区二区三区小说| 三级一区在线视频先锋 | 成人ar影院免费观看视频| 99精品视频一区二区| 色综合久久综合| 欧美三级中文字幕在线观看| 在线观看91精品国产入口| 91.com视频| 精品国产凹凸成av人导航| 久久综合网色—综合色88| 久久免费的精品国产v∧| 中文字幕在线不卡国产视频| 亚洲天堂2014| 天天综合天天做天天综合| 九九热在线视频观看这里只有精品| 狠狠色综合日日| 国产高清在线精品| 91毛片在线观看| 色婷婷综合久久久| 精品久久久久久无| 中文字幕在线不卡一区| 性感美女极品91精品| 精品一区二区三区影院在线午夜 | 99视频热这里只有精品免费| 一本大道久久a久久精品综合| 欧美亚男人的天堂| 欧美日韩小视频| 中文字幕第一页久久| 亚洲国产精品久久不卡毛片 | 九九**精品视频免费播放| 国产suv精品一区二区883| 91玉足脚交白嫩脚丫在线播放| 在线播放91灌醉迷j高跟美女| 欧美大尺度电影在线| 国产精品人妖ts系列视频| 亚洲高清不卡在线| 成人精品在线视频观看| 7777精品伊人久久久大香线蕉超级流畅 | 亚洲精品欧美激情| 午夜影院久久久| 99久久免费国产| 26uuu精品一区二区| 亚洲最新在线观看| 国内久久精品视频| 欧美亚洲另类激情小说| 久久欧美一区二区| 亚洲一区二区三区四区中文字幕| 久久99久久精品| 欧美日韩久久不卡| 国产精品欧美一区二区三区| 老色鬼精品视频在线观看播放| 99久久精品99国产精品| 久久久久久久综合| 日韩av在线免费观看不卡| 91在线观看高清| 中文字幕av资源一区| 美洲天堂一区二卡三卡四卡视频| 色一区在线观看| 国产欧美精品一区| 国产麻豆精品在线观看| 在线播放91灌醉迷j高跟美女| 亚洲男人电影天堂| 成人深夜福利app| 欧美哺乳videos| 日韩影院在线观看| 欧美伊人久久久久久久久影院| 久久久不卡影院| 久久99最新地址| 精品久久久久久亚洲综合网| 午夜电影久久久| 精品1区2区3区| 亚洲一区在线视频| 91同城在线观看| 1000部国产精品成人观看| 豆国产96在线|亚洲| 久久综合久久99| 成人妖精视频yjsp地址| 久久精品免视看| 成人一道本在线| 中文字幕亚洲一区二区av在线| 精品一区二区综合| 国产精品色呦呦| 成人毛片在线观看| 国产精品美女久久久久aⅴ| 国产精品一区二区不卡| 精品国产髙清在线看国产毛片 | 成人免费在线播放视频| 波多野结衣一区二区三区| 国产精品三级视频| 国产成人精品www牛牛影视| 亚洲精品一区二区三区精华液 | 日本电影亚洲天堂一区| 一区二区三区免费观看| 欧美日韩日本视频| 欧美aaa在线| 久久色在线视频| 久久99热这里只有精品| 国产视频一区二区在线观看| 成人av一区二区三区|