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

VxWorks

开发平台:

C/C++

  1. /* smFixBlkLibP.h - private fixed block shared mem mgr library header file */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01d,01aug94,dvs  backed out pme's changes for reserved fields in main data structures.
  7. 01c,20mar94,pme  added reserved fields in main data structures to allow
  8.  compatibility between future versions.
  9. 01b,22sep92,rrr  added support for c++
  10. 01a,19jul92,pme  extracted from smFixBlkLib v1a.
  11. */
  12. #ifndef __INCsmFixBlkLibPh
  13. #define __INCsmFixBlkLibPh
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #include "vwModNum.h"
  18. #include "smDllLib.h"
  19. /* defines */
  20. #define MEM_PART_TYPE_SM_FIX    21      /* fixed block shared mem partition */
  21. /* typedefs */
  22. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  23. #pragma align 1                 /* tell gcc960 not to optimize alignments */
  24. #endif  /* CPU_FAMILY==I960 */
  25. typedef struct sm_fix_blk_part  /* Fixed block partition header */
  26.     {
  27.     UINT32       verify;                /* partition is initialized */
  28.     UINT32       objType;               /* fixed block partition */
  29.     SM_DL_LIST   freeList;              /* list of free blocks */
  30.     int          lock;                  /* partition spinlock */
  31.     unsigned     totalBlocks;           /* total number of blocks in pool */
  32.     int          blockSize;             /* block size in bytes */
  33.     /* allocation statistics */
  34.     unsigned curBlocksAllocated;        /* current # of blocks allocated */
  35.     unsigned cumBlocksAllocated;        /* cumulative # of blocks allocated */
  36.     } SM_FIX_BLK_PART;
  37. typedef struct sm_fix_blk_part * SM_FIX_BLK_PART_ID;
  38. /* function declarations */
  39. #if defined(__STDC__) || defined(__cplusplus)
  40. extern void           smFixBlkPartInit (SM_FIX_BLK_PART_ID gPartId,
  41.                                      char * pPool, unsigned poolSize,
  42.                                      unsigned blockSize);
  43. extern STATUS         smFixBlkPartFree (SM_FIX_BLK_PART_ID gPartId,
  44.                                      char * pBlock);
  45. extern STATUS         smFixBlkPartShow (SM_FIX_BLK_PART_ID gPartId);
  46. extern void *         smFixBlkPartAlloc (SM_FIX_BLK_PART_ID gPartId);
  47. #else   /* __STDC__ */
  48. extern void           smFixBlkPartInit ();
  49. extern STATUS         smFixBlkPartFree ();
  50. extern STATUS         smFixBlkPartShow ();
  51. extern void *         smFixBlkPartAlloc ();
  52. #endif  /* __STDC__ */
  53. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  54. #pragma align 0                 /* turn off alignment requirement */
  55. #endif  /* CPU_FAMILY==I960 */
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif /* __INCsmFixBlkLibPh */