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

VxWorks

开发平台:

C/C++

  1. /* vxmIfLib.h  - VxM interface library header file */
  2. /* Copyright 1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. ---------------------
  6. 01g,27jul93,jcf  added vxmTtyNum, vxmIntAckSet, and vxmIfBreakQuery.
  7. 01f,01apr93,del  added support for abnormal exit.
  8. 01e,23mar93,del  created from vxmIfLibP.h v01d.
  9. */
  10. #ifndef __INCvxmIfLibPh
  11. #define __INCvxmIfLibPh
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #ifndef _ASMLANGUAGE
  16. typedef struct /* VXM_IF_OPS */
  17.     {
  18.     FUNCPTR vxmTblGet; /* function to access all other funcs */
  19.     FUNCPTR vxmIntVecSet; /* set an interrupt vector via VXM */
  20.     FUNCPTR vxmIntVecGet; /* get an interrupt vector via VXM */
  21.     FUNCPTR vxmBufRead; /* read a buffer from the host */
  22.     FUNCPTR vxmBufWrite; /* write a buffer to the host */
  23.     FUNCPTR vxmWrtBufFlush; /* flush any pending data to the host */
  24.     FUNCPTR vxmHostQuery; /* query the host for data */
  25.     FUNCPTR vxmClbkAdd; /* add a calback to the callback table */
  26.     FUNCPTR vxmClbkReady; /* set the state of a callback */
  27.     FUNCPTR vxmClbkQuery; /* query the host for callbacks events */
  28.     FUNCPTR vxmEntHookSet;  /* set a monitor enter hook */
  29.     FUNCPTR vxmExitHookSet; /* set a monitor exit hook */
  30.     FUNCPTR vxmIntLvlSet; /* set interrupt level when in monitor */
  31. #if CPU_FAMILY==I960
  32.     FUNCPTR vxmFaultVecSet; /* set an i960 fault vector via VXM */
  33. #endif /* CPU_FAMILY==I960 */
  34.     FUNCPTR vxmExitFunc; /* exit via the monitor */
  35.     FUNCPTR vxmIntAckSet; /* update interrupt acknowledge table */
  36.     FUNCPTR vxmTtyNum; /* get tty channel used by VxMon */
  37.     FUNCPTR vxmBreakQuery; /* query host for ctrl-c interrupt support */
  38.     } VXM_IF_OPS;
  39. typedef struct /* VXM_IF_ANCHOR */
  40.     {
  41.     UINT32 ifMagic; /* magic number */
  42.     FUNCPTR  ifGetFunc; /* func to access shared functions */
  43.     } VXM_IF_ANCHOR;
  44. enum VXM_IF_FUNCTIONS  /* reserved interface function numbers */
  45.     {
  46.     VXM_IF_BUF_WRT_FUNC = 0x01, /* data transfer functions */
  47.     VXM_IF_WRTBUF_FLUSH_FUNC,
  48.     VXM_IF_BUF_RD_FUNC,
  49.     VXM_IF_QUERY_FUNC,
  50.     VXM_IF_INT_VEC_GET_FUNC, /* get interrupt vector function */
  51.     VXM_IF_INT_VEC_SET_FUNC, /* set interrupt vector function */
  52.     VXM_IF_FLT_VEC_SET_FUNC, /* set/get fault vector (i960 only) */
  53.     VXM_IF_CALLBACK_ADD_FUNC, /* callback interface functions */
  54.     VXM_IF_CALLBACK_STATE_FUNC,
  55.     VXM_IF_CALLBACK_QUERY_FUNC,
  56.     VXM_IF_ENTER_HOOK_SET_FUNC, /* mon. enter/exit hook set funcs */
  57.     VXM_IF_EXIT_HOOK_SET_FUNC,
  58.     VXM_IF_INT_LVL_SET_FUNC, /* mon. int level set func. */
  59.     VXM_IF_EXIT_FUNC, /* exit function */
  60.     VXM_IF_INT_ACK_SET_FUNC, /* update interrupt acknowledge table */
  61.     VXM_IF_TTY_NUM_FUNC, /* get tty channel used by VxMon */
  62.     VXM_IF_BREAK_QUERY_FUNC /* query host for ctrl-c func */
  63.     };
  64. enum VXM_IF_CALLBACKS /* callback function numbers */
  65.     {
  66.     VXM_IF_CALLBACK_DBG, /* reserved: vxMon/uWorks dbg */
  67.     VXM_IF_CALLBACK_1, /* used if INCLUDE_VXM_TTY */
  68.     VXM_IF_CALLBACK_2,
  69.     VXM_IF_CALLBACK_3,
  70.     VXM_IF_CALLBACK_4,
  71.     VXM_IF_CALLBACK_5,
  72.     VXM_IF_CALLBACK_6,
  73.     VXM_IF_CALLBACK_7,
  74.     VXM_IF_CALLBACK_8,
  75.     VXM_IF_CALLBACK_9,
  76.     VXM_IF_CALLBACK_10
  77.     };
  78. /* misc. interface defines */
  79. #define VXM_IF_MAGIC 0xfeedface
  80. #define VXM_IF_TBL_MAX_FUNCS 0x18
  81. #define VXM_IF_MAX_CALLBACKS 0x10
  82. #define VXM_IF_CALLBACK 0x7f000000
  83. #define VXM_IF_CALLBACK_ALL -1
  84. #define VXM_IF_CALLBACK_READY 0x01
  85. #define VXM_IF_QUERY  0x01
  86. /* monitor interface macros */
  87. #define VXM_IF_VEC_SET(vec,func)
  88.         ((vxmIfOps.vxmIntVecSet == NULL) ? (ERROR) :
  89.  (* vxmIfOps.vxmIntVecSet) ((vec), (func)))
  90. #define VXM_IF_VEC_GET(vec)
  91.         ((vxmIfOps.vxmIntVecGet == NULL) ? ((FUNCPTR) NULL) :
  92.  ((FUNCPTR) (* vxmIfOps.vxmIntVecGet) (vec)))
  93. /* variable declarations */
  94. extern VXM_IF_OPS vxmIfOps;
  95. /* function declarations */
  96. #if defined(__STDC__) || defined(__cplusplus)
  97. extern STATUS  vxmIfInit (VXM_IF_ANCHOR *pAnchor);
  98. extern BOOL  vxmIfInstalled (void);
  99. extern STATUS  vxmIfVecSet (FUNCPTR *vec, FUNCPTR func);
  100. extern FUNCPTR vxmIfVecGet (FUNCPTR *vec);
  101. extern int  vxmIfHostRead (char * pDest);
  102. extern void  vxmIfHostWrite (char *pSrc, int len);
  103. extern BOOL  vxmIfHostQuery (void);
  104. extern void  vxmIfWrtBufFlush (void);
  105. extern int  vxmIfBufRead (char *pBuf, int nBytes);
  106. extern int  vxmIfBufWrite (char * pBuf, int nBytes);
  107. extern STATUS  vxmIfCallbackAdd (int funcNo, FUNCPTR func, UINT32 arg,
  108.   UINT32 maxargs, UINT32 state);
  109. extern STATUS vxmIfCallbackExecute (int funcNo, int nArgs, ... );
  110. extern STATUS  vxmIfCallbackReady (int funcNo);
  111. extern STATUS  vxmIfCallbackQuery (int funcNo);
  112. extern FUNCPTR vxmIfEnterHookSet (FUNCPTR hookFunc, UINT32 hookArg);
  113. extern FUNCPTR vxmIfExitHookSet (FUNCPTR hookFunc, UINT32 hookArg);
  114. extern FUNCPTR vxmIfExit (UINT32 code);
  115. extern STATUS  vxmIfIntAckSet (UINT *ackTable);
  116. extern int  vxmIfTtyNum ();
  117. extern STATUS  vxmIfBreakQuery (FUNCPTR breakFunc);
  118. #else /* __STDC__ */
  119. extern STATUS  vxmIfInit ();
  120. extern BOOL  vxmIfInstalled ();
  121. extern STATUS  vxmIfVecSet ();
  122. extern FUNCPTR vxmIfVecGet ();
  123. extern int  vxmIfHostRead ();
  124. extern void  vxmIfHostWrite ();
  125. extern BOOL  vxmIfHostQuery ();
  126. extern void  vxmIfWrtBufFlush ();
  127. extern int  vxmIfBufRead ();
  128. extern int  vxmIfBufWrite ();
  129. extern STATUS  vxmIfCallbackAdd ();
  130. extern STATUS vxmIfCallbackExecute ();
  131. extern STATUS  vxmIfCallbackReady ();
  132. extern STATUS  vxmIfCallbackQuery ();
  133. extern FUNCPTR vxmIfEnterHookSet ();
  134. extern FUNCPTR vxmIfExitHookSet ();
  135. extern FUNCPTR vxmIfExit ();
  136. extern STATUS  vxmIfIntAckSet ();
  137. extern int  vxmIfTtyNum ();
  138. extern STATUS  vxmIfBreakQuery ();
  139. #endif /* __STDC__ */
  140. #endif /*_ASMLANGUAGE*/
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144. #endif /* __INCvxmIfLibPh */