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

VxWorks

开发平台:

C/C++

  1. /* cbioLibP.h - cached block I/O device (CBIO) private header file */
  2. /* Copyright 1999-2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01e,30jul01,jkf  SPR#69031, common code for both AE & 5.x.
  7. 01d,13jun01,jyo  SPR#67729: Added three members to the CBIO_DEV structure also
  8.                  included blkIo.h
  9. 01c,29feb00,jkf  T3 changes
  10. 01b,07dec99,jkf  changed OBJ_CORE to HANDLE, SEMAPHORE to SEM_ID. 
  11. 01a,31aug99,jkf  written - CBIO API changes.
  12. */
  13. #ifndef __INCcbioLibPh
  14. #define __INCcbioLibPh
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /*
  19.  * This module is for CBIO modules internal use only. 
  20.  * File system level code (ie users of CBIO device modules)
  21.  * should not include this module but rather should use 
  22.  * the public CBIO API, cbioLib.h.
  23.  *
  24.  * This WRS private header file is subject to change by WRS
  25.  * without notice.  
  26.  */
  27. /* include's */
  28. #include "vxWorks.h"
  29. #include "private/dosFsVerP.h"  /* determine DOSFS2 OS version */
  30. #include "cbioLib.h"   /* pull in public CBIO API */
  31. #include "semLib.h" /* for SEM_ID type */
  32. #include "blkIo.h" /* for BLK_DEV type */
  33. /* macro's */
  34. #define CBIO_READYCHANGED(x)  ((x)->readyChanged)
  35. #define CBIO_REMOVABLE(x)  ((x)->cbioParams.cbioRemovable)
  36. #define CBIO_MODE(x)  ((x)->cbioMode)
  37. #ifndef CBIO_DEV_EXTRA 
  38. #define CBIO_DEV_EXTRA void /* module specific field */
  39. #endif
  40. /* typedef's */
  41. typedef struct cbioFuncs /* CBIO modules method functions */
  42.     {
  43.     STATUS (* cbioDevBlkRW) /* Read/Write blocks */
  44. (CBIO_DEV_ID dev,
  45.  block_t startBlock,
  46.  block_t numBlocks,
  47.  addr_t buffer,
  48.  CBIO_RW rw,
  49.  cookie_t *     pCookie);
  50.     STATUS (* cbioDevBytesRW) /* Read/Write bytes */
  51. (CBIO_DEV_ID  dev,
  52.    block_t startBlock,
  53.  off_t offset,
  54.  addr_t buffer,
  55.  size_t nBytes,
  56.  CBIO_RW rw,
  57.  cookie_t *  pCookie);
  58.     STATUS (* cbioDevBlkCopy) /* Copy sectors */
  59. (CBIO_DEV_ID  dev,
  60.  block_t srcBlock,
  61.  block_t dstBlock,
  62.  block_t numBlocks);
  63.     STATUS (* cbioDevIoctl) /* control operations */
  64. (CBIO_DEV_ID dev,
  65.  int command,
  66.  addr_t arg);
  67.     } CBIO_FUNCS;
  68. typedef struct cbioDev /* CBIO_DEV */
  69.     {
  70. #ifdef _WRS_DOSFS2_VXWORKS_AE
  71.     HANDLE cbioHandle;  /* VxWorks AE handle management */
  72. #else
  73.     OBJ_CORE objCore;  /* VxWorks 5.x objCore */
  74. #endif /* _WRS_DOSFS2_VXWORKS_AE */
  75.     /* Embedded objects */
  76.     SEM_ID cbioMutex; /* mutex semaphore */
  77.     /* Functions (methods) */
  78.     struct cbioFuncs * pFuncs;  /* cbioFuncs functions */
  79.     /* Public attributes */
  80.     char * cbioDesc; /* printable descriptive string */
  81.     short cbioMode; /* O_RDONLY |O_WRONLY| O_RDWR */
  82.     BOOL        readyChanged;      /* Device READY status indicator */
  83.     /* ** Physical device attributes */
  84.     CBIO_PARAMS cbioParams; /* Physical parameters, cbioLib.h */
  85.     /* *** Implementation defined attributes */
  86.     caddr_t cbioMemBase; /* base addr of memory pool */
  87.     size_t cbioMemSize; /* size of memory pool used */
  88.     u_long cbioPriv0; /* Implementation defined */
  89.     u_long cbioPriv1; /* Implementation defined */
  90.     u_long cbioPriv2; /* Implementation defined */
  91.     u_long cbioPriv3; /* Implementation defined */
  92.     u_long cbioPriv4; /* Implementation defined */
  93.     u_long cbioPriv5; /* Implementation defined */
  94.     u_long cbioPriv6; /* Implementation defined */
  95.     u_long cbioPriv7; /* Implementation defined */
  96.     CBIO_DEV_EXTRA * pDc ; /* Implementation defined structure */
  97.     CBIO_DEV_ID cbioSubDev;        /* Stores the pointer to lower CBIO.  */
  98.     BLK_DEV   * blkSubDev;        /* Stores the pointer to lower BLKDEV. */
  99.     BOOL        isDriver;        /* This variable is used to verify */
  100.        /* the nature of current layer.     */
  101.     } CBIO_DEV;
  102. /* externals */
  103. IMPORT CLASS_ID cbioClassId ;
  104. /* private functions */
  105. CBIO_DEV_ID cbioDevCreate  /* used by CBIO modules only */
  106.     (
  107.     caddr_t   ramAddr,  /* where it is in memory (0 = malloc) */
  108.     size_t ramSize /* pool size */
  109.     );
  110. #ifdef __cplusplus
  111. }
  112. #endif
  113. #endif /* __INCcbioLibPh */