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

VxWorks

开发平台:

C/C++

  1. /* vxmIfLibP.h  - VxM interface library header file */
  2. /* Copyright 1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. ---------------------
  6. 01d,27feb93,jcf  added new monitor features.
  7. 01c,22sep92,rrr  added support for c++
  8. 01b,23aug92,jcf  added VXM_IF_OPS typedef and macros for vector functions.
  9. 01a,30mar92,del  written.
  10. */
  11. #ifndef __INCvxmIfLibPh
  12. #define __INCvxmIfLibPh
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #ifndef _ASMLANGUAGE
  17. typedef struct /* VXM_IF_OPS */
  18.     {
  19.     FUNCPTR vxmTblGet; /* function to access all other funcs */
  20.     FUNCPTR vxmIntVecSet; /* set an interrupt vector via VXM */
  21.     FUNCPTR vxmIntVecGet; /* get an interrupt vector via VXM */
  22.     FUNCPTR vxmBufRead; /* read a buffer from the host */
  23.     FUNCPTR vxmBufWrite; /* write a buffer to the host */
  24.     FUNCPTR vxmWrtBufFlush; /* flush any pending data to the host */
  25.     FUNCPTR vxmHostQuery; /* query the host for data */
  26.     FUNCPTR vxmClbkAdd; /* add a calback to the callback table */
  27.     FUNCPTR vxmClbkState; /* set the state of a callback */
  28.     FUNCPTR vxmClbkQuery; /* query the host for callbacks events */
  29.     } VXM_IF_OPS;
  30. typedef struct /* VXM_IF_ANCHOR */
  31.     {
  32.     UINT32 ifMagic; /* magic number */
  33.     FUNCPTR  ifGetFunc; /* func to access shared functions */
  34.     } VXM_IF_ANCHOR;
  35. enum VXM_IF_FUNCTIONS /* reserved interface function numbers */
  36.     {
  37.     VXM_IF_BUF_WRT_FUNC = 0x01, /* data transfer functions */
  38.     VXM_IF_WRTBUF_FLUSH_FUNC,
  39.     VXM_IF_BUF_RD_FUNC,
  40.     VXM_IF_QUERY_FUNC,
  41.     VXM_IF_INT_VEC_GET_FUNC, /* get interrupt vector function */
  42.     VXM_IF_INT_VEC_SET_FUNC, /* set interrupt vector function */
  43.     VXM_IF_FLT_VEC_SET_FUNC, /* set/get fault vector (i960 only) */
  44.     VXM_IF_CALLBACK_ADD_FUNC, /* callback interface functions */
  45.     VXM_IF_CALLBACK_STATE_FUNC,
  46.     VXM_IF_CALLBACK_QUERY_FUNC,
  47.     VXM_IF_ENTER_HOOK_SET_FUNC, /* mon. enter/exit hook set funcs */
  48.     VXM_IF_EXIT_HOOK_SET_FUNC
  49.     };
  50. enum VXM_IF_CALLBACKS /* callback function numbers */
  51.     {
  52.     VXM_IF_CALLBACK_DBG, /* reserved: vxMon/uWorks dbg */
  53.     VXM_IF_CALLBACK_1,
  54.     VXM_IF_CALLBACK_2,
  55.     VXM_IF_CALLBACK_3,
  56.     VXM_IF_CALLBACK_4,
  57.     VXM_IF_CALLBACK_5,
  58.     VXM_IF_CALLBACK_6,
  59.     VXM_IF_CALLBACK_7,
  60.     VXM_IF_CALLBACK_8,
  61.     VXM_IF_CALLBACK_9,
  62.     VXM_IF_CALLBACK_10
  63.     };
  64. /* misc. interface defines */
  65. #define VXM_IF_MAGIC 0xfeedface
  66. #define VXM_IF_TBL_MAX_FUNCS 0x10
  67. #define VXM_IF_MAX_CALLBACKS 0x10
  68. #define VXM_IF_CALLBACK 0x7f000000
  69. #define VXM_IF_CALLBACK_ALL -1
  70. #define VXM_IF_CALLBACK_READY 0x01
  71. #define VXM_IF_QUERY  0x01
  72. /* monitor interface macros */
  73. #define VXM_IF_VEC_SET(vec,func)
  74.         ((vxmIfOps.vxmIntVecSet == NULL) ? (ERROR) :
  75.  (* vxmIfOps.vxmIntVecSet) ((vec), (func)))
  76. #define VXM_IF_VEC_GET(vec)
  77.         ((vxmIfOps.vxmIntVecGet == NULL) ? ((FUNCPTR) NULL) :
  78.  ((FUNCPTR) (* vxmIfOps.vxmIntVecGet) (vec)))
  79. /* variable declarations */
  80. extern VXM_IF_OPS vxmIfOps;
  81. /* function declarations */
  82. #if defined(__STDC__) || defined(__cplusplus)
  83. extern STATUS  vxmIfInit (VXM_IF_ANCHOR *pAnchor);
  84. extern BOOL  vxmIfInstalled (void);
  85. extern STATUS  vxmIfVecSet (FUNCPTR *vec, FUNCPTR func);
  86. extern FUNCPTR vxmIfVecGet (FUNCPTR *vec);
  87. extern int  vxmIfHostRead (char * pDest);
  88. extern void  vxmIfHostWrite (char *pSrc, int len);
  89. extern BOOL  vxmIfHostQuery (void);
  90. extern void  vxmIfWrtBufFlush (void);
  91. extern int  vxmIfBufRead (char *pBuf, int nBytes);
  92. extern int  vxmIfBufWrite (char * pBuf, int nBytes);
  93. extern STATUS  vxmIfCallbackAdd (int funcNo, FUNCPTR func, UINT32 arg,
  94.   UINT32 maxargs, UINT32 state);
  95. extern STATUS vxmIfCallbackExecute (int funcNo, int nArgs, ... );
  96. extern STATUS  vxmIfCallbackReady (int funcNo);
  97. extern STATUS  vxmIfCallbackQuery (int funcNo);
  98. #else /* __STDC__ */
  99. extern STATUS  vxmIfInit ();
  100. extern BOOL  vxmIfInstalled ();
  101. extern STATUS  vxmIfVecSet ();
  102. extern FUNCPTR vxmIfVecGet ();
  103. extern int  vxmIfHostRead ();
  104. extern void  vxmIfHostWrite ();
  105. extern BOOL  vxmIfHostQuery ();
  106. extern void  vxmIfWrtBufFlush ();
  107. extern int  vxmIfBufRead ();
  108. extern int  vxmIfBufWrite ();
  109. extern STATUS  vxmIfCallbackAdd ();
  110. extern STATUS vxmIfCallbackExecute ();
  111. extern STATUS  vxmIfCallbackReady ();
  112. extern STATUS  vxmIfCallbackQuery ();
  113. #endif /* __STDC__ */
  114. #endif /*_ASMLANGUAGE*/
  115. #ifdef __cplusplus
  116. }
  117. #endif
  118. #endif /* __INCvxmIfLibPh */