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

VxWorks

开发平台:

C/C++

  1. /* wdbRtIfLib.h - header file for the WDB agents runtime interface */
  2. /* Copyright 1984-2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01e,25apr02,jhw  Added C++ support (SPR 76304).
  7. 01d,01feb01,dtr  Adding in call for test for Altivec Registers.
  8. 01c,01jun95,ms added taskLock/Unlock, removed timers
  9. 01b,05apr95,ms  new data types.
  10. 01a,23sep94,ms  written.
  11. */
  12. #ifndef __INCwdbRtIfLibh
  13. #define __INCwdbRtIfLibh
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* includes */
  18. #include "wdb/wdb.h"
  19. #include "wdb/wdbRegs.h"
  20. #include "netinet/in_systm.h"
  21. /* data types */
  22. typedef struct
  23.     {
  24.     /* this function must be provided always */
  25.     void (*rtInfoGet) (WDB_RT_INFO *pRtInfo);
  26.     /* function call to reboot machine */
  27.     void (*reboot) (void);
  28.     /* function to call after loading text */
  29.     void (*cacheTextUpdate) (char *addr, u_int nBytes);
  30.     /* function to call to write protect memory */
  31.     STATUS (*memProtect) (
  32.  char *addr,
  33.  u_int nBytes,
  34.  BOOL protect
  35. );
  36.     /* function needed to probe memory (required) */
  37.     STATUS (*memProbe) (
  38.  char *addr,
  39.  int mode,
  40.  int len,
  41.  char *pVal
  42. );
  43.     /* function to install an exception hook (for exc event notification) */
  44.     void (*excHookAdd) (void (*hook)
  45. (
  46. WDB_CTX context,
  47. u_int vec,
  48. char *pESF,
  49. WDB_IU_REGS *pRegs
  50. )
  51. );
  52.     /* functions needed to support task control */
  53.     int (*taskCreate) (
  54. char *     name, /* NULL = default */
  55. int    pri,
  56. int    opts,
  57. char *    stackbase,
  58. int    stackSize,
  59. char *     entryPoint,
  60. int        args[10],
  61. int    fdIn, /* 0 = no redirect */
  62. int    fdOut,
  63. int    fdErr
  64. );
  65.     STATUS (*taskResume) (WDB_CTX *pContext);
  66.     STATUS (*taskSuspend) (WDB_CTX *pContext);
  67.     STATUS (*taskDelete) (WDB_CTX *pContext);
  68.     /* functions needed to support task register manipulation */
  69.     STATUS (*taskRegsSet) (WDB_CTX *pContext, WDB_REG_SET_TYPE regSetType,
  70. char * pRegSet);
  71.     STATUS (*taskRegsGet) (WDB_CTX *pContext, WDB_REG_SET_TYPE regSetType,
  72. char ** ppRegSet);
  73.     /* memory operations */
  74.     void * (*malloc) (size_t nBytes);
  75.     void  (*free) (void * pData);
  76.     /* premption disable/reenable routine (for gopher interlocking) */
  77.     void (*taskLock) (void);
  78.     void (*taskUnlock) (void);
  79.     /* binary sempahores. Required for task agent I/O */
  80.     void * (*semCreate) (void);
  81.     STATUS (*semGive) (void *semId);
  82.     STATUS (*semTake) (void *semId, struct timeval * tv);
  83.     /*
  84.      * task object hooks.
  85.      *
  86.      * Delete hooks are required for context exit notification (and hence
  87.      * for function calls).
  88.      */
  89.     STATUS (*taskDeleteHookAdd) (UINT32 ctxId, void (*hook)());
  90.     STATUS (*taskCreateHookAdd) (void (*hook)());
  91.     STATUS (*taskSwitchHookAdd) (void (*hook)());
  92.     } WDB_RT_IF;
  93. /* global variables */
  94. extern WDB_RT_IF *      pWdbRtIf;
  95. /* function prototypes */
  96. #ifdef __STDC__
  97. extern void vxRtIfInit (WDB_RT_IF *pRtIf);
  98. extern void nullRtIfInit (WDB_RT_IF *pRtIf);
  99. #else   /* __STDC__ */
  100. extern void vxRtIfInit ();
  101. extern void nullRtIfInit ();
  102. #endif  /* __STDC__ */
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif  /* __INCwdbRtIfLibh */