dosFsFatP.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:2k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* dosFsFatP.h - DOS file system FAT module header file*/
  2.  
  3. /* Copyright 1999 Wind River Systems, Inc. */
  4.  
  5. /* 
  6. modification history 
  7. -------------------- 
  8. 01f,20sep01,jkf  SPR#69031, common code for both AE & 5.x.
  9. 01e,29feb00,jkf  T3 changes
  10. 01d,31jul99,jkf  T2 merge, tidiness & spelling.
  11. 01c,23sep98,vld  field <syncEnabled> added to structure MS_FAT_DESC
  12. 01b,20sep98,mjc  descriptor structure name changed from DOS_FAT16_DESC
  13.  to MS_FAT_DESC
  14. 01a,23feb98,mjc  written, preliminary 
  15. */
  16. #ifndef __INCdosFath
  17. #define __INCdosFath
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #include "private/dosFsLibP.h"
  22. /* defines */
  23. /* conversions of sector <-> cluster numbers */
  24. #define CLUST_TO_SEC( pVolDesc, clustNum )                                  
  25.                 ( ((clustNum) - DOS_MIN_CLUST) * (pVolDesc)->secPerClust +  
  26.                   (pVolDesc)->dataStartSec )
  27. #define SEC_TO_CLUST( pVolDesc, secNum )                                    
  28.                                 ( ((secNum) -  (pVolDesc)->dataStartSec) /  
  29.                                   (pVolDesc)->secPerClust + DOS_MIN_CLUST )
  30. /* typedefs */
  31. typedef enum fat_rw {FAT_READ, FAT_WRITE_GROUP, FAT_WRITE_CLUST} FAT_RW;
  32. typedef struct
  33.     {
  34.     DOS_FAT_DESC dosFatDesc; /* generic DOS FAT descriptor */
  35.     uint32_t (*entryRead)
  36. (DOS_FILE_DESC_ID pFd, uint32_t copyNum,
  37. uint32_t entry);
  38.     STATUS (*entryWrite)
  39. (DOS_FILE_DESC_ID pFd, uint32_t copyNum,
  40. uint32_t entry,
  41. uint32_t value);
  42.     uint32_t fatStartSec; /* FAT starting sector number */
  43.     uint32_t nFatEnts; /* number of entries in FAT */
  44.     uint32_t fatEntFreeCnt; /* count of free clusters */
  45.     uint32_t dos_fat_avail; /* cluster is available: 0x0000 */
  46.     uint32_t            dos_fat_reserv; /* reserved cluster marker: 0xff(f)0 */
  47.     uint32_t dos_fat_bad; /* bad cluster marker: 0xff(f)7 */
  48.     uint32_t dos_fat_eof; /* end-of-file marker: 0xff(f)f */
  49.     uint32_t fatGroupSize; /* size clusters */
  50.     uint32_t groupAllocStart;/* initialize to DOS_MIN_CLUST */
  51.     uint32_t clustAllocStart;/* initialize to DOS_MIN_CLUST */
  52.     BOOL syncEnabled; /* FAT copies mirroring enabling */
  53.     SEM_ID allocSem; /* semaphore to guard allocations */
  54.     } MS_FAT_DESC;
  55. typedef MS_FAT_DESC * MS_FAT_DESC_ID;
  56. /* defines */
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* __INCdosFath */