FreeBSD/Linux Kernel Cross Reference
sys/ttd/ttd_msg.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1992 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * The TTD message format.
28 *
29 * HISTORY:
30 * $Log: ttd_msg.h,v $
31 * Revision 2.2 93/05/10 23:24:47 rvb
32 * Checkin for MK80 branch.
33 * [93/05/10 15:08:31 grm]
34 *
35 * Revision 2.1.2.2 93/04/20 10:53:06 grm
36 * Changed the types for a more universal protocol. This checkin
37 * contains protocol version 2.4.
38 * [93/04/20 grm]
39 *
40 * Revision 2.1.2.1 93/03/03 14:40:20 grm
41 * Changed the structures and types.
42 * [93/03/03 grm]
43 *
44 * Revision 2.1.1.4 92/10/23 21:24:28 grm
45 * Added single stepping error code.
46 * [92/10/23 grm]
47 *
48 * Revision 2.1.1.3 92/10/08 14:28:07 grm
49 * Cosmetic changes.
50 * [92/10/08 grm]
51 *
52 * Revision 2.1.1.2 92/10/01 15:37:41 grm
53 * KTTD restructuring checkpoint.
54 * [92/10/01 grm]
55 *
56 * Revision 2.1.1.1 92/09/25 15:11:04 grm
57 * Initial Checkin.
58 * [92/09/25 grm]
59 *
60 */
61 /***********************************************************
62 Copyright 1992 by Digital Equipment Corporation, Maynard, Massachusetts,
63
64 All Rights Reserved
65
66 Permission to use, copy, modify, and distribute this software and its
67 documentation for any purpose and without fee is hereby granted, provided
68 that the above copyright notice appear in all copies and that both that
69 copyright notice and this permission notice appear in supporting
70 documentation, and that the name of Digital not be used in advertising
71 or publicity pertaining to distribution of the software without specific,
72 written prior permission. Digital makes no representations about the
73 suitability of this software for any purpose. It is provided "as is"
74 without express or implied warranty.
75
76 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
77 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
78 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
79 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
80 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
81 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
82 SOFTWARE.
83
84 ******************************************************************/
85
86 #ifndef _TTD_MSG_H_
87 #define _TTD_MSG_H_
88
89 #include "ttd_types.h"
90
91 /*********************************************/
92 /* Topaz TeleDebug Protocol Message Format */
93 /*********************************************/
94
95 typedef ttd_byte ttd_protocol_version_t;
96
97 /*
98 * We got this from SRC as version 2, so I called this 21 (or 2.1)
99 */
100 #define TTD_VERSION 24
101
102 /*
103 * Made these 32 bit values for easier life with risc and 64bit archs.
104 */
105 typedef uint32 ttd_operation;
106 typedef uint32 ttd_protocol_version;
107
108 enum {
109 Okay, /* Success */
110 InvalidOperation, /* No such operation */
111 InvalidTarget, /* Target does not exist */
112 InvalidArgument, /* Result.argNo identifies bad arg */
113 ServerNotAvailable, /* Can't contact desired TTD server */
114 TargetNotAvailable, /* Target in use or otherwise unavailable */
115 MemoryReferenceFailed, /* Can't make requested memory reference */
116 TooManyBreakpoints, /* Can't set any more breakpoints */
117 OperationNotApplicable, /* Can't apply operation in current state */
118 TargetStopped, /* */
119 TargetNotStopped, /* */
120 SynchError, /* */
121 TargetInLimbo, /* Target doing VFork -- come back later */
122 TargetTimedOut, /* Target held by stopped/crashed Taos */
123 ThreadInKernelCall, /* Thread can't be modified during call */
124 SingleSteppingError /* Problem with Single Stepping Mechanism */
125 };
126 typedef u_short ttd_code_t;
127
128 /*
129 * Must be multiple of word (4 bytes) size. Someday 8, 16, ...?
130 */
131 typedef struct {
132 ttd_code_t code;
133 u_short argno;
134 } ttd_result;
135
136 enum ttd_operations {
137 PROBE_SERVER = 1,
138 GET_TARGET_INFO = 4,
139 CONNECT_TO_TARGET = 5,
140
141 DISCONNECT_FROM_TARGET = 6,
142 READ_FROM_TARGET = 7,
143 WRITE_INTO_TARGET = 8,
144 GET_NEXT_THREAD = 9,
145 GET_THREAD_INFO = 10,
146 SET_THREAD_INFO = 11,
147 STOP_TARGET = 12,
148 PROBE_TARGET = 13,
149 RESTART_TARGET = 14,
150 SET_BREAKPOINT_IN_TARGET = 15,
151 CLEAR_BREAKPOINT_IN_TARGET = 16,
152 GET_NEXT_BREAKPOINT_IN_TARGET = 17,
153 SINGLE_STEP_THREAD = 18
154 };
155
156 /*
157 * The TTD Request Message Structure:
158 */
159 struct ttd_request {
160 ttd_server server;
161 ttd_seq seq;
162 ttd_target target;
163 ttd_operation operation;
164 union {
165 /*** UNTARGETED ***/
166
167 /* probe_server */
168
169 struct {
170 ttd_target target;
171 } get_target_info;
172
173 struct {
174 ttd_target target;
175 ttd_key key;
176 } connect_to_target;
177
178 /*** TARGETED ***/
179
180 /* disconnect_from_target */
181
182 struct {
183 ttd_address start;
184 ttd_count count;
185 } read_from_target;
186
187 struct {
188 ttd_address start;
189 ttd_count count;
190 ttd_data_block data;
191 } write_into_target;
192
193 struct {
194 ttd_thread thread;
195 } get_next_thread;
196
197 struct {
198 ttd_thread thread;
199 } get_thread_info;
200
201 struct {
202 ttd_thread thread;
203 ttd_thread_info thread_info;
204 ttd_trap_info trap_info;
205 ttd_machine_state machine_state;
206 } set_thread_info;
207
208 struct {
209 ttd_thread thread;
210 } stop_target;
211
212 /* probe_target */
213
214 struct {
215 ttd_thread thread;
216 } restart_target;
217
218 struct {
219 ttd_address address;
220 ttd_thread thread; /* Mach Addition */
221 ttd_flavor flavor;
222 } set_breakpoint_in_target;
223
224 struct {
225 ttd_address address;
226 ttd_thread thread; /* Mach Addition */
227 } clear_breakpoint_in_target;
228
229 struct {
230 ttd_address address;
231 ttd_boolean all_breaks; /* Mach Addition */
232 ttd_thread thread; /* Mach Addition */
233 } get_next_breakpoint_in_target;
234
235 struct {
236 ttd_thread thread;
237 } single_step_thread;
238
239 } u;
240 };
241
242 typedef struct ttd_request * ttd_request_t;
243
244 /*
245 * The Reply Message Structure:
246 */
247 struct ttd_reply {
248 ttd_server server;
249 ttd_seq seq;
250 ttd_target target;
251 ttd_result result;
252 ttd_operation operation;
253 union {
254 /*** UNTARGETED ***/
255
256 struct {
257 ttd_protocol_version version;
258 ttd_machine_type machine_type;
259 } probe_server;
260
261 struct {
262 ttd_target_info target_info;
263 } get_target_info;
264
265 struct {
266 ttd_target target; /* Necessary? XXX */
267 ttd_target_info target_info;
268 } connect_to_target;
269
270 /*** TARGETED ***/
271
272 /* disconnect_from_target */
273
274 struct {
275 ttd_count count;
276 ttd_data_block data;
277 } read_from_target;
278
279 /* write_into_target */
280
281 struct {
282 ttd_thread next;
283 } get_next_thread;
284
285 struct {
286 ttd_thread_info thread_info;
287 ttd_trap_info trap_info; /* Hmmm XXX */
288 ttd_machine_state machine_state;
289 } get_thread_info;
290
291 /* set_thread_info */
292
293 /* stop_target */
294
295 struct {
296 ttd_target_info target_info;
297 } probe_target;
298
299 /* restart_target */
300
301 struct {
302 ttd_saved_inst saved_inst;
303 } set_breakpoint_in_target;
304
305 /* clear_breakpoint_in_target */
306
307 struct {
308 ttd_address address;
309 ttd_flavor flavor;
310 ttd_saved_inst saved_inst;
311 } get_next_breakpoint_in_target;
312
313 /* single_step_thread */
314
315 } u;
316 };
317
318 typedef struct ttd_reply * ttd_reply_t;
319
320 #endif /* _TTD_MSG_H_ */
Cache object: c2c957d1f030567b86e14e285a376be3
|