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

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

?? tffsconfig.c

?? VxWorks BSP 下s3C44b0的源代碼
?? C
字號:
/* tffsConfig.c - TrueFFS configuration file for VxWorks */


/* Copyright 1984-2001 Wind River Systems, Inc. */
#include "copyright_wrs.h"

/* FAT-FTL Lite Software Development Kit
 * Copyright (C) M-Systems Ltd. 1995-2001	*/

/*
modification history
--------------------
01o,29jul04,a_m  BSP定制 for 多刃劍開發板
01v,28mar02,nrv  adding INCLUDE_MTD_CFIAMD
01u,12dec01,nrv  supressing the compiler warning on tffsVersion
01t,07nov01,yp  fixing SPR #63838
01s,02nov01,nrv  changing the version number to 2.2
01r,17sep01,yp  merging code changes from T3. Preserving T2 specifics that
                 were removed in T3
01q,25apr01,mem  Remove NFTL, CDSN and DOC2.
01p,20dec00,tlc  Add user-defined "Identify" routine to MTD table.
01t,23apr01,yp  Incrementing version number to 2.1
01s,29nov00,tlc  Added MTD_USR_IDENTIFY to the mtdTable. This allows
                 user-defined identify routines to be used for trueFFS
		                  support.
01r,06Sep00,csh  Added code to free pBuf on error SPR #34246
01q,06Sep00,csh  Added check for pBuf == NULL SPR #34246
01p,01Sep00,csh  Removed MACRO for INCLUDE_SHOW_ROUTINES
01o,04feb99,yp   added MACRO INCLUDE_TFFS_SHOW for better scalability.
01m,21apr98,yp   added tffs subdir to include path
01n,28feb98,kbw  made man page edits to fix problems found by QE
01m,28feb98,kbw  made man page edits
01l,19jan98,hdn  added new function tffsShowAll().
01k,08jan98,hdn  added new MTD for Heurikon Baja4700.
01j,06jan98,hdn  cleaned up tffsShow() and tffsBootImagePut().
01i,18dec97,yp   added documentation on sharing bootrom with TFFS
01h,15dec97,yp   doc cleanup
01g,11dec97,hdn  added tffsRawio()'s return value check in tffsShow().
01f,08dec97,hdn  renamed mkbootTffs() to tffsCopy().
01e,05dec97,hdn  changed tffsSocket[] to LOCAL variable.
01d,05dec97,hdn  added tffsShow() and mkbootTffs().
01c,11nov97,hdn  fixed documentation of flRegisterComponents().
01b,07nov97,hdn  cleaned up.
01a,07jul97,ami  written by Amirban at M-Systems
*/

/*
DESCRIPTION
This source file, with the help of sysTffs.c, configures TrueFFS for VxWorks.  
The functions defined here are generic to all BSPs.  To include these functions
in the BSP-specific module, the BSP's sysTffs.c file includes this file.  
Within the sysTffs.c file, define statements determine which functions from 
the tffsConfig.c file are ultimately included in TrueFFS.

The only externally callable routines defined in this file 
are tffsShow(), tffsShowAll(), and tffsBootImagePut().  You can
exclude the show utilities if you edit config.h and 
undefine INCLUDE_SHOW_ROUTINES.  You can exclude tffsBootImagePut() if you
edit sysTffs.c and undefine INCLUDE_TFFS_BOOT_IMAGE.  (If you find these
utilities are missing and you want them included, edit config.h and 
define INCLUDE_SHOW_ROUTINES and INCLUDE_TFFS_BOOT_IMAGE.)

If you wish to include only the TrueFFS specific show routines you could
define INCLUDE_TFFS_SHOW instead of INCLUDE_SHOW_ROUTINES in config.h.

However, for the most part, these externally callable routines are only 
a small part of the TrueFFS configuration needs handled by this file.  
The routines internal to this file make calls into the MTDs and translation 
layer modules of TrueFFS.  At link time, resolving the symbols associated 
with these calls pulls MTD and translation layer modules into VxWorks. 

However, each of these calls to the MTDs and the translation layer modules
is only conditionally included.  The constants that control the includes
are defined in sysTffs.c.  To exclude an MTD or translation layer module,
you edit sysTffs.c, undefine the appropriate constant, and rebuild sysTffs.o.
These constants are described in the reference entry for 'sysTffs'. 

INCLUDE FILES: stdcomp.h
*/


/* includes */

#include "tffs/stdcomp.h"
#include "tffs/tffsDrv.h"
#include "tffs/fatlite.h"
#include "stdio.h"


/* defines */

#ifdef INCLUDE_SHOW_ROUTINES
#define INCLUDE_TFFS_SHOW
#endif /* INCLUDE_SHOW_ROUTINES */

/* externs */

/*  : added */
#ifdef INCLUDE_MTD_SST39VF160	
FLStatus  sst39vf160Identify (FLFlash vol);
#endif /* INCLUDE_MTD_SST39VF160 */

#ifdef INCLUDE_MTD_USR
FLStatus  MTD_USR_IDENTIFY (FLFlash vol);
#endif /* INCLUDE_MTD_USR */

/* globals */

MTDidentifyRoutine mtdTable[] = 	/* MTD tables */
    {
#ifdef  INCLUDE_MTD_CFIAMD
    cfiAmdIdentify,
#endif  /* INCLUDE_MTD_CFIAMD */

#ifdef	INCLUDE_MTD_CFISCS
    cfiscsIdentify,
#endif	/* INCLUDE_MTD_CFISCS */

#ifdef	INCLUDE_MTD_I28F016
    i28f016Identify,
#endif	/* INCLUDE_MTD_I28F016 */

#ifdef	INCLUDE_MTD_I28F008
    i28f008Identify,
#endif	/* INCLUDE_MTD_I28F008 */

#ifdef	INCLUDE_MTD_I28F008_BAJA
    i28f008BajaIdentify,
#endif	/* INCLUDE_MTD_I28F008_BAJA */

#ifdef	INCLUDE_MTD_AMD
    amdMTDIdentify,
#endif	/* INCLUDE_MTD_AMD */

#ifdef INCLUDE_MTD_USR
    MTD_USR_IDENTIFY,
#endif  /* INCLUDE_MTD_USR */

#ifdef	INCLUDE_MTD_WAMD
    flwAmdMTDIdentify,
#endif	/* INCLUDE_MTD_WAMD */

/*  : added */
#ifdef	INCLUDE_MTD_SST39VF160
    sst39vf160Identify,
#endif	/* INCLUDE_MTD_SST39VF160 */

    };
int noOfMTDs = NELEMENTS (mtdTable);	/* number of MTDs */

TLentry tlTable[] = 			/* TL tables */
    {
#ifdef	INCLUDE_TL_FTL
#ifdef	FORMAT_VOLUME
    {mountFTL, formatFTL},
#else
    mountFTL,
#endif	/* FORMAT_VOLUME */
#endif	/* INCLUDE_TL_FTL */

#ifdef	INCLUDE_TL_SSFDC
#ifdef	FORMAT_VOLUME
    {mountSSFDC, formatSSFDC},
#else
    mountSSFDC,
#endif	/* FORMAT_VOLUME */
#endif	/* INCLUDE_TL_SSFDC */
    };
int noOfTLs = NELEMENTS (tlTable);	/* number of TLs */


/* locals */

LOCAL char * tffsSocket[DRIVES] = {NULL}; /* name of the socket interface */

#ifdef INCLUDE_TFFS_SHOW 
LOCAL char * tffsVersion = "2.2";	/* WRS version number of TFFS */
#endif /* INCLUDE_TFFS_SHOW */

/* forward declarations */

LOCAL VOID sysTffsInit (void);		/* BSP dependent init routine */


/*******************************************************************************
*
* flRegisterComponents - register MTD and translation layer components for use
*
* This routine registers MTD and translation layer components for use.
* This function is called by FLite once only, at initialization of the
* FLite system.
*
* NOMANUAL
*
* RETURNS: N/A
*/

void flRegisterComponents (void)
    {
    sysTffsInit ();
    }

#ifdef	INCLUDE_TFFS_SHOW
/*******************************************************************************
*
* tffsShowAll - show device information on all socket interfaces 
*
* This routine prints device information on all socket interfaces. 
*
* RETURNS: N/A
*/

void tffsShowAll (void)
    {
    int ix;

    printf ("TFFS Version %s\n", tffsVersion);
    for (ix = 0; ix < noOfDrives; ix++)
	tffsShow (ix);
    }

/*******************************************************************************
*
* tffsShow - show device information on a specific socket interface 
*
* This routine prints device information on the specified socket interface. 
* This information is particularly useful when trying to determine the 
* number of Erase Units required to contain a boot image.  The field called
* unitSize reports the size of an Erase Unit.
*
* If the process of getting physical information fails, an error code is 
* printed. The error codes can be found in flbase.h.
*
* RETURNS: N/A
*/

void tffsShow 
    (
    int driveNo			/* TFFS drive number */
    )
    {
    PhysicalInfo info;
    FLStatus status;

    if (tffsSocket[driveNo] == NULL)
	{
        printf ("%d: ---- no socket interface installed ----\n", driveNo);
	return;
	}
    status = tffsRawio (driveNo, TFFS_GET_PHYSICAL_INFO, (int)&info, 0, 0);
    if (status != OK)
	{
        printf ("%d: **** communication failed with error %d ****\n",
                driveNo, status);
	return;
	}
    printf ("%d: socket=%s: ", driveNo, tffsSocket[driveNo]);
    printf ("type=0x%x, unitSize=0x%x, mediaSize=0x%x\n", info.type, 
	    (UINT)info.unitSize, (UINT)info.mediaSize);
    }

#endif	/* INCLUDE_TFFS_SHOW */

#ifdef	INCLUDE_TFFS_BOOT_IMAGE
/*******************************************************************************
*
* tffsBootImagePut - write to the boot-image region of the flash device
*
* This routine writes an input stream to the boot-image region (if any) of 
* a flash memory device.  Typically, the input stream contains a boot image, 
* such as the VxWorks boot image, but you are free to use this function to 
* write any data needed. The size of the boot-image region is set by 
* the tffsDevFormat() call (or the sysTffsFormat() call, a BSP-specific helper 
* function that calls tffsDevFormat() internally) that formats the flash 
* device for use with TrueFFS.  
* 
* If tffsBootImagePut() is used to put a VxWorks boot image in flash, you 
* should not use the s-record version of the boot image typically produced 
* by make.  Instead, you should take the pre s-record version (usually 
* called 'bootrom' instead of 'bootrom.hex'), and filter out its loader 
* header information using an <xxx>'ToBin' utility.  For example: 
* .CS
* elfToBin < bootrom > bootrom.bin
* .CE
* 
* Use the resulting 'bootrom.bin' as input to tffsBootImagePut(). 
* 
* The discussion above assumes that you want only to use the flash device to
* store a VxWorks image that is retrieved from the flash device and then run 
* out of RAM. However, because it is possible to map many flash devices 
* directly into the target's memory, it is also possible run the VxWorks 
* image from flash memory, although there are some restrictions:
* .IP "-"
* The flash device must be non-NAND. 
* .IP "-"
* Only the text segment of the VxWorks image ('vxWorks.res_rom') may run out 
* of flash memory. The data segment of the image must reside in standard RAM. 
* .IP "-"
* No part of the flash device may be erased while the VxWorks image is running 
* from flash memory. 
* .LP
* Because TrueFFS garbage collection triggers an erase, this last restriction 
* means that you cannot run a VxWorks boot image out of a flash device that 
* must also support a writable file system (although a read-only file system 
* is OK). 
* 
* This last restriction arises from the way in which flash devices are
* constructed. The current physical construction of flash memory devices does 
* not allow access to the device while an erase is in 
* progress anywhere on the flash device. As a result, if TrueFFS tries to 
* erase a portion of the flash device, the entire device becomes inaccessible 
* to all other users.  If that other user happens to be the VxWorks image 
* looking for its next instruction, the VxWorks image crashes.
*
*RETURNS: OK or ERROR
*/

STATUS tffsBootImagePut 
    (
    int driveNo,		/* TFFS drive number */
    int offset,			/* offset in the flash chip/card */
    char * filename		/* binary format of the bootimage */
    )
    {
    PhysicalInfo info;
    UINT unitNo;
    UINT unitSize;
    UINT addr;
    char * pBuf;
    int fd;
    int ix;

    if (tffsSocket[driveNo] == NULL)
	return (ERROR);

    if (tffsRawio (driveNo, TFFS_GET_PHYSICAL_INFO, (int)&info, 0, 0) != OK)
        {
        printErr ("Unable to get physical info from drive\n");
	return (ERROR);
	}

    if ((pBuf = (char *)malloc (info.unitSize)) == NULL)
	{
       	printErr ("Can't allocate %d bytes of memory\n", info.unitSize);
	return( ERROR ) ;
	}

    if ((fd = open (filename, O_RDONLY, 0644)) == ERROR)
        {
        printErr ("Can't open \"%s\"\n", filename);
	free( pBuf ) ;
        return (ERROR);
	}

    addr = offset;
    unitNo = offset / info.unitSize;
    unitSize = info.unitSize - (offset % info.unitSize);

    /* If the offset is not Erase Unit aligned we need to save the the
     * contents of the region begining at the start of this erase unit 
     * and ending at the specified address so we can restore it after
     * we erase the Erase Unit
     */
    if (tffsRawio (driveNo, TFFS_PHYSICAL_READ, unitNo * info.unitSize,
	           offset % info.unitSize, (int)pBuf) != OK)
        {
	printErr ("Failed attempting to save Erase Unit %d\n", unitNo);
	close (fd);
	free( pBuf ) ;
	return (ERROR);
	}
        
    if (tffsRawio (driveNo, TFFS_PHYSICAL_ERASE, unitNo, 1, 0) != OK)
	{
	printErr ("Failed attempting to erase Erase Unit %d\n", unitNo);
	close (fd);
	free( pBuf ) ;
	return (ERROR);
	}

    if (tffsRawio (driveNo, TFFS_PHYSICAL_WRITE, unitNo * info.unitSize,
	           offset % info.unitSize, (int)pBuf) != OK)
        {
	printErr ("Failed attempting to restore Erase Unit %d\n", unitNo);
	close (fd);
	free( pBuf ) ;
	return (ERROR);
	}

    while (unitSize)
	{
        if ((ix = read (fd, pBuf, unitSize)) == ERROR)
            {
            printErr ("Error reading inputfile: 0x%x\n", errno);
	    free( pBuf ) ;
            return (ERROR);
            }

        if (ix == 0)
	    break;

        if ((addr + ix) > info.mediaSize)
	    {
	    printErr ("Error : Attempting to write beyond Flash boundary\n");
	    close (fd);
	    free( pBuf ) ;
	    return (ERROR);
	    }

        if (tffsRawio (driveNo, TFFS_PHYSICAL_WRITE, addr, ix, (int)pBuf) != OK)
	    {
	    printErr ("Physical write failed at address 0x%x\n", addr);
	    close (fd);
	    free( pBuf ) ;
	    return (ERROR);
	    }

	addr += ix;
	unitSize -= ix;
	if (unitSize == 0)
	    {
            unitSize = info.unitSize;
            unitNo++;
            if (tffsRawio (driveNo, TFFS_PHYSICAL_ERASE, unitNo, 1, 0) != OK)
	        {
		printErr ("Failed attempting to erase Erase Unit %d\n", unitNo);
	        close (fd);
	        free( pBuf ) ;
	        return (ERROR);
	        }
	    }
	}

    close (fd);
    free( pBuf ) ;
    return (OK);
    }
    
#endif	/* INCLUDE_TFFS_BOOT_IMAGE */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲视频精选在线| 99久久777色| 91尤物视频在线观看| 欧美一区二区三区四区五区| 国产精品高潮呻吟久久| 毛片一区二区三区| 91福利区一区二区三区| 久久久精品国产免费观看同学| 午夜精品123| 色老汉av一区二区三区| 国产丝袜在线精品| 精品在线一区二区| 欧美一级免费观看| 亚洲一区二区三区四区中文字幕| 成人激情免费网站| 久久久99精品免费观看不卡| 美女视频黄 久久| 欧美人体做爰大胆视频| 亚洲综合视频在线观看| 91丨porny丨蝌蚪视频| 国产精品欧美久久久久无广告| 国产精品一区一区三区| 精品国产免费人成电影在线观看四季| 亚洲大片精品永久免费| 欧美日韩在线不卡| 亚洲h精品动漫在线观看| 日本精品一区二区三区高清 | 日韩女优电影在线观看| 亚洲电影第三页| 欧美午夜在线观看| 亚洲综合在线免费观看| 色噜噜久久综合| 一区二区三区四区乱视频| 91免费小视频| 亚洲一区二区欧美日韩| 欧美日韩久久一区| 日韩国产在线一| 91精品国产高清一区二区三区蜜臀 | 久久成人免费网站| 欧美成人免费网站| 久久se精品一区精品二区| 精品国产百合女同互慰| 国产精品一区二区91| 国产欧美精品一区二区色综合| 亚洲一区在线观看免费 | 久久精品网站免费观看| 国产成a人亚洲| 最好看的中文字幕久久| 色av成人天堂桃色av| 亚洲国产精品麻豆| 日韩欧美色综合| 国产成人在线视频网址| 亚洲视频每日更新| 欧美一区二区三区免费大片 | 精品电影一区二区三区| 国产一区二区伦理片| 国产精品久久三区| 欧美精品v国产精品v日韩精品| 麻豆精品久久久| 国产精品毛片高清在线完整版| 91成人看片片| 久久成人免费电影| 国产精品视频在线看| 777xxx欧美| 成人美女视频在线观看| 亚洲一二三四区不卡| 久久人人爽人人爽| 色8久久人人97超碰香蕉987| 激情综合五月天| 亚洲综合一区二区| 欧美国产精品专区| 欧美精品xxxxbbbb| eeuss影院一区二区三区| 视频在线观看91| 自拍视频在线观看一区二区| 日韩久久久精品| 在线中文字幕不卡| 国产成人在线网站| 午夜精品国产更新| 亚洲视频狠狠干| 久久久久久日产精品| 精品视频免费在线| 成人动漫视频在线| 韩国av一区二区三区| 亚洲成人av电影| 国产精品国产a级| 久久精品一区二区三区不卡牛牛| 欧美日本不卡视频| 91看片淫黄大片一级| 国产精品一区二区视频| 亚洲国产欧美一区二区三区丁香婷| 国产日韩成人精品| 久久久久一区二区三区四区| 在线电影院国产精品| 欧美午夜精品久久久久久超碰| 成人看片黄a免费看在线| 极品少妇一区二区| 美脚の诱脚舐め脚责91| 日韩精品一二区| 亚洲一区精品在线| 亚洲综合自拍偷拍| 伊人性伊人情综合网| 中文字幕一区视频| 中文字幕欧美一区| 中文字幕日韩欧美一区二区三区| 久久精品亚洲乱码伦伦中文| 26uuu久久天堂性欧美| 日韩欧美国产成人一区二区| 91精品国产综合久久久蜜臀粉嫩| 一本色道久久加勒比精品| av激情综合网| 色成人在线视频| 在线一区二区三区四区五区| 在线亚洲高清视频| 色欧美片视频在线观看在线视频| 99re热这里只有精品视频| 91美女在线观看| 91丨porny丨户外露出| 色综合激情久久| 日本韩国精品在线| 欧美日韩一区不卡| 91麻豆精品国产91久久久更新时间 | 91亚洲国产成人精品一区二区三 | 国产在线播放一区二区三区| 国产精品一二三在| aaa欧美色吧激情视频| 色婷婷av一区二区三区软件| 欧美日韩精品欧美日韩精品一| 欧美一区二区三区在线观看| xfplay精品久久| 中文字幕一区二区三中文字幕| 亚洲四区在线观看| 视频在线观看国产精品| 精品一区二区在线看| 国产成人亚洲精品青草天美| 91麻豆国产在线观看| 欧美人妇做爰xxxⅹ性高电影| 91精品国产入口在线| 国产日本一区二区| 亚洲综合丁香婷婷六月香| 亚洲成人av资源| 国产精选一区二区三区| 91在线观看污| 欧美久久久久免费| 日本一区二区视频在线| 亚洲一区二区三区四区在线| 精品一区二区在线视频| 91蜜桃在线观看| 91精品国产91久久综合桃花| 中文文精品字幕一区二区| 亚洲综合在线电影| 国产一二精品视频| 欧美一a一片一级一片| 久久夜色精品国产噜噜av| 一区二区高清视频在线观看| 久色婷婷小香蕉久久| 99热在这里有精品免费| 欧美一区二区视频在线观看2020| 中文幕一区二区三区久久蜜桃| 亚洲一区二区综合| 国产成人免费av在线| 91精品国产综合久久久久久久久久 | 亚洲福利视频一区| 粉嫩av亚洲一区二区图片| 欧美日韩一本到| 国产精品全国免费观看高清 | 亚洲成人自拍偷拍| 成人app在线观看| 日韩欧美在线一区二区三区| 亚洲日本在线天堂| 成人午夜视频网站| 日韩免费高清电影| 亚洲大片在线观看| 一本色道**综合亚洲精品蜜桃冫| 久久精品一区蜜桃臀影院| 蜜桃av噜噜一区| 欧美三级电影精品| 亚洲精品午夜久久久| av在线一区二区| 久久精品亚洲一区二区三区浴池| 美腿丝袜一区二区三区| 欧美日韩在线一区二区| 樱桃国产成人精品视频| 99久久婷婷国产综合精品| 国产午夜精品在线观看| 国产一区二区影院| 精品少妇一区二区三区日产乱码 | 亚洲小说欧美激情另类| 99久久国产综合精品女不卡| 亚洲国产精品精华液2区45| 国产一区二区91| 久久青草欧美一区二区三区| 久久国产尿小便嘘嘘尿| 欧美成人一区二区三区片免费| 秋霞午夜av一区二区三区| 欧美日本视频在线| 婷婷丁香激情综合| 欧美蜜桃一区二区三区| 亚洲成人综合视频| 91麻豆精品国产91久久久更新时间 |