⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blockdev.h

📁 M-System DOC(Disk on a Chip) Flash芯片的诊断工具, 可以从Flash芯片中获取特定的数据信息, 用于判断芯片当前的状态.
💻 H
📖 第 1 页 / 共 2 页
字号:
/***********************************************************************************/
/*                        M-Systems Confidential                                   */
/*           Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2003            */
/*                         All Rights Reserved                                     */
/***********************************************************************************/
/*                            NOTICE OF M-SYSTEMS OEM                              */
/*                           SOFTWARE LICENSE AGREEMENT                            */
/*                                                                                 */
/*      THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE                 */
/*      AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT           */
/*      FOR THE SPECIFIC TERMS AND CONDITIONS OF USE,                              */
/*      OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE:                               */
/*      E-MAIL = info@m-sys.com                                                    */
/***********************************************************************************/

/*
 * $Log:   V:/PVCSDB/DiskOnChip/archives/general storage/TrueFFS/src/include/blockdev.h-arc  $
 * 
 *    Rev 1.5   Sep 30 2003 17:56:24   oris
 * Force include of dosformt.h file
 * 
 *    Rev 1.4   Sep 01 2003 19:10:18   oris
 * - Changed comments.
 * 
 *    Rev 1.3   Jun 16 2003 01:17:46   oris
 * Added TFFS_DLL_API prefix.
 * 
 *    Rev 1.2   May 11 2003 08:25:36   OriS
 * Moved format irFlags definition to flformat.h
 * 
 *    Rev 1.1   May 08 2003 23:18:22   OriS
 * Added SUPPORT_RUGGED_FILE_SYSTEM capability.
 * 
 *    Rev 1.0   Apr 09 2003 12:15:58   OriS
 * Initial revision.
 * 
 */

#ifndef BLOCKDEV_H
#define BLOCKDEV_H

#include "flreq.h"
#include "flfuncno.h"
#include "docsys.h"
#include "dosformt.h"

#ifdef WRITE_EXB_IMAGE
#include "doc2exb.h"
#else
#ifdef BDK_ACCESS
#include "docbdk.h"
#endif /* BDK_ACCESS */
#endif /* WRITE_EXB_IMAGE */

#include "_blkdev.h"


/*----------------------------------------------------------------------*/
/*                     V o l u m e I n f o R e c o r d                  */
/*                                                                      */
/* A structure that holds general information about the media. The      */
/* information includes Physical Info (see flGetPhysicalInfo), Logical  */
/* partition (number of sectors and CHS), boot area size, S/W versions  */
/* Media life-time etc.                                                 */
/* A pointer to this structure is passed to the function flVolumeInfo   */
/* where it receives the relevant data.                                 */
/*----------------------------------------------------------------------*/

typedef struct {
  FLDword  logicalSectors;    /*  number of logical sectors                  */
  FLDword  bootAreaSize;      /*  boot area size                             */
  FLDword  baseAddress;       /*  physical base address                      */
#ifdef FL_LOW_LEVEL
  FLWord flashType;           /*  JEDEC id of the flash                      */
  FLDword  physicalSize;      /*  physical size of the media                 */
  FLDword  physicalUnitSize;  /*  Erasable block size                        */
  FLByte   DOCType;           /*  DiskOnChip type (MDoc/Doc2000)             */
  FLSByte  lifeTime;          /*  Life time indicator for the media (1-10)   */
                              /*  1 - the media is fresh,                    */
                              /*  10 - the media is close to its end of life */
#endif
  FLSByte  driverVer[10];     /*  driver version (NULL terminated string)    */
  FLSByte  OSAKVer[10];       /*  TrueFFS version that driver is based on    */
                              /*  (NULL terminated string)                   */
#ifdef ABS_READ_WRITE
  FLDword  cylinders;         /*  Media.....                                 */
  FLDword  heads;             /*            geometry......                   */
  FLDword  sectors;           /*                            parameters.      */
#endif
} VolumeInfoRecord;

#ifdef ABS_READ_WRITE
#ifdef RUGGEDIZED

#define flRuggedizeOperation(ioreq) bdCall(FL_RUGGEDIZE_OPERATION,ioreq)

/*----------------------------------------------------------------------*/
/*              f l A b s W r i t e U n c m m i t e d                   */
/*                                                                      */
/* Writes absolute sectors with uncommited data by sector no use        */
/* transaction handle.                                                  */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Drive number (0, 1, ...)                    */
/*                        bits 7-4 - Partition # (zero based)           */
/*                        bits 3-0 - Socket # (zero based)              */ 
/*        irData          : Address of user buffer to write from        */
/*        irSectorNo      : First sector no. to write (sector 0 is the  */
/*                          DOS boot sector).                           */
/*        irSectorCount   : Number of consectutive sectors to write     */
/*        irFlags         : Transaction number (must be open)           */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*        irSectorCount   : Number of sectors actually written          */
/*----------------------------------------------------------------------*/
#define FL_OPEN_TRANSACTION         0
#define FL_ROLLBACK_TRANSACTION     1
#define FL_COMMIT_TRANSACTION       2


#define flAbsWriteUncommited(ioreq) bdCall(FL_ABS_WRITE_UNCOMMITED, ioreq)

/*----------------------------------------------------------------------*/
/*                 f l A b s D e l e t e U n c m m i t e d              */
/*                                                                      */
/* Marks absolute sectors by sector no. as uncommited deleted.          */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Drive number (0, 1, ...)                    */
/*                        bits 7-4 - Partition # (zero based)           */
/*                        bits 3-0 - Socket # (zero based)              */ 
/*        irSectorNo      : First sector no. to delete (sector 0 is the */
/*                          DOS boot sector).                           */
/*        irSectorCount   : Number of consectutive sectors to delete    */
/*        irFlags         : Transaction number (must be open)           */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*        irSectorCount        : Number of sectors actually deleted     */
/*----------------------------------------------------------------------*/
#define flAbsDeleteUncommited(ioreq) bdCall(FL_ABS_DELETE_UNCOMMITED,ioreq)

#define NULL_TRANSACTION 0x0f
#define DEFAULT_TRANSACTION 0
#define USE_MULTIPLE_TRANSACTION 0
#define USE_SINGLE_TRANSACTION 1

/*----------------------------------------------------------------------*/
/*                   f l A b s R e a d R u g g e d i z e d              */
/*                                                                      */
/* Reads absolute sectors by sector no using ruggedize transaction      */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Drive number (0, 1, ...)                    */
/*                        bits 7-4 - Partition # (zero based)           */
/*                        bits 3-0 - Socket # (zero based)              */ 
/*        irData          : Address of user buffer to read into         */
/*        irSectorNo      : First sector no. to read (sector 0 is the   */
/*                          DOS boot sector).                           */
/*        irSectorCount   : Number of consectutive sectors to read      */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -