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

📄 pcdisk.h

📁 移植Nuclues_RTC到coldfire5307在diab下编译通过
💻 H
📖 第 1 页 / 共 4 页
字号:
/************************************************************************
*                                                                       
*       Copyright (c) 2001 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                 
*                                                                       
*       PCDISK.H                                FILE/MCF5206/Diab/2.2.1             
*                                                                       
* COMPONENT                                                             
*                                                                       
*       Nucleus File                                                    
*                                                                       
* DESCRIPTION                                                           
*                                                                       
*       This file contains Nucleus File2 constants common to both the   
*       application and the actual Nucleus File components.  This file  
*       also contains data structure definitions that hide internal     
*       information from the application.                               
*                                                                       
* DATA STRUCTURES                                                       
*                                                                       
*       FATSWAP                             Fat blocks structure.       
*       DDRIVE                              Block 0 image.              
*       DOSINODE                            Dos Directory Entry.        
*       BLKBUFF                             Block buffer.               
*       LNAMINFO                            Long file name information. 
*       LNAMENT                             Long file name Directory    
*                                            Entry.                     
*       FINODE                              DOS entry.                  
*       DIRBLK                              Directory information.      
*       DROBJ                               Object used to find a dirent
*                                            on a disk and its parent's.
*       DATESTR                             Date stamping buffer.       
*       PC_FILE                             Internal file representation.
*       DSTAT                               File search structure.      
*       FMTPARMS                            Format parameter blcok.     
*       pcblk0                              Block 0. Not use.           
*       FILE_SYSTEM_USER                    File system user structure. 
*       _PC_BDEVSW                          Device driver dispatch table.
*       _NUF_FSTBL                          File system dispatch table. 
*       PTABLE_ENTRY                        Partition table descriptions.
*       PTABLE                              Boot Record structure.      
*                                                                       
* FUNCTIONS                                                             
*                                                                       
*       None.                                                           
*                                                                       
* DEPENDENCIES                                                          
*                                                                       
*       nucleus.h                           System definitions          
*                                                                       
*************************************************************************/

#ifndef __PCDISK__
#define __PCDISK__ 1

#include        <stddef.h>

#ifndef NUCLEUS
#include        "nucleus.h"                 /* System definitions      */
#endif

#include        <stdio.h>
/*cancel the below by Liao Yibai on 2002.6.24
#include        "..\plus\sd_defs.h"
#include        "..\plus\sd_extr.h"
*/
//added by Liao Yibai 2002.6.24
#define INT8 char
#define INT16 short int
#define INT32 long int
#define UINT8 unsigned char
#define UINT16 unsigned short
#define UINT32 unsigned long

#define ULONG           unsigned long int       /* 32 BIT unsigned */
#define LONG            long int                /* 32 BIT signed   */
#define UCOUNT          unsigned short int      /* 16 BIT unsigned */
#define COUNT           short int               /* 16 BIT unsigned */

#ifndef BOOL
#define BOOL            int                     /* native int      */
#endif 

#define INT             int                     /* native int      */
#define VOID            void                    /* void            */
#define UTINY           unsigned char           /* 8  BIT unsigned */
#define UTEXT           unsigned char           /* 8  BIT signed   */
#define TEXT            char                    /* char            */
#define BLOCKT          unsigned long int       /* 32 BIT unsigned */
#define PCFD            int                     /* file desc       */

#define FAIL                    0               /* OS exit error status */
//#define YES                     1
//#define NO                      0
#define IMPORT                  extern
#define GLOBAL                  /* extern */
#define LOCAL                   static
#define BLOCKEQ0                0L

//end of adding


#define BIG_ENDIAN
#define SWAP_ALIGN              0

#ifdef DEBUG
#define PRINT_STRING    UART_Put_String
void va_error_print(char* format, ...);
#define DEBUG_PRINT     va_error_print
#else
#define PRINT_STRING
#endif  /* ifdef DEBUG */

#define FAR
#define NEAR

/* Use the x86 processor. */
#define X86                     0           /* 1 : Use  0 : Not use */

/* ============= ATI DRIVERS =============== */
/* Set the following line to 1 if you purchased the IDE driver */
#define EBS_IDE                 1//0

/* If using ATA hard disk, define BOTH EBS_IDE and IDE_ATA  */
#define   IDE_ATA               0

/* If using PCMCIA card, define BOTH EBS_IDE and IDE_PCM  */
#define   IDE_PCM               0

/* Set the following line to 1 if you purchased the FLOPPY driver */
#define EBS_FLOPPY              1//0
/* Set the following line to 1 if you purchased the RAMDISK driver */
#define RAMDISK                 0//1

/* ============ OTHER CONSTANTS ============ */
/*  Set this to total number of drives to support.  This value (4) supports
    (A,B,C,D).  If you are going to use the RAM Disk in addition to these
    four drives, set NDRIVES to 5. */
#define NDRIVES                 7/*A,(B),C,D,E,F,G No RamDisk Liao Yibai 2002.6.24*/




#ifdef BIG_ENDIAN
#define SWAP16(X,Y) _swap16(X,Y)
#define SWAP32(X,Y) _swap32(X,Y)
#else 
#if (SWAP_ALIGN)   /* Little endian alignment care */
    #define SWAP16(X,Y)   _through16(X,Y)
    #define SWAP32(X,Y)   _through32(X,Y)
#else  
    #define SWAP16(X,Y)   *(UINT16 *)(X) = *(UINT16 *)(Y)
    #define SWAP32(X,Y)   *(UINT32 *)(X) = *(UINT32 *)(Y)
#endif
#endif /* ifdef BIG_ENDIAN */


#define YES                     1
#define NO                      0
#define BLOCKEQ0                0L


/* =========== User tunable section ================ */
/* ============ Device drivers =============== */

/* ============= RAMDISK =============== */

/* For the demonstration port we create a 50K ram disk.  If you purchased
   ATI's RAM Disk Driver, you can change the following definitions to
   any size you desire (with the exceptions as listed below).

   Note on Intel the RAM Disk is always in the far heap.  So you may create
   a large ram disk even in small model. Note the ram disk driver will
   allocate this much core when it is first mounted.

   If you don't need a ramdisk eliminate it from devtable.c
*/


/* Set the following to one if you wish to allocate ram disk memory from
   a PLUS memory pool. This affects code in nufp.c and ramdisk.c. This should
   be set to 1 for 32 bit systems where it is possible to use allocate > 64K
   to a memory pool.  If you wish to allocate a RAM Disk larger than 48K on
   an Intel real-mode based Nucleus PLUS port, then you should set this
   manifest to 0.  In that case, the pool will be created by using a DOS
   malloc call.
*/
#define RAMDISK_FROMPOOL        1      /* Plus only */

#if (RAMDISK_FROMPOOL)

/* Nucleus PLUS: If allocating the ram disk from a partition pool we
   allocated 12 pages (48K). This is because 8086 real mode ports under plus
   may only allocate 64K at a time for a pool. For 32 bit ports this
   restriction does not exist.  */
#define NUM_RAMDISK_PAGES       12     /*  (Must be at least 1) */
#else
#define NUM_RAMDISK_PAGES       16     /*  (Must be at least 1) */
#endif


#define RAMDISK_PAGE_SIZE       8      /*  8 blocks ='s 4 k (dont exceed 32) */
#define NRAMDISKBLOCKS          (NUM_RAMDISK_PAGES * RAMDISK_PAGE_SIZE)

/* ======== MULTI TASKING SUPPORT   =============== */

/*  Maximum # of tasks that may use the file system.   */
#define NUM_USERS               5

/* Blocks in the buffer pool. Uses 532 bytes per block.
   impacts performance during directory traversals 20 to 30 is optimal */
#define NBLKBUFFS               20

/* Maximum Number of open Files */
#define NUSERFILES              30

/* Directory Object Needs. Conservative guess is One CWD per user per drive +
   One per file + one per User for directory traversal */
#define NFINODES                (NUM_USERS*NDRIVES + NUM_USERS + NUSERFILES)
#define NDROBJS                 (NUM_USERS*NDRIVES + NUM_USERS + NUSERFILES)

#define EMAXPATH                255     /* Maximum path length Change if you like */

#define MAXSECTORS              256     /* Maximum sectors */

/* Number of maximum file sectors(2GB) */
#define MAXFILE_SIZE            4194304 /* (2GB / 512) */

/* NOTE: See the end of this file for more tunable constants which pertain
   to the Nucleus environment, specifically allocating memory. */

/*=============== END TUNABLE CONSTANTS ==========================*/

/*=============== MULTI TASKING DATA STRUCTURES and MACROS =======*/

#if (NUM_USERS == 1)
#define LOCK_METHOD             0
/* These macros are API call prolog and epilogs. In multitasking mode
they lock/unlock the RTFS semaphore and check if the user is registered
via pc_rtfs_become_user() respectively. In single tasking mode they do nothing */

#define PC_FS_ENTER()
#define PC_FS_EXIT()
#define CHECK_USER(X, Y)
#define VOID_CHECK_USER()
#else 
/* Num users > 1 */
/* These macros are API call prolog and epilogs. In multitasking mode
they lock/unlock the RTFS semaphore and check if the user is registered
via pc_rtfs_become_user() respectively. In single tasking mode they do nothing */

#define PC_FS_ENTER()           UINT16 process_flags = pc_fs_enter();
#define PC_FS_EXIT()            pc_fs_exit(process_flags);

⌨️ 快捷键说明

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