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

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

?? tffsdrv.c

?? vxworks5.5.1源代碼。完整源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* tffsDrv.c - TrueFFS interface for VxWorks *//* Copyright 1984-2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*  * FAT-FTL Lite Software Development Kit * Copyright (C) M-Systems Ltd. 1995-1997	 *//*modification history--------------------01l,19jun02,nrv  SPR#78569/35046, only set readyChanged bit if R/W error.                 Added NULL check to Rd/Wrt, corrected formatting.01k,15oct01,nrv  documenting PHYSICAL_WRITE and PHYSICAL_ERASE as per SPR                 2320001j,22aug01,dgp  correct typo in library description per SPR 2871301i,11dec98,yp   added function tffsDevOptionsSet() to disable FAT monitoring01h,09mar98,kbw  making man page edits to fix problems found by QE01h,26jan98,kbw  making man page edits01g,18dec97,yp   more doc fixups01f,16dec97,yp   documentation and cleanup.01e,16dec97,hdn  supported a return value of DEFRAGMENT_VOLUME.01d,15dec97,hdn  added four new functions to tffsRawio().01c,05dec97,hdn  added tffsRawio().01b,07nov97,hdn  cleaned up.01a,25aug97,and  written by Andray in M-Systems*//*DESCRIPTIONThis module defines the routines that VxWorks uses to create a TrueFFSblock device.  Using this block device, dosFs can access a board-residentflash memory array or a flash memory card (in the PCMCIA slot) just as if it was a standard disk drive.  Also defined in this file are functions that you can use to format the flash medium, as well as well as functions that handle the low-level I/O to the device.To include TrueFFS for Tornado in a VxWorks image, you must edit your BSP'sconfig.h and define INCLUDE_TFFS, or, for some hardware, INCLUDE_PCMCIA. Ifyou define INCLUDE_TFFS, this configures usrRoot() to call tffsDrv().  If youdefined INCLUDE_PCMCIA, the call to tffsDrv() is made from pccardTffsEnabler().The call to tffsDrv() sets up the structures, global variables, and mutual exclusion semaphore needed to manage TrueFFS.  This call to tffsDrv() also registers socket component drivers for each flash device found attached to the target. These socket component drivers are not quite block devices, but they are an essential layer within TrueFFS.  Their function is to manage the hardwareinterface to the flash device, and they are intelligent enough to handle formatting and raw I/O requests to the flash device.  The other two layers within TrueFFS are known as the translation layer and the MTD (the Memory Technology Driver).  The translation layer of TrueFFS implements the error recover and wear-leveling features of TrueFFS.  The MTD implements the low-level programming (map, read, write, and erase) of the flash medium.  To implement the socket layer, each BSP that supports TrueFFS includes a sysTffs.c file.  This file contains the code that defines the socket component driver.  This file also contains a set of defines that you can use to configure which translation layer modules and MTDs are included in TrueFFS.Which translation layer modules and MTDs you should include depends onwhich types of flash devices you need to support.  Currently, there are three basic flash memory technologies, NAND-based, NOR-based, and SSFDC.Within sysTffs.c, define:.IP "INCLUDE_TL_NFTL" To include the NAND-based translation layer module..IP "INCLUDE_TL_FTL"To include the NOR-based translation layer module..IP "INCLUDE_TL_SSFDC" To include the SSFDC-appropriate translation layer module. .LPTo support these different technologies, TrueFFS ships with three differentimplementations of the translation layer.  Optionally, TrueFFS can includeall three modules.  TrueFFS later binds the appropriate translation layer module to the flash device when it registers a socket component driver forthe device.  Within these three basic flash device categories there are still other differences (largely manufacturer-specific).  These differences have no impact on the translation layer.  However, they do make a difference for the MTD.  Thus, TrueFFS ships with eight different MTDs that can support a variety of flash devices from Intel, Sharp, Samsung, National, Toshiba, AMD, and Fujitsu.  Within sysTffs.c, define:.IP "INCLUDE_MTD_I28F016"For Intel 28f016 flash devices..IP "INCLUDE_MTD_I28F008"For Intel 28f008 flash devices..IP "INCLUDE_MTD_I28F008_BAJA"For Intel 28f008 flash devices on the Heurikon Baja 4000..IP "INCLUDE_MTD_AMD"For AMD, Fujitsu: 29F0{40,80,16} 8-bit flash devices..IP "INCLUDE_MTD_CDSN"For Toshiba, Samsung: NAND CDSN flash devices..IP "INCLUDE_MTD_DOC2"For Toshiba, Samsung: NAND DOC flash devices..IP "INCLUDE_MTD_CFISCS"For CFI/SCS flash devices..IP "INCLUDE_MTD_WAMD"For AMD, Fujitsu 29F0{40,80,16} 16-bit flash devices..LPThe socket component driver and the MTDs are provided in source form.  If you need to write your own socket driver or MTD, use these working driversas a model for your own.EXTERNALLY CALLABLE ROUTINESMost of the routines defined in this file are accessible through the I/Osystem only.  However, four routines are callable externally.  Theseare: tffsDrv(), tffsDevCreate(), tffsDevFormat(), and tffsRawio().The first routine called from this library must be tffsDrv().  Call this routine exactly once.  Normally, this is handled automatically for you from within usrRoot(), if INCLUDE_TFFS is defined, or from within pccardTffsEnabler(), if INCLUDE_PCMCIA is defined.  Internally, this call to tffsDrv() registers socket component drivers for all the flash devices connected to your system.  After registering a socketcomponent driver for the device, TrueFFS can support calls to tffsDevFormat() or tffsRawio().  However, before you can mount dosFs on the flash device, you must call tffsDevCreate().  This call creates a block device on top of the socket component driver, but does not mount dosFs on the device.  Because mounting dosFs on the device is what you will want to do most of the time, the sysTffs.c file defines a helper function, usrTffsConfig().  Internally, this function calls tffsDevCreate() and then does everything necessary (such as calling the dosFsDevInit() routine) to mount dosFs on the resulting block device.LOW LEVEL I/ONormally, you should handle your I/O to the flash device using dosFs.  However, there are situations when that level of indirection is a problem.To handle such situations, this library defines tffsRawio().  Using this function, you can bypass both dosFs and the TrueFFS translation servicesto program the flash medium directly.  However, you should not try to program the flash device directly unless you are intimately familiar with the physical limits of your flash device as well as with how TrueFFS formats the flash medium.  Otherwise you risk not only corrupting the medium entirely but permanently damaging the flash device.If all you need to do is write a boot image to the flash device, usethe tffsBootImagePut() utility instead of tffsRawio().  This function provides safer access to the flash medium.  IOCTLThis driver responds to all ioctl codes by setting a global error flag.Do not attempt to format a flash drive using ioctl calls. INCLUDE FILES: tffsDrv.h, fatlite.h*//* includes */#include "tffsDrv.h"#include "fatlite.h"/* defines *//* externs *//* globals */#if     (POLLING_INTERVAL > 0)SEM_ID    flPollSemId;#endif  /* (POLLING_INTERVAL > 0) *//* locals */LOCAL BOOL tffsDrvInstalled = FALSE;		/* TRUE, if installed */LOCAL BOOL tffsDrvStatus = ERROR;		/* OK, if succeeded */LOCAL TFFS_DEV * tffsBlkDevs[DRIVES] = {NULL};	/* FLite block Devices *//* forward declarations */LOCAL void   tffsSetFromBPB	(BLK_DEV *pBlkDev, BPB *pBPB);LOCAL STATUS tffsIoctl		(TFFS_DEV * pTffsDev, int function, int arg);LOCAL STATUS tffsBlkRd		(TFFS_DEV * pTffsDev, int startBlk, 				 int numBlks, char * pBuffer);LOCAL STATUS tffsBlkWrt		(TFFS_DEV * pTffsDev, int startBlk, 				 int numBlks, char * pBuffer);#if     (POLLING_INTERVAL > 0)LOCAL FLStatus flPollSemCreate (void);#endif /* (POLLING_INTERVAL > 0) *//********************************************************************************* tffsDrv - initialize the TrueFFS system** This routine sets up the structures, the global variables, and the mutual * exclusion semaphore needed to manage TrueFFS. This call also registers * socket component drivers for all the flash devices attached to your target.  ** Because tffsDrv() is the call that initializes the TrueFFS system, this* function must be called (exactly once) before calling any other TrueFFS* utilities, such as tffsDevFormat() or tffsDevCreate().  Typically, the call* to tffsDrv() is handled for you automatically.  If you defined INCLUDE_TFFS* in your BSP's config.h, the call to tffsDrv() is made from usrRoot().  If* your BSP's config.h defines INCLUDE_PCMCIA, the call to tffsDrv() is made* from pccardTffsEnabler().* * RETURNS: OK, or ERROR if it fails.*/STATUS tffsDrv (void)    {    if (!tffsDrvInstalled)	{        /* FLite initialization:                                  */        /*      - register all the components and initialize them */        /*      - create socket polling task                      */        /*      - create task for background FLite operations      */#if     (POLLING_INTERVAL > 0)        /* Create Synchronisation semaphore */        if (flPollSemCreate() != flOK)            return (ERROR);#endif /* (POLLING_INTERVAL > 0) */        tffsDrvStatus = (flInit() == flOK) ? OK : ERROR;	tffsDrvInstalled = TRUE;#if     (POLLING_INTERVAL > 0)	if (tffsDrvStatus == flOK)	    semGive (flPollSemId);#endif /* (POLLING_INTERVAL > 0) */	}    return (tffsDrvStatus);    }/********************************************************************************* tffsDevCreate - create a TrueFFS block device suitable for use with dosFs** This routine creates a TFFS block device on top of a flash device. It takes * as arguments a drive number, determined from the order in which the socket* components were registered, and a flag integer that indicates whether the * medium is removable or not. A zero indicates a non removable medium. A one * indicates a removable medium.  If you intend to mount dosFs on this block * device, you probably do not want to call tffsDevCreate(), but should * call usrTffsConfig() instead.  Internally, usrTffsConfig() * calls tffsDevCreate() for you.  It then does everything necessary (such as * calling the dosFsDevInit() routine) to mount dosFs on the just created * block device.  ** RETURNS: BLK_DEV pointer, or NULL if it failed.*/BLK_DEV * tffsDevCreate     (    int tffsDriveNo,			/* TFFS drive number (0 - DRIVES-1) */    int removableMediaFlag		/* 0 - nonremovable flash media */    )    {    FAST TFFS_DEV  *pTffsDev;           /* ptr to created TFFS_DEV struct */    FAST BLK_DEV   *pBlkDev;            /* ptr to BLK_DEV struct          */    FLStatus        status = flOK;    BPB             bpb;    IOreq           ioreq;    if (tffsDriveNo >= DRIVES)        return (NULL);    ioreq.irHandle = tffsDriveNo;    /* create and initialize BLK_DEV structure */    pTffsDev = (TFFS_DEV *) malloc (sizeof (TFFS_DEV));    if (pTffsDev == NULL)        return (NULL);    status = flMountVolume(&ioreq);    if (status == flOK)        {        ioreq.irData = &bpb;        status = flGetBPB(&ioreq);        if (status == flOK)            {            pBlkDev = &pTffsDev->tffsBlkdev;            tffsSetFromBPB (pBlkDev, &bpb);            if (removableMediaFlag)                pBlkDev->bd_removable  = TRUE;    /* removable                */            else                pBlkDev->bd_removable  = FALSE;   /* not removable            */            pBlkDev->bd_retry        = 1;         /* retry count              */            pBlkDev->bd_mode         = O_RDWR;    /* initial mode for device  */            pBlkDev->bd_readyChanged = TRUE;      /* new ready status         */            pBlkDev->bd_blkRd        = tffsBlkRd; /* read block function      */            pBlkDev->bd_blkWrt       = tffsBlkWrt;/* write block function     */            pBlkDev->bd_ioctl        = tffsIoctl; /* ioctl function           */            pBlkDev->bd_reset        = NULL;      /* no reset function        */            pBlkDev->bd_statusChk    = NULL;      /* no check-status function */            pTffsDev->tffsDriveNo    = tffsDriveNo;            }        else	    ;        }    if (status != flOK)        return (NULL);    /* remember that we have created FLite device */    tffsBlkDevs[tffsDriveNo] = pTffsDev;    return (&pTffsDev->tffsBlkdev);    }/********************************************************************************* tffsDevOptionsSet - set TrueFFS volume options** This routine is intended to set various TrueFFS volume options. At present* it only disables FAT monitoring. If VxWorks long file names are to be used* with TrueFFS, FAT monitoring must be turned off.** RETURNS: OK, or ERROR if it failed.*/STATUS tffsDevOptionsSet    (    TFFS_DEV * pTffsDev                /* pointer to device descriptor */    )    {    FLStatus        status;    IOreq           ioreq;    /* Note : it is expected that as more volume option that would      *        need to get set via this routine are detected a second     *        parameter will be added to indicate the option that needs     *        to get set.     */    if ((pTffsDev == NULL) || (pTffsDev->tffsDriveNo >= DRIVES))        return (ERROR);    ioreq.irHandle = pTffsDev->tffsDriveNo;    /* disable FAT monitoring for TrueFFS volumes */    status = flDontMonitorFAT(&ioreq);    return ((status == flOK) ? OK : ERROR);    }/********************************************************************************* tffsIoctl - handle IOCTL calls to TFFS driver** This routine handles IOCTL calls to TrueFFS driver. Currently it sets a global* error flag and exits. The ioctl FIODISKFORMAT should not be used with TrueFFS* devices. Use tffsDevFormat() to format TrueFFS drives.** RETURNS: ERROR always.** ERRNO: S_ioLib_UNKNOWN_REQUEST**/LOCAL STATUS tffsIoctl     (    TFFS_DEV * pTffsDev,		/* pointer to device descriptor */    int function,			/* function code */    int arg				/* some argument */    )    {    errnoSet (S_ioLib_UNKNOWN_REQUEST);    return (ERROR);    }/********************************************************************************* tffsBlkRd - reads sequence of blocks from TFFS device** This routine reads a sequence of blocks from TrueFFS formatted device.** RETURNS: OK, or ERROR if it failed.** NOMANUAL*/LOCAL STATUS tffsBlkRd     (    FAST TFFS_DEV * pTffsDev,		/* pointer to device descriptor */    int startBlk,			/* starting block number to read */    int numBlks,			/* number of blocks to read */    char * pBuffer			/* pointer to buffer to receive data */    )    {    FLStatus    status = flOK;    IOreq       ioreq;    BPB         bpb;    if ( (NULL == pTffsDev) || (NULL == pBuffer) ||         (pTffsDev->tffsDriveNo >= DRIVES) )        {        return (ERROR);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人激情免费电影网址| 成人在线一区二区三区| 国产精品久久久久四虎| 91久久香蕉国产日韩欧美9色| 日本视频免费一区| 亚洲三级在线免费| 久久久久国产精品厨房| 欧美日韩成人综合天天影院| 成人av在线影院| 精品一区二区久久久| 亚洲一级二级三级| 国产清纯在线一区二区www| 777a∨成人精品桃花网| 一本大道久久精品懂色aⅴ | 亚洲主播在线播放| 国产欧美综合色| 欧美一卡2卡3卡4卡| 91久久香蕉国产日韩欧美9色| 粉嫩嫩av羞羞动漫久久久| 美腿丝袜亚洲三区| 轻轻草成人在线| 丝袜诱惑制服诱惑色一区在线观看| 国产精品电影一区二区三区| 久久久精品一品道一区| 亚洲精品一区二区三区蜜桃下载 | 欧洲av一区二区嗯嗯嗯啊| 成人免费高清视频在线观看| 国产激情精品久久久第一区二区 | 欧美一区二区在线免费观看| 色香蕉久久蜜桃| 日本精品视频一区二区| 91色九色蝌蚪| 99国产精品一区| 99re6这里只有精品视频在线观看| 国产成人av网站| 国产精品一区在线观看你懂的| 美腿丝袜亚洲色图| 久久国产生活片100| 精品无码三级在线观看视频| 久久精品国产第一区二区三区| 精品影视av免费| 国模大尺度一区二区三区| 狠狠久久亚洲欧美| 国产一二精品视频| 国产91精品一区二区| 懂色av一区二区三区免费看| 成人激情免费视频| 色综合视频一区二区三区高清| 91色在线porny| 欧美三级电影精品| 日韩一区二区三区在线| 久久综合给合久久狠狠狠97色69| 久久综合九色综合97婷婷女人| 国产欧美一区二区精品性色 | 国产综合久久久久久鬼色| 老司机一区二区| 国产成人免费视| 91免费观看视频在线| 欧美中文字幕一区| 91麻豆精品国产91久久久久久久久 | 久久精品国产精品青草| 国产精品一区二区三区乱码| 99精品视频一区二区三区| 欧美亚洲动漫另类| 5566中文字幕一区二区电影| 久久久久青草大香线综合精品| 国产精品乱人伦| 一区二区三区欧美激情| 丝袜脚交一区二区| 国产成人午夜精品影院观看视频| 色综合天天综合网天天看片| 欧美日韩黄色影视| 久久欧美中文字幕| 亚洲美女视频在线| 免费日本视频一区| 99精品久久99久久久久| 在线播放91灌醉迷j高跟美女| 久久久激情视频| 亚洲一区在线观看视频| 国产一区二区不卡| 欧美午夜影院一区| 久久精品水蜜桃av综合天堂| 亚洲美腿欧美偷拍| 国产一区二区不卡| 精品视频免费看| 中文字幕第一页久久| 日日夜夜精品视频免费| 国产91高潮流白浆在线麻豆| 欧美精品丝袜中出| 成人欧美一区二区三区1314| 视频一区在线播放| 91捆绑美女网站| 久久久久久99久久久精品网站| 一区二区三区蜜桃| 成人精品视频一区二区三区 | 午夜亚洲福利老司机| 国产成人av电影免费在线观看| 精品视频一区二区三区免费| 欧美韩日一区二区三区| 久久国产精品色婷婷| 日本福利一区二区| 中文字幕精品一区二区三区精品| 日本中文一区二区三区| 色婷婷久久久综合中文字幕| 久久久久国产精品免费免费搜索| 午夜精品久久久久影视| 91麻豆免费视频| 国产欧美精品一区二区三区四区| 偷拍与自拍一区| 欧洲激情一区二区| 亚洲精选视频在线| 国产91露脸合集magnet| 久久先锋资源网| 久久99精品国产麻豆婷婷洗澡| 欧美视频一区在线观看| 最好看的中文字幕久久| 国产精品主播直播| 精品91自产拍在线观看一区| 图片区日韩欧美亚洲| 欧美三级蜜桃2在线观看| 亚洲一区免费视频| 91丨九色丨蝌蚪丨老版| 中文字幕综合网| 99精品热视频| 亚洲美女免费视频| 色哟哟一区二区| 一区二区三区日韩欧美| 色哟哟在线观看一区二区三区| 亚洲欧洲国产日韩| 波多野结衣在线aⅴ中文字幕不卡| 26uuu色噜噜精品一区| 久国产精品韩国三级视频| 日韩一级黄色片| 美洲天堂一区二卡三卡四卡视频| 日韩一区二区三区观看| 麻豆精品在线播放| 久久综合九色综合久久久精品综合| 精品一区二区三区免费视频| 欧美精品一区二区三区蜜桃| 精品无人区卡一卡二卡三乱码免费卡| 欧美不卡一二三| 国产盗摄视频一区二区三区| 久久久久久久综合色一本| 国产盗摄精品一区二区三区在线| 国产视频在线观看一区二区三区 | 在线欧美日韩国产| 亚洲一区二区三区四区在线| 91黄色激情网站| 舔着乳尖日韩一区| 欧美va亚洲va在线观看蝴蝶网| 久热成人在线视频| 国产欧美日韩三区| 99re热视频精品| 亚洲成人av电影在线| 欧美成人三级在线| 成人午夜私人影院| 亚洲乱码中文字幕| 91精品国产一区二区三区| 久久99国产乱子伦精品免费| 国产日韩精品久久久| 91福利国产成人精品照片| 日韩黄色免费电影| 亚洲国产激情av| 欧洲精品在线观看| 麻豆精品视频在线| 国产精品视频一二三区| 欧洲一区二区三区免费视频| 麻豆91在线看| 国产精品久久久久精k8| 欧美日韩亚洲国产综合| 国产剧情一区二区三区| 亚洲激情图片一区| 精品国产乱码久久久久久蜜臀| 成人免费高清视频在线观看| 亚洲h动漫在线| 久久久久久久av麻豆果冻| 色国产精品一区在线观看| 久久国产欧美日韩精品| 亚洲精品久久久蜜桃| 欧美大片在线观看一区二区| 色哟哟国产精品| 国产乱码精品一区二区三区忘忧草| 亚洲免费电影在线| 久久一日本道色综合| 欧美日韩国产一级| 成人av在线一区二区| 久久不见久久见免费视频1| 一区二区三区中文字幕精品精品 | 国产精品网站一区| 日韩欧美色电影| 97精品超碰一区二区三区| 亚洲精品视频免费观看| 亚洲欧美日韩人成在线播放| 亚洲妇熟xx妇色黄| 国产精品一区二区在线观看网站| 99免费精品视频| 日韩欧美亚洲另类制服综合在线| 亚洲激情男女视频| 久久精品国产亚洲aⅴ| 99re在线精品|