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

VxWorks

开发平台:

C/C++

  1. /* rawFsLib.h - header for raw block device file system library */
  2. /* Copyright 1984-2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 03j,30apr02,jkf  SPR#75255, corrected unneeded API change.
  7. 03i,20sep01,jkf  SPR#69031, common code for both AE & 5.x.
  8. 03h,29feb00,jkf  T3 cleanup
  9. 03g,30dec99,jkf  rawFsDevInit() changed from void* to CBIO_DEV_ID
  10. 03f,31jul99,jkf  changes for CBIO API.
  11. 03e,31jul99,jkf  T2 merge, tidiness & spelling.
  12. 03d,15oct98,lrn  moved 64-bit extended ioctl codes to ioLib.h
  13. 03c,08oct98,vld  added definition of RAWFS_DEF_MAX_FILES
  14. 03b,08oct98,vld  driver interface changed to CBIO_DEV.
  15.  replaced rawvd_pBlkDev with CBIO_DEV * rawVdCbio
  16.            changed prototype of rawFsDevInit().
  17. 03a,23jul98,vld  added ioctl codes for 64-bit ioctl requests; new error codes.
  18. 02b,22sep92,rrr  added support for c++
  19. 02a,04jul92,jcf  cleaned up.
  20. 01d,26may92,rrr  the tree shuffle
  21. 01c,04oct91,rrr  passed through the ansification filter
  22.   -changed VOID to void
  23.   -changed copyright notice
  24. 01b,05oct90,shl  added ANSI function prototypes.
  25.                  added copyright notice.
  26. 01a,02oct90,kdl  written
  27. */
  28. #ifndef __INCrawFsLibh
  29. #define __INCrawFsLibh
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #include "blkIo.h"
  34. #include "iosLib.h"
  35. #include "lstLib.h"
  36. #include "semLib.h"
  37. #include "vwModNum.h"
  38. #include "cbioLib.h"
  39. /* rawFsLib Status Codes */
  40. #define S_rawFsLib_VOLUME_NOT_AVAILABLE (M_rawFsLib | 1)
  41. #define S_rawFsLib_END_OF_DEVICE (M_rawFsLib | 2)
  42. #define S_rawFsLib_NO_FREE_FILE_DESCRIPTORS (M_rawFsLib | 3)
  43. #define S_rawFsLib_INVALID_NUMBER_OF_BYTES (M_rawFsLib | 4)
  44. #define S_rawFsLib_ILLEGAL_NAME (M_rawFsLib | 5)
  45. #define S_rawFsLib_NOT_FILE (M_rawFsLib | 6)
  46. #define S_rawFsLib_READ_ONLY (M_rawFsLib | 7)
  47. #define S_rawFsLib_FD_OBSOLETE (M_rawFsLib | 8)
  48. #define S_rawFsLib_NO_BLOCK_DEVICE (M_rawFsLib | 9)
  49. #define S_rawFsLib_BAD_SEEK (M_rawFsLib | 10)
  50. #define S_rawFsLib_INVALID_PARAMETER (M_rawFsLib | 11)
  51. #define S_rawFsLib_32BIT_OVERFLOW (M_rawFsLib | 12)
  52. #define RAWFS_DEF_MAX_FILES 10 /* default max number of open files */
  53. /* Volume descriptor */
  54. typedef struct /* RAW_VOL_DESC */
  55.     {
  56.     DEV_HDR rawVdDevHdr; /* std. I/O system device header */
  57.     int rawVdStatus; /* (OK | ERROR) */
  58.     SEM_ID rawVdSemId; /* volume descriptor semaphore id */
  59.     CBIO_DEV_ID rawVdCbio; /* CBIO handle */
  60.     int rawVdState; /* state of volume (see below) */
  61.     int rawVdRetry; /* current retry count for I/O errors */
  62.     } RAW_VOL_DESC;
  63. /* Volume states */
  64. #define RAW_VD_READY_CHANGED 0 /* vol not accessed since rdy change */
  65. #define RAW_VD_RESET 1 /* volume reset but not mounted */
  66. #define RAW_VD_MOUNTED 2 /* volume mounted */
  67. #define RAW_VD_CANT_RESET 3 /* volume reset failed */
  68. #define RAW_VD_CANT_MOUNT 4 /* volume mount failed */
  69. /* Function declarations */
  70. #if defined(__STDC__) || defined(__cplusplus)
  71. extern RAW_VOL_DESC *rawFsDevInit (char *pVolName, BLK_DEV * pDevice);
  72. extern STATUS  rawFsInit (int maxFiles);
  73. extern STATUS  rawFsVolUnmount (RAW_VOL_DESC *pVd);
  74. extern void  rawFsModeChange (RAW_VOL_DESC *pVd, int newMode);
  75. extern void  rawFsReadyChange (RAW_VOL_DESC *pVd);
  76. #else /* __STDC__ */
  77. extern RAW_VOL_DESC * rawFsDevInit ();
  78. extern STATUS  rawFsInit ();
  79. extern STATUS  rawFsVolUnmount ();
  80. extern void  rawFsModeChange ();
  81. extern void  rawFsReadyChange ();
  82. #endif /* __STDC__ */
  83. #ifdef __cplusplus
  84. }
  85. #endif
  86. #endif /* __INCrawFsLibh */