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

VxWorks

开发平台:

C/C++

  1. /* wdb.h - WDB protocol definition header */
  2. /* Copyright 1995-2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01y,20sep01,jhw  Fixed comment about endianness (SPR 5638).
  7. 01x,09may01,dtr  Removing hasAltivec and hasFpp to replace with
  8.                  hasCoprocessor.
  9. 01w,19mar01,tpw  Resolve SH/altivec conflict; ALTIVEC->AV; add WDB_REG_SET_LAST
  10.  so a stable name for the count of WDB_REG_SET's is available.
  11. 01v,29jan01,dtr  Adding altivec register support.
  12. 01v,07mar00,zl   merged SH support from T1
  13. 01u,24feb99,dbt  removed useless definition of BOOL type (SPR #25225).
  14. 01t,09feb99,dbt  doc: indicate which elements of WDB_CTX_TYPE are implemented.
  15. 01s,28jan99,jmp  added semGiveAddr field to WDB_TSFS_GENERIC_INFO structure,
  16.                  for TSFS_BOOT facility (SPR# 24466).
  17. 01r,25aug98,cth  added WDB_TSFS_ERRNO_ECONNREFUSED
  18. 01q,27may98,cth  removed TSFS_IOCTL_GET_SND/RCVBUF defs
  19. 01p,16apr98,cth  added portable errnos for TSFS
  20. 01o,03apr98,cjtc i960 port. Added #pragma align 1 for TSFS target side
  21. 01n,19mar98,cth  added TSFS ioctl commands for sockets
  22. 01m,25feb98,cth  changed values of WDB_TSFS_S_IFDIR/_IFREG, added WDB_TSFS_
  23.  O_APPEND, O_EXCL, and O_TEXT
  24. 01p,04jun98,dbt  merged wdb.h and wdbP.h (SPR #21217)
  25. 01o,24mar98,dbt  added WDB_CONTEXT_STATUS_GET service.
  26. 01n,10mar98,dbt  added support for user events and context start notification.
  27. 01m,12jan98,dbt  added hardware breakpoints support
  28. 01l,06dec96,dgp  doc: correct spelling
  29. 01k,18nov96,dbt  changed the name of field delete in WDB_TSFS_INFO struct for
  30.                  C++ compatibility, it is now named remove.
  31. 01j,12nov96,c_s  add perm member to TSFS open params
  32. 01i,21oct96,c_s  add target server file system support
  33. 01h,02oct96,elp  changed TGT_ADDR_T and TGT_INT_T from char to UINT32 and
  34.  int to INT32.
  35. 01g,04jul96,p_m  added WDB_TARGET_MODE_GET (SPR# 6200).
  36. 01f,01jul96,dgp  doc: API Guide, fix spelling of comment,
  37.                      wdb_ctx_step_desc
  38. 01e,10jun95,pad  removed #include <rpc/xdr.h> and moved #include <rpc/types.h>
  39.  into #else statement.
  40. 01d,07jun95,ms   added WDB_ERR_NOT_FOUND 
  41. 01c,01jun95,c_s  added some gopher constants
  42. 01b,17may95,tpr  added #include <rpc/xdr.h>.
  43. 01a,04apr95,ms  derived from work by tpr (and pme and ms).
  44.   merged wdb.h, wdbtypes.h, comtypes.h, and  xdrwdb.h
  45.   removed #ifdef UNIX
  46.   made all data types of the form wdbXxx_t.
  47.   added types WDB_STRING_T, WDB_OPQ_DATA_T, TGT_ADDR_T
  48.     TGT_INT_T, and UINT32
  49.   made most event data an array of ints.
  50.   removed obsolete data types.
  51. */
  52. #ifndef __INCwdbh
  53. #define __INCwdbh
  54. #ifdef __cplusplus
  55. extern "C" {
  56. #endif
  57. /*
  58. DESCRIPTION
  59. The WDB protocol provides and extensible interface for remote debugging.
  60. The WDB agent has a fixed UDP port number in order to remove the complexity
  61. of having a portmapper (which adds significant overhead if the
  62. agent is configured as a ROM-monitor).
  63. Every RPC request sent to the agent has a four byte sequence number
  64. appended to the begining of the parameters. The two most significant
  65. bytes are the ID of the host.
  66. Every RPC reply from the agent has a four byte error status appended
  67. to the begining of the reply. One of the bits of the error status
  68. is reserved to mean that events are pending on the target, and another one is
  69. reserved to mean that another request is needed to get a full result. The rest
  70. of the error status is either OK (on success) or the reason
  71. for failure. If a procedure fails, then the rest of the reply is
  72. not decoded (e.g., it contains garbage).
  73. REQUIREMENTS
  74. Both the host and target must support 32 bit integers.
  75. All tasks on the target must share a common address space.
  76. INTERFACE
  77. errCode = wtxBeCall (HBackend, procNum, &params, &reply);
  78. DATA TYPES
  79. UINT32 /@ 32 bit unsigned integer (defined in host.h)  @/
  80. BOOL /@ TRUE or FALSE @/
  81. STATUS /@ OK or ERROR @/
  82. TGT_ADDR_T /@ target address  (defined in host.h) @/
  83. TGT_INT_T /@ target integer  (defined in host.h) @/
  84. WDB_STRING_T /@ pointer to a string (a local address) @/
  85. WDB_OPQ_DATA_T /@ pointer to a block of memory (a local address) @/
  86. Each side must also provide the following XDR filters:
  87. xdr_UINT32 /@ encode/decode a 32 bit integer @/
  88. */
  89. /* includes */
  90. #ifdef HOST
  91. #include "host.h"
  92. #include <rpc/rpc.h>
  93. #else
  94. #include "types/vxANSI.h"
  95. #include <rpc/types.h>
  96. #endif
  97. /* definitions */
  98. /*
  99.  * WDB function numbers.
  100.  * Each remote service is identified by an integer.
  101.  */
  102. /* Session Management */
  103. #define WDB_TARGET_PING  0 /* check if agent is alive */
  104. #define WDB_TARGET_CONNECT  1 /* connect to the agent */
  105. #define WDB_TARGET_DISCONNECT  2 /* terminate the connection */
  106. #define WDB_TARGET_MODE_SET  3 /* change the agents mode */
  107. #define WDB_TARGET_MODE_GET  4 /* get the agent mode */
  108. /* Memory Operations */
  109. #define WDB_MEM_READ 10 /* read a memory block */
  110. #define WDB_MEM_WRITE 11 /* write a memory block */
  111. #define WDB_MEM_FILL 12 /* fill memory with pattern */
  112. #define WDB_MEM_MOVE 13 /* move memory on target */
  113. #define WDB_MEM_CHECKSUM 14 /* checksum a memory block */
  114. #define WDB_MEM_PROTECT 15 /* write (un)protecting */
  115. #define WDB_MEM_CACHE_TEXT_UPDATE 16 /* called after loading text */
  116. #define WDB_MEM_SCAN 17 /* scan memory for a pattern */
  117. #define WDB_MEM_WRITE_MANY 18 /* scatter write */
  118. #define WDB_MEM_WRITE_MANY_INT 19 /* scatter write of ints */
  119. /* Context Control */
  120. #define WDB_CONTEXT_CREATE 30 /* create a new context */
  121. #define WDB_CONTEXT_KILL 31 /* remove a context */
  122. #define WDB_CONTEXT_SUSPEND 32 /* suspend a context */
  123. #define WDB_CONTEXT_RESUME 33 /* resume a context */
  124. #define WDB_CONTEXT_STATUS_GET 34 /* get the context status */
  125. /* Register Manipulation */
  126. #define WDB_REGS_GET 40 /* get register(s) */
  127. #define WDB_REGS_SET 41 /* set register(s) */
  128. /* Virtual I/O */
  129. #define WDB_VIO_WRITE 51 /* write a virtual I/O buffer */
  130. /* Eventpoints */
  131. #define WDB_EVENTPOINT_ADD 60 /* add an eventpoint */
  132. #define WDB_EVENTPOINT_DELETE 61 /* delete an eventpoint */
  133. /* Events */
  134. #define WDB_EVENT_GET 70 /* get info about an event */
  135. /* debugging */
  136. #define WDB_CONTEXT_CONT 80 /* XXX - same as resume? */
  137. #define WDB_CONTEXT_STEP 81 /* continue a context */
  138. /* Miscelaneous */
  139. #define WDB_FUNC_CALL 90 /* spawn a function */
  140. #define WDB_EVALUATE_GOPHER 91 /* evaluate a gopher tape */
  141. #define WDB_DIRECT_CALL 92 /* call a function directly */
  142. /*
  143.  * WDB error codes.
  144.  * Each WDB function returns an error code.
  145.  * If the error code is zero (OK), then the procedure succeded and
  146.  * the reply data is valid.
  147.  * If the error code is nonzero, then the procedure failed. In this case
  148.  * the error code indicates the reason for failure and the reply data
  149.  * is invalid.
  150.  */
  151. #define WDB_OK OK /* success */
  152. #define WDB_ERR_INVALID_PARAMS 0x501 /* params invalid */
  153. #define WDB_ERR_MEM_ACCES   0x502 /* memory fault */
  154. #define WDB_ERR_AGENT_MODE 0x503 /* wrong agent mode */
  155. #define WDB_ERR_RT_ERROR  0x504 /* run-time callout failed */
  156. #define WDB_ERR_INVALID_CONTEXT  0x505 /* bad task ID */
  157. #define WDB_ERR_INVALID_VIO_CHANNEL 0x506 /* bad virtual I/O channel */
  158. #define WDB_ERR_INVALID_EVENT  0x507 /* no such event type */
  159. #define WDB_ERR_INVALID_EVENTPOINT  0x508 /* no such eventpoint */
  160. #define WDB_ERR_GOPHER_FAULT  0x509 /* gopher fault */
  161. #define WDB_ERR_GOPHER_TRUNCATED  0x50a /* gopher tape too large */
  162. #define WDB_ERR_EVENTPOINT_TABLE_FULL 0x50b /* out of room */
  163. #define WDB_ERR_NO_AGENT_PROC 0x50c /* agent proc not installed */
  164. #define WDB_ERR_NO_RT_PROC 0x50d /* run-time callout unavail */
  165. #define WDB_ERR_GOPHER_SYNTAX 0x50e   /* gopher syntax error */
  166. #define WDB_ERR_NOT_FOUND 0x50f /* object not found */
  167. #define WDB_ERR_HW_REGS_EXHAUSTED 0x510 /* hw breakpoint regs full */
  168. #define WDB_ERR_INVALID_HW_BP 0x511 /* invalid hw breakpoint */
  169. #define WDB_ERR_PROC_FAILED 0x5ff /* generic proc failure */
  170. #define WDB_ERR_NO_CONNECTION 0x600 /* not connected */
  171. #define WDB_ERR_CONNECTION_BUSY 0x601 /* someone else connected */
  172. #define WDB_ERR_COMMUNICATION 0x6ff /* generic comm error */
  173. /*
  174.  * WDB miscelaneous definitions.
  175.  */
  176. /* agent modes */
  177. #define WDB_MODE_TASK 1 /* task mode agent */
  178. #define WDB_MODE_EXTERN 2 /* system mode agent */
  179. #define WDB_MODE_DUAL (WDB_MODE_TASK | WDB_MODE_EXTERN) /* dual mode */
  180. #define WDB_MODE_BI WDB_MODE_DUAL
  181. /* maximum number of words of event data */
  182. #define WDB_MAX_EVT_DATA 20
  183. /* gopher stream format type codes */
  184. #define GOPHER_UINT32 0
  185. #define GOPHER_STRING 1
  186. #define GOPHER_UINT16 2
  187. #define GOPHER_UINT8            3
  188. #define GOPHER_FLOAT32          4
  189. #define GOPHER_FLOAT64          5
  190. #define GOPHER_FLOAT80          6
  191. /* option bits for task creation */
  192. #define WDB_UNBREAKABLE 0x0002 /* ignore breakpoints */
  193. #define WDB_FP_TASK 0x0008 /* task uses floating point */
  194. #define WDB_FP_RETURN 0x8000 /* return value is a double */
  195.         /* TSFS file type bits */
  196. #define WDB_TSFS_S_IFREG 0x4000  /* directory */
  197. #define WDB_TSFS_S_IFDIR 0x8000 /* regular file */
  198.         /* TSFS open mode flags */
  199. #define WDB_TSFS_O_RDONLY 0
  200. #define WDB_TSFS_O_WRONLY 1
  201. #define WDB_TSFS_O_RDWR 2
  202. #define WDB_TSFS_O_CREAT 0x0200
  203. #define WDB_TSFS_O_TRUNC 0x0400
  204. #define WDB_TSFS_O_APPEND 0x0008
  205. #define WDB_TSFS_O_EXCL 0x0800
  206. #define WDB_TSFS_O_TEXT 0x4000  /* for Win32 hosts; to override default
  207.    binary translation mode */
  208.         /* TSFS portable errno values */
  209. /* 
  210.  * POSIX errnos are used by the TSFS but not defined here.  These errno
  211.  * values are portable between the target and host, because they are not
  212.  * supported by one of the host platforms, or the errno is numbered 
  213.  * differently on each host platform.
  214.  */
  215. #define WDB_TSFS_ERRNO_ENOTEMPTY (1 << 16)
  216. #define WDB_TSFS_ERRNO_EDEADLK (2 << 16)
  217. #define WDB_TSFS_ERRNO_ENOLCK (3 << 16)
  218. #define WDB_TSFS_ERRNO_EMSGSIZE (4 << 16)
  219. #define WDB_TSFS_ERRNO_EOPNOTSUPP (5 << 16)
  220. #define WDB_TSFS_ERRNO_EADDRNOTAVAIL (6 << 16)
  221. #define WDB_TSFS_ERRNO_ENOTSOCK (7 << 16)
  222. #define WDB_TSFS_ERRNO_ENETRESET (8 << 16)
  223. #define WDB_TSFS_ERRNO_ECONNABORTED (9 << 16)
  224. #define WDB_TSFS_ERRNO_ECONNRESET (10 << 16)
  225. #define WDB_TSFS_ERRNO_ECONNREFUSED (11 << 16)
  226. #define WDB_TSFS_ERRNO_ENOBUFS (12 << 16)
  227. #define WDB_TSFS_ERRNO_ENOTCONN (13 << 16)
  228. #define WDB_TSFS_ERRNO_ESHUTDOWN (14 << 16)
  229. #define WDB_TSFS_ERRNO_ETIMEDOUT (15 << 16)
  230. #define WDB_TSFS_ERRNO_EINPROGRESS (16 << 16)
  231. #define WDB_TSFS_ERRNO_EWOULDBLOCK (17 << 16)
  232. #define WDB_TSFS_ERRNO_ENOSR (18 << 16)
  233. #define WDB_TSFS_ERRNO_ELOOP (19 << 16)
  234. #define WDB_TSFS_ERRNO_ENAMETOOLONG (20 << 16)
  235. #define WDB_TSFS_ERRNO_EBADMSG (21 << 16)
  236. /* context status */
  237.     
  238. #define WDB_CTX_RUNNING 0 /* context is running */
  239. #define WDB_CTX_SUSPENDED 1 /* context is suspended */
  240. /* session information */
  241. #define WDBPORT (u_short) 0x4321 /* UDP port to connect */
  242. #define WDBPROG (u_long) 0x55555555 /* RPC program number */
  243. #define WDBVERS (u_long) 1 /* RPC version number */
  244. #define WDB_VERSION_STR "2.0"
  245. /* message cores */
  246. #define WDB_EVENT_NOTIFY 0x8000 /* notify bit in errCode */
  247. #define WDB_TO_BE_CONTINUED 0x4000 /* continue bit in errCode */
  248. #define WDB_HOST_ID_MASK 0xffff0000 /* hostId in seqNum */
  249. /*
  250.  * WDB primitive data types.
  251.  */
  252. #ifndef HOST
  253. typedef UINT32  TGT_ADDR_T;
  254. typedef INT32 TGT_INT_T;
  255. #endif
  256. typedef char * WDB_STRING_T;
  257. typedef char * WDB_OPQ_DATA_T;
  258. /*
  259.  * WDB compound data types.
  260.  */
  261. typedef struct wdb_mem_region /* a region of target memory */
  262.     {
  263.     TGT_ADDR_T baseAddr; /* memory region base address */
  264.     TGT_INT_T numBytes; /* memory region size */
  265.     UINT32 param; /* proc dependent parameter */
  266.     } WDB_MEM_REGION;
  267. typedef struct wdb_mem_xfer /* transfer a block of memory */
  268.     {
  269.     WDB_OPQ_DATA_T source; /* data to transfer */
  270.     TGT_ADDR_T destination; /* requested destination */
  271.     TGT_INT_T numBytes; /* number of bytes transferred */
  272.     } WDB_MEM_XFER;
  273. typedef struct wdb_mem_scan_desc
  274.     {
  275.     WDB_MEM_REGION memRegion; /* region of memory to scan */
  276.     WDB_MEM_XFER memXfer; /* pattern to scan for */
  277.     } WDB_MEM_SCAN_DESC;
  278. typedef enum wdb_ctx_type /* type of context on the target */
  279.     {
  280.     WDB_CTX_SYSTEM = 0, /* system mode */
  281.     WDB_CTX_GROUP = 1, /* process group (not implemented) */
  282.     WDB_CTX_ANY = 2, /* any context (not implemented) */
  283.     WDB_CTX_TASK = 3, /* specific task or processes */
  284.     WDB_CTX_ANY_TASK = 4, /* any task */
  285.     WDB_CTX_ISR = 5, /* specific ISR (not implemented) */
  286.     WDB_CTX_ANY_ISR = 6 /* any ISR (not implemented) */
  287.     } WDB_CTX_TYPE;
  288. typedef struct wdb_ctx /* a particular context */
  289.     {
  290.     WDB_CTX_TYPE contextType; /* type of context */
  291.     UINT32 contextId; /* context ID */
  292.     } WDB_CTX;
  293. typedef struct wdb_ctx_step_desc /* how to single step a context */
  294.     {
  295.     WDB_CTX context; /* context to step */
  296.     TGT_ADDR_T startAddr; /* lower bound of step range */
  297.     TGT_ADDR_T  endAddr; /* upper bound of step range */
  298.     } WDB_CTX_STEP_DESC;
  299. typedef struct wdb_ctx_create_desc /* how to create a context */
  300.     {
  301.     WDB_CTX_TYPE contextType; /* task or system context */
  302.     /* the following are used for task and system contexts */
  303.     TGT_ADDR_T stackBase; /* bottom of stack (NULL = malloc) */
  304.     UINT32 stackSize; /* stack size */
  305.     TGT_ADDR_T  entry; /* context entry point */
  306.     TGT_INT_T args[10]; /* arguments */
  307.     /* the following are only used for task contexts */
  308.     WDB_STRING_T name; /* name */
  309.     TGT_INT_T priority; /* priority */
  310.     TGT_INT_T options; /* options */
  311.     TGT_INT_T redirIn; /* redirect input file (or 0) */
  312.     TGT_INT_T redirOut; /* redirect output file (or 0) */
  313.     TGT_INT_T redirErr; /* redirect error output file (or 0) */
  314.     } WDB_CTX_CREATE_DESC;
  315. typedef enum wdb_reg_set_type /* a type of register set */
  316.     {
  317.     WDB_REG_SET_IU = 0,            /* integer unit register set */
  318.     WDB_REG_SET_FPU = 1,            /* floating point unit register set */
  319.     WDB_REG_SET_MMU = 2,            /* memory management unit reg set */
  320.     WDB_REG_SET_CU = 3,            /* cache unit register set */
  321.     WDB_REG_SET_TPU = 4,            /* timer processor unit register set */
  322.     WDB_REG_SET_SYS = 5, /* system registers */
  323.     WDB_REG_SET_DSP = 6, /* dsp registers */
  324.     WDB_REG_SET_AV = 7, /* altivec registers */
  325.     WDB_REG_SET_LAST = 8 /* 1 + last used REG_SET number */
  326.     } WDB_REG_SET_TYPE;
  327. typedef struct wdb_reg_read_desc /* register data to read */
  328.     {
  329.     WDB_REG_SET_TYPE regSetType; /* type of register set to read */
  330.     WDB_CTX      context; /* context associated with registers */
  331.     WDB_MEM_REGION   memRegion; /* subregion of the register block */
  332.     } WDB_REG_READ_DESC;
  333. typedef struct wdb_reg_write_desc /* register data to write */
  334.     {
  335.     WDB_REG_SET_TYPE regSetType; /* type of register set to write */
  336.     WDB_CTX      context; /* context associated with registers */
  337.     WDB_MEM_XFER     memXfer; /* new value of the register set */
  338.     } WDB_REG_WRITE_DESC;
  339. typedef enum wdb_rt_type /* type of run-time system */
  340.     {
  341.     WDB_RT_NULL = 0, /* standalone WDB agent */
  342.     WDB_RT_VXWORKS = 1 /* WDB agent integrated in VxWorks */
  343.     } WDB_RT_TYPE;
  344. /* These are used to bit shift result for wdbTgtHasCoprocessors */
  345. typedef enum wdb_coprocessor_type
  346.     {
  347.     WDB_CO_PROC_FPP = 0,
  348.     WDB_CO_PROC_ALTIVEC = 1,
  349.     WDB_CO_PROC_DSP = 2,
  350.     WDB_CO_PROC_LAST = 16  /* DON'T USE 15BIT SHIFT MAX */
  351.     } WDB_COPROCESSOR_TYPE;
  352. typedef struct wdb_rt_info /* info on the run-time system */
  353.     {
  354.     WDB_RT_TYPE rtType; /* runtime type */
  355.     WDB_STRING_T rtVersion; /* run time version */
  356.     TGT_INT_T cpuType; /* target processor type */
  357.     UINT32 hasCoprocessor; /* target has a floating point unit */
  358.     BOOL hasWriteProtect; /* target can write protect memory */
  359.     TGT_INT_T pageSize; /* size of a page */
  360.     TGT_INT_T endian; /* endianness (4321 or 1234) */
  361.     WDB_STRING_T bspName; /* board support package name */
  362.     WDB_STRING_T bootline; /* boot file path or NULL if embedded */
  363.     TGT_ADDR_T memBase; /* target main memory base address */
  364.     UINT32 memSize; /* target main memory size */
  365.     TGT_INT_T numRegions; /* number of memory regions */
  366.     WDB_MEM_REGION * memRegion; /* memory region descriptor(s) */
  367.     TGT_ADDR_T hostPoolBase; /* host-controlled tgt memory pool */
  368.     UINT32 hostPoolSize; /* host-controlled memory pool size */
  369.     } WDB_RT_INFO;
  370. typedef struct wdb_agent_info /* info on the debug agent */
  371.     {
  372.     WDB_STRING_T agentVersion; /* version of the WDB agent */
  373.     TGT_INT_T mtu; /* maximum transfer size in bytes */
  374.     TGT_INT_T mode; /* available agent modes */
  375.     } WDB_AGENT_INFO;
  376. typedef struct wdb_tgt_info /* info on the target */
  377.     {
  378.     WDB_AGENT_INFO   agentInfo; /* info on the agent */
  379.     WDB_RT_INFO      rtInfo; /* info on the run time system */
  380.     } WDB_TGT_INFO;
  381. typedef enum wdb_evt_type /* type of event on the target */
  382.     {
  383.     WDB_EVT_NONE = 0, /* no event */
  384.     WDB_EVT_CTX_START = 1, /* context creation */
  385.     WDB_EVT_CTX_EXIT = 2, /* context exit */
  386.     WDB_EVT_BP = 3, /* breakpoint */
  387.     WDB_EVT_HW_BP = 4, /* hardware breakpoint */
  388.     WDB_EVT_WP = 5, /* watchpoint */
  389.     WDB_EVT_EXC = 6, /* exception */
  390.     WDB_EVT_VIO_WRITE = 7, /* virtual I/O write */
  391.     WDB_EVT_CALL_RET = 8, /* function call finished */
  392.     WDB_EVT_TSFS_OP = 9, /* VIO II operation */
  393.     WDB_EVT_USER = 10 /* user event */
  394.     } WDB_EVT_TYPE;
  395. typedef enum wdb_action_type /* what to do when an event occurs */
  396.     {
  397.     WDB_ACTION_CALL = 1, /* condition the evtpt via a proc */
  398.     WDB_ACTION_NOTIFY = 2, /* notify the host */
  399.     WDB_ACTION_STOP = 4 /* stop the context */
  400.     } WDB_ACTION_TYPE;
  401. typedef struct wdb_action /* a specific action */
  402.     {
  403.     WDB_ACTION_TYPE actionType;
  404.     UINT32 actionArg;
  405.     TGT_ADDR_T callRtn;
  406.     TGT_INT_T callArg;
  407.     } WDB_ACTION;
  408. typedef struct wdb_evtpt_add_desc /* how to add an eventpt */
  409.     {
  410.     WDB_EVT_TYPE evtType; /* type of event to detect */
  411.     TGT_INT_T numArgs; /* eventType dependent arguments */
  412.     UINT32  *   args; /* arg list */
  413.     WDB_CTX context; /* context in which event must occur */
  414.     WDB_ACTION  action; /* action to perform */
  415.     } WDB_EVTPT_ADD_DESC;
  416. typedef struct wdb_evtpt_del_desc /* how to delete an eventpoint */
  417.     {
  418.     WDB_EVT_TYPE  evtType; /* type of event */
  419.     TGT_ADDR_T   evtptId; /* eventpoint ID */
  420.     } WDB_EVTPT_DEL_DESC;
  421. typedef struct wdb_evt_info /* event info for anything but VIO */
  422.     {
  423.     TGT_INT_T numInts; /* number of ints of event data */
  424.     UINT32  info [WDB_MAX_EVT_DATA]; /* event data */
  425.     } WDB_EVT_INFO;
  426. typedef enum wdb_call_ret_type /* type of return value */
  427.     {
  428.     WDB_CALL_RET_INT = 0,
  429.     WDB_CALL_RET_DBL = 1
  430.     } WDB_CALL_RET_TYPE;
  431. typedef struct wdb_call_return_info
  432.     {
  433.     UINT32 callId; /* returned from WDB_FUNC_CALL */
  434.     WDB_CALL_RET_TYPE returnType; /* return type */
  435.     union
  436. {
  437. double returnValDbl; /* double return value */
  438. TGT_INT_T returnValInt; /* integer return value */
  439. } returnVal;
  440.     TGT_INT_T errnoVal; /* error status */
  441.     } WDB_CALL_RET_INFO;
  442. typedef struct wdb_evt_data /* reply to a WDB_EVENT_GET */
  443.     {
  444.     WDB_EVT_TYPE  evtType; /* event type detected */
  445.     union  /* eventType specific info */
  446. {
  447. WDB_MEM_XFER vioWriteInfo; /* vio write event data */
  448. WDB_CALL_RET_INFO callRetInfo; /* call return event data */
  449. WDB_EVT_INFO evtInfo; /* any other event info */
  450. } eventInfo;
  451.     } WDB_EVT_DATA;
  452. typedef struct wdb_exc_info /* WDB_EVT_INFO for exceptions */
  453.     {
  454.     TGT_INT_T numInts; /* 4 */
  455.     WDB_CTX context; /* context that incurred the exception */
  456.     TGT_INT_T vec; /* hardware trap number */
  457.     TGT_ADDR_T pEsf; /* address of the exception stack frame */
  458.     } WDB_EXC_INFO;
  459. typedef struct wdb_bp_info /* WDB_EVT_INFO for breakpoints */
  460.     {
  461.     TGT_INT_T numInts; /* 5 */
  462.     WDB_CTX context; /* context when the breakpoint */
  463. /* was hitten */
  464.     TGT_ADDR_T pc; /* program counter */
  465.     TGT_ADDR_T fp; /* frame pointer */
  466.     TGT_ADDR_T sp; /* stack pointer */
  467.     TGT_ADDR_T addr; /* breakpoint address */
  468.     } WDB_BP_INFO;
  469. typedef struct wdb_ctx_exit_info /* WDB_EVT_INFO for context exit */
  470.     {
  471.     TGT_INT_T numInts; /* 4 */
  472.     WDB_CTX context; /* context that exited */
  473.     TGT_INT_T returnVal; /* context's return value/exit code */
  474.     TGT_INT_T errnoVal; /* context's error status */
  475.     } WDB_CTX_EXIT_INFO;
  476. /*
  477.  * #pragma align 1 for i960 will prevent gcc960 from aligning all structures
  478.  * on a 16 byte boundary.
  479.  */
  480. #ifndef HOST
  481. #if (defined (CPU_FAMILY) && (CPU_FAMILY==I960) && (defined __GNUC__))
  482. #pragma align 1                 /* tell gcc960 not to optimize alignments */
  483. #endif  /* CPU_FAMILY==I960 */
  484. #endif  /* HOST */
  485. typedef struct wdb_ctx_start_info /* WDB_EVT_INFO for context creation */
  486.     {
  487.     TGT_INT_T numInts; /* 4 */
  488.     WDB_CTX createdCtx; /* created context */
  489.     WDB_CTX creationCtx; /* creation context */
  490.     } WDB_CTX_START_INFO;
  491. typedef enum wdb_tsfs_opcode /* opcode for TSFS operation */
  492.     {
  493.     WDB_TSFS_OPEN = 0, /* open target server file */
  494.     WDB_TSFS_READ = 1, /* read target server file */
  495.     WDB_TSFS_WRITE = 2, /* write target server file */
  496.     WDB_TSFS_CLOSE = 3, /* close target server file */
  497.     WDB_TSFS_IOCTL = 4, /* ioctl target server file */
  498.     WDB_TSFS_DELETE = 5 /* delete target server file */
  499.     } WDB_TSFS_OPCODE;
  500. typedef enum wdb_tsfs_ioctl_req /* portable TSFS ioctl requests */
  501.     {
  502.     WDB_TSFS_IOCTL_FIOSEEK = 0, /* set file pointer */
  503.     WDB_TSFS_IOCTL_FIOWHERE = 1, /* get file pointer */
  504.     WDB_TSFS_IOCTL_FIONREAD = 2, /* # bytes readable */
  505.     WDB_TSFS_IOCTL_FIOFSTATGET = 3, /* fill a struct stat for file */
  506.     WDB_TSFS_IOCTL_FIOREADDIR = 4, /* read one directory entry */
  507.     WDB_TSFS_IOCTL_FIORENAME = 5, /* rename a file or directory */
  508.     WDB_TSFS_IOCTL_SO_SNDURGB = 6, /* send urgent-mode byte over sock */
  509.     WDB_TSFS_IOCTL_SO_SETDEBUG = 7, /* set SO_DEBUG for sock */
  510.     WDB_TSFS_IOCTL_SO_GETDEBUG = 8, /* get SO_DEBUG for sock */
  511.     WDB_TSFS_IOCTL_SO_SETSNDBUF = 9, /* set SO_SNDBUF for sock */
  512.     WDB_TSFS_IOCTL_SO_SETRCVBUF = 11, /* set SO_RCVBUF for sock */
  513.     WDB_TSFS_IOCTL_SO_SETDONTROUTE = 13,/* set SO_DONTROUT for sock */
  514.     WDB_TSFS_IOCTL_SO_GETDONTROUTE = 14,/* get SO_DONTROUT for sock */
  515.     WDB_TSFS_IOCTL_SO_SETOOBINLINE = 15,/* set SO_OOBINLINE for sock */
  516.     WDB_TSFS_IOCTL_SO_GETOOBINLINE = 16 /* get SO_OOBINLINE for sock */
  517.     } WDB_TSFS_IOCTL_REQ;
  518. typedef struct wdb_tsfs_generic_info /* base structure for any TSFS op */
  519.     {
  520.     TGT_INT_T numInts; /* depends on opcode */
  521.     TGT_INT_T channel; /* TSFS channel for operation */
  522.     TGT_INT_T opcode; /* TSFS operation to perform */
  523.     TGT_ADDR_T semId; /* semaphore to "give" when op done */
  524.     TGT_ADDR_T pResult; /* where to store result */
  525.     TGT_ADDR_T pErrno; /* where to store errno */
  526.     TGT_ADDR_T semGiveAddr; /* semGive address to give semId */
  527.     } WDB_TSFS_GENERIC_INFO;
  528. typedef struct wdb_tsfs_open_info /* extra fields for TSFS open op */
  529.     {
  530.     TGT_ADDR_T filename; /* address of filename string on tgt */
  531.     TGT_INT_T fnameLen; /* length of above */
  532.     TGT_INT_T mode; /* mode to open with */
  533.     TGT_INT_T perm; /* permission bits */
  534.     } WDB_TSFS_OPEN_INFO;
  535. typedef struct wdb_tsfs_rw_info /* extra fields for TSFS read/write */
  536.     {
  537.     TGT_ADDR_T buffer; /* buffer of data to write/read */
  538.     TGT_INT_T nBytes; /* length of above */
  539.     } WDB_TSFS_RW_INFO;
  540. typedef struct wdb_tsfs_ioctl_info /* extra fields for TSFS ioctl */
  541.     {
  542.     WDB_TSFS_IOCTL_REQ request;
  543.     TGT_INT_T arg;
  544.     TGT_ADDR_T pExtra1; /* meaning depends on request */
  545.     TGT_ADDR_T pExtra2; /* meaning depends on request */
  546.     } WDB_TSFS_IOCTL_INFO;
  547. typedef struct wdb_tsfs_delete_info /* extra fields for TSFS delete op */
  548.     {
  549.     TGT_ADDR_T filename; /* address of filename string on tgt */
  550.     TGT_INT_T fnameLen; /* length of above */
  551.     } WDB_TSFS_DELETE_INFO;
  552. typedef struct wdb_tsfs_info /* generic TSFS event */
  553.     {
  554.     WDB_TSFS_GENERIC_INFO info; /* generic params for all TSFS ops */
  555.     union
  556. {
  557. WDB_TSFS_OPEN_INFO open; /* specific params for open() */
  558. WDB_TSFS_DELETE_INFO remove; /* specific params for unlink() */
  559. WDB_TSFS_RW_INFO rw; /* specific params for read/write() */
  560. WDB_TSFS_IOCTL_INFO ioctl; /* specific params for ioctl() */
  561. } extra;
  562.     } WDB_TSFS_INFO;
  563. #ifndef HOST
  564. #if (defined (CPU_FAMILY) && (CPU_FAMILY==I960) && (defined __GNUC__))
  565. #pragma align 0 /* turn off alignment requirement */
  566. #endif  /* CPU_FAMILY==I960 */
  567. #endif  /* HOST */
  568. typedef struct wdb_param_wrapper
  569.     {
  570.     void * pParams; /* real parameters */
  571.     xdrproc_t xdr; /* XDR filter for the real params */
  572.     UINT32 seqNum; /* sequence number */
  573.     } WDB_PARAM_WRAPPER;
  574. typedef struct wdb_reply_wrapper
  575.     {
  576.     void * pReply; /* real reply */
  577.     xdrproc_t xdr; /* XDR filter for the real reply */
  578.     UINT32 errCode; /* error status */
  579.     } WDB_REPLY_WRAPPER;
  580. /* function prototypes */
  581. #if defined(__STDC__) || defined(__cplusplus) || defined(WIN32_COMPILER)
  582. extern BOOL xdr_UINT32 (XDR *xdrs, UINT32 *objp);
  583. extern BOOL xdr_TGT_ADDR_T (XDR *xdrs, TGT_ADDR_T *objp);
  584. extern BOOL xdr_TGT_INT_T (XDR *xdrs, TGT_INT_T *objp);
  585. extern BOOL xdr_WDB_STRING_T (XDR *xdrs, WDB_STRING_T *objp);
  586. extern BOOL xdr_WDB_OPQ_DATA_T (XDR *xdrs, WDB_OPQ_DATA_T *objp,
  587.  UINT32 len);
  588. extern BOOL xdr_ARRAY (XDR *xdrs, char **, TGT_INT_T *,
  589.  TGT_INT_T, TGT_INT_T,
  590.  xdrproc_t elproc);
  591. extern BOOL xdr_CHECKSUM (XDR *xdrs, UINT32 xdrCksumVal,
  592.  UINT32 xdrStreamSize,
  593.  UINT32 xdrCksumValPos,
  594.  UINT32 xdrStreamSizePos);
  595. extern BOOL xdr_WDB_PARAM_WRAPPER (XDR *xdrs, WDB_PARAM_WRAPPER *objp);
  596. extern BOOL xdr_WDB_REPLY_WRAPPER (XDR *xdrs, WDB_REPLY_WRAPPER *objp);
  597. extern BOOL xdr_WDB_TGT_INFO  (XDR *xdrs, WDB_TGT_INFO *objp);
  598. extern BOOL xdr_WDB_MEM_REGION (XDR *xdrs, WDB_MEM_REGION *objp);
  599. extern BOOL xdr_WDB_MEM_XFER (XDR *xdrs, WDB_MEM_XFER *objp);
  600. extern BOOL xdr_WDB_MEM_SCAN_DESC (XDR *xdrs, WDB_MEM_SCAN_DESC *objp);
  601. extern BOOL xdr_WDB_CTX (XDR *xdrs, WDB_CTX *objp);
  602. extern BOOL xdr_WDB_CTX_CREATE_DESC (XDR *xdrs, WDB_CTX_CREATE_DESC *objp);
  603. extern BOOL xdr_WDB_CTX_STEP_DESC (XDR *xdrs, WDB_CTX_STEP_DESC *objp);
  604. extern BOOL xdr_WDB_REG_READ_DESC (XDR *xdrs, WDB_REG_READ_DESC *objp);
  605. extern BOOL xdr_WDB_REG_WRITE_DESC (XDR *xdrs, WDB_REG_WRITE_DESC *objp);
  606. extern BOOL xdr_WDB_EVTPT_ADD_DESC (XDR *xdrs, WDB_EVTPT_ADD_DESC *objp);
  607. extern BOOL xdr_WDB_EVTPT_DEL_DESC (XDR *xdrs, WDB_EVTPT_DEL_DESC *objp);
  608. extern BOOL xdr_WDB_EVT_DATA (XDR *xdrs, WDB_EVT_DATA *objp);
  609. #else /* __STDC__ */
  610. extern BOOL xdr_UINT32 ();
  611. extern BOOL xdr_BOOL ();
  612. extern BOOL xdr_TGT_ADDR_T ();
  613. extern BOOL xdr_TGT_INT_T ();
  614. extern BOOL xdr_WDB_STRING_T ();
  615. extern BOOL xdr_WDB_OPQ_DATA_T ();
  616. extern BOOL xdr_ARRAY ();
  617. extern BOOL xdr_CHECKSUM ();
  618. extern BOOL xdr_PARAM_WRAPPER ();
  619. extern BOOL xdr_REPLY_WRAPPER ();
  620. extern BOOL xdr_WDB_TGT_INFO  ();
  621. extern BOOL xdr_WDB_MEM_REGION ();
  622. extern BOOL xdr_WDB_MEM_XFER ();
  623. extern BOOL xdr_WDB_MEM_SCAN_DESC ();
  624. extern BOOL xdr_WDB_CTX ();
  625. extern BOOL xdr_WDB_CTX_CREATE_DESC ();
  626. extern BOOL xdr_WDB_CTX_STEP_DESC ();
  627. extern BOOL xdr_WDB_REG_READ_DESC ();
  628. extern BOOL xdr_WDB_REG_WRITE_DESC ();
  629. extern BOOL xdr_WDB_EVTPT_ADD_DESC ();
  630. extern BOOL xdr_WDB_EVTPT_DEL_DESC ();
  631. extern BOOL xdr_WDB_EVT_DATA ();
  632. #endif /* __STDC__ */
  633. #ifdef __cplusplus
  634. }
  635. #endif
  636. #endif /* __INCwdbh */