SSBM Decomp
Toggle main menu visibility
Loading...
Searching...
No Matches
msgcmd.h
Go to the documentation of this file.
1
#ifndef _METROTRK_MSGCMD_H
2
#define _METROTRK_MSGCMD_H
3
4
#include <
Runtime/platform.h
>
5
6
#define DSFetch_s8(_p_) (*((s8*) _p_))
7
#define DSFetch_s16(_p_) (*((s16*) _p_))
8
#define DSFetch_s32(_p_) (*((s32*) _p_))
9
#define DSFetch_s64(_p_) (*((s64*) _p_))
10
11
#define DSFetch_u8(_p_) (*((u8*) _p_))
12
#define DSFetch_u16(_p_) (*((u16*) _p_))
13
#define DSFetch_u32(_p_) (*((u32*) _p_))
14
#define DSFetch_u64(_p_) (*((u64*) _p_))
15
16
#define DS_PROTOCOL_MAJOR_VERSION_1 1
17
#define DS_PROTOCOL_MINOR_VERSION_10 10
18
#define DS_PROTOCOL_MAJOR_VERSION DS_PROTOCOL_MAJOR_VERSION_1
19
#define DS_PROTOCOL_MINOR_VERSION DS_PROTOCOL_MINOR_VERSION_10
20
#define DS_KERNEL_MAJOR_VERSION 0
21
#define DS_KERNEL_MINOR_VERSION 4
22
23
typedef
enum
MessageCommandID
{
24
kDSPing
= 0x00,
25
kDSConnect
= 0x01,
26
kDSDisconnect
= 0x02,
27
kDSReset
= 0x03,
28
kDSVersions
= 0x04,
29
kDSSupportMask
= 0x05,
30
kDSOverride
= 0x07,
31
kDSReadMemory
= 0x10,
32
kDSWriteMemory
= 0x11,
33
kDSReadRegisters
= 0x12,
34
kDSWriteRegisters
= 0x13,
35
kDSSetOption
= 0x17,
36
kDSContinue
= 0x18,
37
kDSStep
= 0x19,
38
kDSStop
= 0x1A,
39
kDSReplyACK
= 0x80,
40
kDSReplyNAK
= 0xFF,
41
kDSNotifyStopped
= 0x90,
42
kDSNotifyException
= 0x91,
43
kDSWriteFile
= 0xD0,
44
kDSReadFile
= 0xD1,
45
kDSOpenFile
= 0xD2,
46
kDSCloseFile
= 0xD3,
47
kDSPositionFile
= 0xD4
48
}
MessageCommandID
;
49
50
#define DS_MIN_MSG_LENGTH 1
51
#define DS_MIN_REPLY_LENGTH 2
52
53
#define DS_MIN_MSG_VERSIONS_LENGTH DS_MIN_MSG_LENGTH
54
#define DS_MIN_REPLY_VERSIONS_LENGTH (DS_MIN_REPLY_LENGTH + 4)
55
56
/*
57
** CPU Major types.
58
*/
59
60
#define DS_CPU_MAJOR_PPC 0x00
61
#define DS_CPU_MAJOR_MIPS 0x01
62
#define DS_CPU_MAJOR_NEC_V8XX 0x02
63
#define DS_CPU_MAJOR_MOT_DSP 0x03
64
#define DS_CPU_MAJOR_ARM 0x04
65
#define DS_CPU_MAJOR_X86 0x05
66
#define DS_CPU_MAJOR_MCORE 0x06
67
#define DS_CPU_MAJOR_M68K 0x07
/* includes ColdFire */
68
#define DS_CPU_MAJOR_SUPERH 0x08
69
70
/*
71
** MIPS CPU minor types.
72
*/
73
74
#define DS_CPU_MIPS_R3000 0x00
75
#define DS_CPU_MIPS_R3081E 0x01
76
77
#define DS_CPU_MIPS_VR4100 0x20
78
#define DS_CPU_MIPS_VR4300 0x21
79
#define DS_CPU_MIPS_VR4500 0x22
80
#define DS_CPU_MIPS_VR4111 0x23
81
#define DS_CPU_MIPS_TR4101 0x24
82
83
#define DS_CPU_MIPS_VR5000 0x40
84
85
/*
86
** PowerPC CPU minor types.
87
*/
88
89
#define DS_CPU_PPC_403 0x00
90
91
#define DS_CPU_PPC_5XX 0x20
/* used when not precisely known */
92
#define DS_CPU_PPC_505 0x21
93
#define DS_CPU_PPC_509 0x22
94
#define DS_CPU_PPC_50X 0x27
/* used when not precisely known */
95
#define DS_CPU_PPC_555 0x28
96
97
#define DS_CPU_PPC_603E 0x40
98
99
#define DS_CPU_PPC_7XX 0x50
/* used when not precisely known */
100
#define DS_CPU_PPC_740 0x51
101
#define DS_CPU_PPC_750 0x52
102
#define DS_CPU_PPC_7400 0x53
103
#define DS_CPU_PPC_7410 0x54
104
105
#define DS_CPU_PPC_8260 0x61
106
107
#define DS_CPU_PPC_8XX 0x80
/* used when not precisely known */
108
#define DS_CPU_PPC_821 0x81
109
#define DS_CPU_PPC_823 0x82
110
#define DS_CPU_PPC_860 0x83
111
112
/*
113
** NEC V8xx CPU minor types.
114
*/
115
116
#define DS_CPU_NEC_V8XX_V810 0x00
117
#define DS_CPU_NEC_V8XX_V821 0x01
118
119
#define DS_CPU_NEC_V8XX_V830 0x10
120
#define DS_CPU_NEC_V8XX_V831 0x11
121
#define DS_CPU_NEC_V8XX_V832 0x12
122
123
#define DS_CPU_NEC_V8XX_V850 0x20
124
#define DS_CPU_NEC_V8XX_V853 0x21
125
#define DS_CPU_NEC_V8XX_V850E 0x22
126
#define DS_CPU_NEC_V8XX_V850_SA1 0x23
127
128
/*
129
** M68K/Coldfire CPU minor types.
130
*/
131
132
#define DS_CPU_M68K_68000 0x00
133
#define DS_CPU_M68K_68020 0x02
134
#define DS_CPU_M68K_68030 0x04
135
#define DS_CPU_M68K_68040 0x06
136
#define DS_CPU_M68K_68060 0x08
137
138
#define DS_CPU_M68K_68302 0x20
139
#define DS_CPU_M68K_68306 0x22
140
#define DS_CPU_M68K_68307 0x24
141
#define DS_CPU_M68K_68328 0x26
142
#define DS_CPU_M68K_68EZ328 0x28
143
#define DS_CPU_M68K_68VZ328 0x29
144
#define DS_CPU_M68K_68340 0x2A
145
#define DS_CPU_M68K_68360 0x2C
146
147
#define DS_CPU_M68K_CF5102 0x80
148
#define DS_CPU_M68K_CF5202 0x82
149
#define DS_CPU_M68K_CF5204 0x84
150
#define DS_CPU_M68K_CF5206 0x86
151
#define DS_CPU_M68K_CF5206E 0x88
152
#define DS_CPU_M68K_CF5307 0x8A
153
154
/*
155
** MCore CPU minor types.
156
*/
157
158
#define DS_CPU_MCORE_200 0x00
159
#define DS_CPU_MCORE_340 0x20
160
161
typedef
u8
DSSupportMask
[32];
/* 256 bits total */
162
163
#define DS_MIN_MSG_SUPPORTMASK_LENGTH DS_MIN_MSG_LENGTH
164
#define DS_MIN_REPLY_SUPPORTMASK_LENGTH \
165
(DS_MIN_REPLY_LENGTH + sizeof(DSSupportMask) + 1)
166
167
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
168
#define DS_MIN_MSG_READMEMORY_LENGTH (DS_MIN_MSG_LENGTH + 15)
169
#else
170
#define DS_MIN_MSG_READMEMORY_LENGTH (DS_MIN_MSG_LENGTH + 7)
171
#endif
172
#define DS_MIN_REPLY_READMEMORY_LENGTH (DS_MIN_REPLY_LENGTH + 2)
173
174
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
175
#define DS_MIN_MSG_WRITEMEMORY_LENGTH (DS_MIN_MSG_LENGTH + 15)
176
#else
177
#define DS_MIN_MSG_WRITEMEMORY_LENGTH (DS_MIN_MSG_LENGTH + 7)
178
#endif
179
#define DS_MIN_REPLY_WRITEMEMORY_LENGTH (DS_MIN_REPLY_LENGTH + 2)
180
182
#define DS_MSG_MEMORY_SEGMENTED 0x01
/* non-flat addr space */
183
#define DS_MSG_MEMORY_EXTENDED 0x02
/* > 32-bit data addr */
184
#define DS_MSG_MEMORY_PROTECTED 0x04
/* non-user memory */
185
#define DS_MSG_MEMORY_USERVIEW 0x08
/* breakpoints are invisible */
186
187
#define DS_MSG_MEMORY_SPACE_PROGRAM 0x00
188
#define DS_MSG_MEMORY_SPACE_DATA 0x40
189
#define DS_MSG_MEMORY_SPACE_IO 0x80
190
191
#define TRK_MSG_HEADER_LENGTH DS_MSG_MEMORY_SPACE_DATA
192
#define TRK_MSG_REPLY_HEADER_LENGTH (TRK_MSG_HEADER_LENGTH + DS_MIN_MSG_LENGTH)
193
195
196
#define DS_MSG_MEMORY_SPACE_MASK 0xC0
197
198
#define DS_MAXREADWRITELENGTH 0x0800
/* 2K data portion */
199
#define DS_MAXMESSAGESIZE (DS_MAXREADWRITELENGTH + 0x80)
200
/* max size of all message including cmd hdr */
201
#define MAXMESSAGESIZE DS_MAXMESSAGESIZE
202
203
#define DS_MIN_MSG_FLUSHCACHE_LENGTH (DS_MIN_MSG_LENGTH + 9)
204
#define DS_MIN_REPLY_FLUSHCACHE_LENGTH (DS_MIN_REPLY_LENGTH)
205
206
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
207
#define DS_MIN_MSG_READREGISTERS_LENGTH (DS_MIN_MSG_LENGTH + 13)
208
#else
209
#define DS_MIN_MSG_READREGISTERS_LENGTH (DS_MIN_MSG_LENGTH + 5)
210
#endif
211
#define DS_MIN_REPLY_READREGISTERS_LENGTH DS_MIN_REPLY_LENGTH
212
213
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
214
#define DS_MIN_MSG_WRITEREGISTERS_LENGTH (DS_MIN_MSG_LENGTH + 13)
215
#else
216
#define DS_MIN_MSG_WRITEREGISTERS_LENGTH (DS_MIN_MSG_LENGTH + 5)
217
#endif
218
#define DS_MIN_REPLY_WRITEREGISTERS_LENGTH DS_MIN_REPLY_LENGTH
219
221
typedef
enum
{
222
kDSRegistersDefault
= 0x0,
/* Default register block */
223
kDSRegistersFP
= 0x1,
/* floating point registers */
224
kDSRegistersExtended1
= 0x2,
/* Extended register set 1 */
225
kDSRegistersExtended2
= 0x3
/* Extended register set 2 */
226
}
DSMessageRegisterOptions
;
227
228
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
229
#define DS_MIN_MSG_STEP_COUNT_LENGTH (DS_MIN_MSG_LENGTH + 10)
230
#define DS_MIN_MSG_STEP_RANGE_LENGTH (DS_MIN_MSG_LENGTH + 17)
231
#else
232
#define DS_MIN_MSG_STEP_COUNT_LENGTH (DS_MIN_MSG_LENGTH + 2)
233
#define DS_MIN_MSG_STEP_RANGE_LENGTH (DS_MIN_MSG_LENGTH + 9)
234
#endif
235
#define DS_MIN_MSG_STEP_LENGTH (DS_MIN_MSG_STEP_COUNT_LENGTH)
236
#define DS_MIN_REPLY_STEP_LENGTH DS_MIN_REPLY_LENGTH
237
239
typedef
enum
{
240
kDSStepIntoCount
= 0x00,
/* Exec count instructions & stop */
241
kDSStepIntoRange
= 0x01,
/* Exec until PC is out of specified range */
242
kDSStepOverCount
= 0x10,
/* Step over 1*count instructions & stop */
243
kDSStepOverRange
= 0x11
/* Step over until PC is out of specified range */
244
}
DSMessageStepOptions
;
245
246
/*
247
** These are the predefined file handles. Additional files may
248
** be opened via the kDSOpenFile command. New file handles
249
** returned by that command may be used in addition to the
250
** ones defined here.
251
*/
252
253
typedef
enum
DSFileHandle
{
254
kDSStdin
= 0x00,
255
kDSStdout
= 0x01,
256
kDSStderr
= 0x02
257
}
DSFileHandle
;
258
259
/*
260
** The result of an I/O command can be any one of the following.
261
*/
262
263
typedef
enum
DSIOResult
{
264
kDSIONoError
= 0x00,
265
kDSIOError
= 0x01,
266
kDSIOEOF
= 0x02
267
}
DSIOResult
;
268
270
typedef
enum
DSReplyError
{
271
kDSReplyNoError
= 0x00,
272
kDSReplyError
= 0x01,
273
kDSReplyPacketSizeError
= 0x02,
274
kDSReplyCWDSError
= 0x03,
275
kDSReplyEscapeError
= 0x04,
276
kDSReplyBadFCS
= 0x05,
277
kDSReplyOverflow
= 0x06,
278
kDSReplySequenceMissing
= 0x07,
279
kDSReplyUnsupportedCommandError
= 0x10,
280
kDSReplyParameterError
= 0x11,
281
kDSReplyUnsupportedOptionError
= 0x12,
282
kDSReplyInvalidMemoryRange
= 0x13,
283
kDSReplyInvalidRegisterRange
= 0x14,
284
kDSReplyCWDSException
= 0x15,
285
kDSReplyNotStopped
= 0x16,
286
kDSReplyBreakpointsFull
= 0x17,
287
kDSReplyBreakpointConflict
= 0x18,
288
kDSReplyOsError
= 0x20,
289
kDSReplyInvalidProcessId
= 0x21,
290
kDSReplyInvalidThreadId
= 0x22,
291
kDSDebugSecurityError
= 0x23
292
}
DSReplyError
;
293
294
#endif
u8
unsigned char u8
Definition
types.h:5
DSMessageRegisterOptions
DSMessageRegisterOptions
Register commands options.
Definition
msgcmd.h:221
kDSRegistersExtended2
@ kDSRegistersExtended2
Definition
msgcmd.h:225
kDSRegistersExtended1
@ kDSRegistersExtended1
Definition
msgcmd.h:224
kDSRegistersDefault
@ kDSRegistersDefault
Definition
msgcmd.h:222
kDSRegistersFP
@ kDSRegistersFP
Definition
msgcmd.h:223
DSSupportMask
u8 DSSupportMask[32]
Definition
msgcmd.h:161
DSMessageStepOptions
DSMessageStepOptions
Step command options.
Definition
msgcmd.h:239
kDSStepIntoCount
@ kDSStepIntoCount
Definition
msgcmd.h:240
kDSStepOverRange
@ kDSStepOverRange
Definition
msgcmd.h:243
kDSStepOverCount
@ kDSStepOverCount
Definition
msgcmd.h:242
kDSStepIntoRange
@ kDSStepIntoRange
Definition
msgcmd.h:241
DSIOResult
DSIOResult
Definition
msgcmd.h:263
kDSIOError
@ kDSIOError
Definition
msgcmd.h:265
kDSIONoError
@ kDSIONoError
Definition
msgcmd.h:264
kDSIOEOF
@ kDSIOEOF
Definition
msgcmd.h:266
MessageCommandID
MessageCommandID
Definition
msgcmd.h:23
kDSReadMemory
@ kDSReadMemory
Definition
msgcmd.h:31
kDSReplyNAK
@ kDSReplyNAK
Definition
msgcmd.h:40
kDSPositionFile
@ kDSPositionFile
Definition
msgcmd.h:47
kDSPing
@ kDSPing
Definition
msgcmd.h:24
kDSReplyACK
@ kDSReplyACK
Definition
msgcmd.h:39
kDSNotifyException
@ kDSNotifyException
Definition
msgcmd.h:42
kDSCloseFile
@ kDSCloseFile
Definition
msgcmd.h:46
kDSSupportMask
@ kDSSupportMask
Definition
msgcmd.h:29
kDSOverride
@ kDSOverride
Definition
msgcmd.h:30
kDSStop
@ kDSStop
Definition
msgcmd.h:38
kDSConnect
@ kDSConnect
Definition
msgcmd.h:25
kDSVersions
@ kDSVersions
Definition
msgcmd.h:28
kDSContinue
@ kDSContinue
Definition
msgcmd.h:36
kDSReadFile
@ kDSReadFile
Definition
msgcmd.h:44
kDSNotifyStopped
@ kDSNotifyStopped
Definition
msgcmd.h:41
kDSSetOption
@ kDSSetOption
Definition
msgcmd.h:35
kDSWriteRegisters
@ kDSWriteRegisters
Definition
msgcmd.h:34
kDSWriteMemory
@ kDSWriteMemory
Definition
msgcmd.h:32
kDSWriteFile
@ kDSWriteFile
Definition
msgcmd.h:43
kDSStep
@ kDSStep
Definition
msgcmd.h:37
kDSDisconnect
@ kDSDisconnect
Definition
msgcmd.h:26
kDSOpenFile
@ kDSOpenFile
Definition
msgcmd.h:45
kDSReset
@ kDSReset
Definition
msgcmd.h:27
kDSReadRegisters
@ kDSReadRegisters
Definition
msgcmd.h:33
DSFileHandle
DSFileHandle
Definition
msgcmd.h:253
kDSStderr
@ kDSStderr
Definition
msgcmd.h:256
kDSStdin
@ kDSStdin
Definition
msgcmd.h:254
kDSStdout
@ kDSStdout
Definition
msgcmd.h:255
DSReplyError
DSReplyError
Reply errors.
Definition
msgcmd.h:270
kDSReplyCWDSError
@ kDSReplyCWDSError
Definition
msgcmd.h:274
kDSReplyInvalidProcessId
@ kDSReplyInvalidProcessId
Definition
msgcmd.h:289
kDSReplyNoError
@ kDSReplyNoError
Definition
msgcmd.h:271
kDSReplyOsError
@ kDSReplyOsError
Definition
msgcmd.h:288
kDSReplyParameterError
@ kDSReplyParameterError
Definition
msgcmd.h:280
kDSReplyBreakpointsFull
@ kDSReplyBreakpointsFull
Definition
msgcmd.h:286
kDSReplyUnsupportedCommandError
@ kDSReplyUnsupportedCommandError
Definition
msgcmd.h:279
kDSReplyOverflow
@ kDSReplyOverflow
Definition
msgcmd.h:277
kDSReplyUnsupportedOptionError
@ kDSReplyUnsupportedOptionError
Definition
msgcmd.h:281
kDSReplyNotStopped
@ kDSReplyNotStopped
Definition
msgcmd.h:285
kDSDebugSecurityError
@ kDSDebugSecurityError
Definition
msgcmd.h:291
kDSReplyInvalidThreadId
@ kDSReplyInvalidThreadId
Definition
msgcmd.h:290
kDSReplyCWDSException
@ kDSReplyCWDSException
Definition
msgcmd.h:284
kDSReplyBadFCS
@ kDSReplyBadFCS
Definition
msgcmd.h:276
kDSReplyError
@ kDSReplyError
Definition
msgcmd.h:272
kDSReplyInvalidMemoryRange
@ kDSReplyInvalidMemoryRange
Definition
msgcmd.h:282
kDSReplyBreakpointConflict
@ kDSReplyBreakpointConflict
Definition
msgcmd.h:287
kDSReplyPacketSizeError
@ kDSReplyPacketSizeError
Definition
msgcmd.h:273
kDSReplyEscapeError
@ kDSReplyEscapeError
Definition
msgcmd.h:275
kDSReplySequenceMissing
@ kDSReplySequenceMissing
Definition
msgcmd.h:278
kDSReplyInvalidRegisterRange
@ kDSReplyInvalidRegisterRange
Definition
msgcmd.h:283
platform.h
src
MetroTRK
msgcmd.h
Generated by
1.17.0