📄 devtable.c
字号:
/************************************************************************
*
* Copyright (c) 2002 by Accelerated Technology, Inc.
*
* PROPRIETARY RIGHTS of Accelerated Technology are involved in
* the subject matter of this material. All manufacturing,
* reproduction, use, and sales rights pertaining to this subject
* matter are governed by the license agreement. The recipient of
* this software implicitly accepts the terms of the license.
*
*
* FILE NAME VERSION
*
* DEVTABLE.C FILE 2.3.2
*
* COMPONENT
*
* Nucleus File
*
* DESCRIPTION
*
* User supplied Device driver.
*
* When you have your device drivers written plug them into this
* table.
*
*
* DATA STRUCTURES
*
* _PC_BDEVSW Device driver dispatch table.
* NUF_Drive_Fat_Size Drive FAT bufffer size list.
*
* FUNCTIONS
*
* nodev_ioctl Dummy device I/O control.
* nodev_init_drive Dummy device init drive.
* nodev_open Dummy device open.
* nodev_raw_open Dummy device raw open.
* nodev_close Dummy device close.
* nodev_io Dummy device I/O.
*
* DEPENDENCIES
*
* pcdisk.h File common definitions
*
* NOTE: This module is linked in with File.lib. After you make *
* changes, you must rebuild File.lib. *
*******************************************************************/
#include "file\pcdisk.h"
/* External device functions. Replace these with your drivers. */
/* RAMDISK, EBS_FLOPPY, etc are defined in pcdisk.h */
/* Ramdisk */
#if (1)//RAMDISK|NOR_FLASH|NAND_FLASH) // NOR_FLASH is added by gfd for there is no RAMDISK definition
extern INT pc_rd_open(UINT16 driveno);
extern INT pc_rd_raw_open(UINT16 driveno);
extern INT pc_rd_close(UINT16 driveno);
extern INT pc_rd_io(UINT16 driveno, UINT32 block, VOID FAR *buffer, UINT16 count, INT do_read);
extern INT pc_rd_ioctl(UINT16 driveno, UINT16 command, VOID *buffer);
#endif
/*nor flash*/
#if(1)//NOR_FLASH|NAND_FLASH)
extern INT nor_rd_open(UINT16 driveno);
extern INT nor_rd_raw_open(UINT16 driveno);
extern INT nor_rd_close(UINT16 driveno);
extern INT nor_rd_io(UINT16 driveno, UINT32 block, VOID FAR *buffer, UINT16 count, INT do_read);
extern INT nor_rd_ioctl(UINT16 driveno, UINT16 command, VOID *buffer);
extern void nor_flush(void);
#endif
#if(1)//NAND_FLASH)
/* nand flash access funtions declaration */
extern INT nand_rd_open(UINT16 driveno);
extern INT nand_rd_raw_open(UINT16 driveno);
extern INT nand_rd_close(UINT16 driveno);
extern INT nand_rd_io(UINT16 driveno, UINT32 block, VOID FAR *buffer, UINT16 count, INT do_read);
extern INT nand_rd_ioctl(UINT16 driveno, UINT16 command, VOID *buffer);
/*
extern void FlashUnlockBlock(U32 Address);
extern void FlashLockBlock(U32 Address);
extern void FlashEraseBlock(U32 Address);
extern U8 FlashWriteByte(U32 Address, U8 Data);
extern U32 FlashWriteBlockWord(U32 Address, U32 DataPoint, U32 len);
extern unsigned long FlashReadBlock( U32 buffer, U32 Address, unsigned long len );
*/
#endif
#if(MMC|NOR_FLASH|NAND_FLASH)
extern INT mmc_open(UINT16 driveno);
extern INT mmc_close(UINT16 driveno);
extern INT mmc_io(UINT16 driveno, UINT32 block, VOID FAR *buffer, UINT16 count, INT do_read);
#endif
/* Dummy device */
INT nodev_ioctl(UINT16 driveno, UINT16 command, VOID *buffer) { return(NO); }
INT nodev_init_drive(INT16 driveno) { return(NO); }
INT nodev_open(UINT16 driveno) { return(NO); }
INT nodev_raw_open(UINT16 driveno) { return(NO); }
INT nodev_close(UINT16 driveno) { return(NO); }
INT nodev_io(UINT16 driveno, UINT32 sector, VOID FAR *buffer, UINT16 count, INT reading) { return(NO); }
/* Note:
The first field in each of these records (0,0,0,0,4) is the lowest
drive number that shares the same lock. In the bios driver, only one
device may be accessed at a time so all locks are done on drive "A:"
0. */
#if (RAMDISK|NOR_FLASH|MMC|NAND_FLASH)
/* ============================= RAMDISK ============================= */
_PC_BDEVSW pc_bdevsw[] =
{
{0, pc_rd_open, pc_rd_raw_open, pc_rd_close, pc_rd_io, pc_rd_ioctl,(int(*)(UINT16))0}, /* A: RAMDISK*/
{1, nor_rd_open, nor_rd_raw_open, nor_rd_close, nor_rd_io, nor_rd_ioctl,(int(*)(UINT16))0}, /* B: NORFLASH */
{2, mmc_open, pc_rd_raw_open, mmc_close, mmc_io, pc_rd_ioctl,(int(*)(UINT16))0}, /* C: MMC*/
{3, nand_rd_open, nand_rd_raw_open, nand_rd_close, nand_rd_io, nand_rd_ioctl, (int(*)(UINT16))0} /* D: nandflash*/
};
INT NUF_Drive_Fat_Size[NDRIVES] =
{
NUF_FATSIZE_A,
NUF_FATSIZE_B,
NUF_FATSIZE_C,
NUF_FATSIZE_D,
};
/* PESSIA(20041108):
* Definition of the sector number of each erase operation for devices */
INT NUF_Drive_Erase_Size[NDRIVES] =
{
NUF_ERASESIZE_A,
NUF_ERASESIZE_B,
NUF_ERASESIZE_C,
NUF_ERASESIZE_D,
};
#elif (IDE_ATA)
/* ============================ IDE_ATA disk ============================ */
_PC_BDEVSW pc_bdevsw[] =
{
{0, floppy_open, floppy_raw_open, floppy_close, floppy_io, floppy_ioctl, (int(*)(UINT16))0}, /* A: */
{1, nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl, (int(*)(UINT16))0}, /* B: */
{2, ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl, (int(*)(UINT16))0}, /* C: */
{2, ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl, (int(*)(UINT16))0}, /* D: */
{2, ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl, (int(*)(UINT16))0}, /* E: */
{2, ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl, (int(*)(UINT16))0}, /* F: */
{5, nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl, (int(*)(UINT16))0} /* G: */
};
INT NUF_Drive_Fat_Size[NDRIVES] =
{
NUF_FATSIZE_A,
NUF_FATSIZE_B,
NUF_FATSIZE_C,
NUF_FATSIZE_D,
NUF_FATSIZE_E,
NUF_FATSIZE_F
};
#elif (IDE_PCM)
/* ============================= IDE w/PCMCIA card ============================= */
_PC_BDEVSW pc_bdevsw[] =
{
{0, nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl, (int(*)(UINT16))0}, /* A: */
{1, nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl, (int(*)(UINT16))0}, /* B: */
{2, ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl, (int(*)(UINT16))0}, /* C: */
{3, ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl, (int(*)(UINT16))0}, /* D: */
{4, nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl, (int(*)(UINT16))0}, /* E: */
{5, nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl, (int(*)(UINT16))0}, /* F: */
{6, nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl, (int(*)(UINT16))0} /* G: */
};
INT NUF_Drive_Fat_Size[NDRIVES] =
{
NUF_FATSIZE_A,
NUF_FATSIZE_B,
NUF_FATSIZE_C,
NUF_FATSIZE_D,
NUF_FATSIZE_E,
NUF_FATSIZE_F
};
#endif/* ================ Device Select ================ */
#if (0)
/* ============================= User port ============================ */
_PC_BDEVSW pc_bdevsw[] =
{
{0, floppy_open, floppy_raw_open, floppy_close, floppy_io, floppy_ioctl, (int(*)(UINT16))0}, /* A: */
{1, nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl, (int(*)(UINT16))0}, /* B: */
{2, ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl, (int(*)(UINT16))0}, /* C: */
{2, ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl, (int(*)(UINT16))0}, /* D: */
{2, ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl, (int(*)(UINT16))0}, /* E: */
{4, ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl, (int(*)(UINT16))0}, /* F: */
{5, nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl, (int(*)(UINT16))0} /* G: */
};
INT NUF_Drive_Fat_Size[NDRIVES] =
{
NUF_FATSIZE_A,
NUF_FATSIZE_B,
NUF_FATSIZE_C,
NUF_FATSIZE_D,
NUF_FATSIZE_E,
NUF_FATSIZE_F
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -