1#ifndef _METROTRK_MSGCMD_H
2#define _METROTRK_MSGCMD_H
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_))
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_))
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
50#define DS_MIN_MSG_LENGTH 1
51#define DS_MIN_REPLY_LENGTH 2
53#define DS_MIN_MSG_VERSIONS_LENGTH DS_MIN_MSG_LENGTH
54#define DS_MIN_REPLY_VERSIONS_LENGTH (DS_MIN_REPLY_LENGTH + 4)
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
68#define DS_CPU_MAJOR_SUPERH 0x08
74#define DS_CPU_MIPS_R3000 0x00
75#define DS_CPU_MIPS_R3081E 0x01
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
83#define DS_CPU_MIPS_VR5000 0x40
89#define DS_CPU_PPC_403 0x00
91#define DS_CPU_PPC_5XX 0x20
92#define DS_CPU_PPC_505 0x21
93#define DS_CPU_PPC_509 0x22
94#define DS_CPU_PPC_50X 0x27
95#define DS_CPU_PPC_555 0x28
97#define DS_CPU_PPC_603E 0x40
99#define DS_CPU_PPC_7XX 0x50
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
105#define DS_CPU_PPC_8260 0x61
107#define DS_CPU_PPC_8XX 0x80
108#define DS_CPU_PPC_821 0x81
109#define DS_CPU_PPC_823 0x82
110#define DS_CPU_PPC_860 0x83
116#define DS_CPU_NEC_V8XX_V810 0x00
117#define DS_CPU_NEC_V8XX_V821 0x01
119#define DS_CPU_NEC_V8XX_V830 0x10
120#define DS_CPU_NEC_V8XX_V831 0x11
121#define DS_CPU_NEC_V8XX_V832 0x12
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
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
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
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
158#define DS_CPU_MCORE_200 0x00
159#define DS_CPU_MCORE_340 0x20
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)
167#if DS_PROTOCOL == DS_PROTOCOL_RTOS
168#define DS_MIN_MSG_READMEMORY_LENGTH (DS_MIN_MSG_LENGTH + 15)
170#define DS_MIN_MSG_READMEMORY_LENGTH (DS_MIN_MSG_LENGTH + 7)
172#define DS_MIN_REPLY_READMEMORY_LENGTH (DS_MIN_REPLY_LENGTH + 2)
174#if DS_PROTOCOL == DS_PROTOCOL_RTOS
175#define DS_MIN_MSG_WRITEMEMORY_LENGTH (DS_MIN_MSG_LENGTH + 15)
177#define DS_MIN_MSG_WRITEMEMORY_LENGTH (DS_MIN_MSG_LENGTH + 7)
179#define DS_MIN_REPLY_WRITEMEMORY_LENGTH (DS_MIN_REPLY_LENGTH + 2)
182#define DS_MSG_MEMORY_SEGMENTED 0x01
183#define DS_MSG_MEMORY_EXTENDED 0x02
184#define DS_MSG_MEMORY_PROTECTED 0x04
185#define DS_MSG_MEMORY_USERVIEW 0x08
187#define DS_MSG_MEMORY_SPACE_PROGRAM 0x00
188#define DS_MSG_MEMORY_SPACE_DATA 0x40
189#define DS_MSG_MEMORY_SPACE_IO 0x80
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)
196#define DS_MSG_MEMORY_SPACE_MASK 0xC0
198#define DS_MAXREADWRITELENGTH 0x0800
199#define DS_MAXMESSAGESIZE (DS_MAXREADWRITELENGTH + 0x80)
201#define MAXMESSAGESIZE DS_MAXMESSAGESIZE
203#define DS_MIN_MSG_FLUSHCACHE_LENGTH (DS_MIN_MSG_LENGTH + 9)
204#define DS_MIN_REPLY_FLUSHCACHE_LENGTH (DS_MIN_REPLY_LENGTH)
206#if DS_PROTOCOL == DS_PROTOCOL_RTOS
207#define DS_MIN_MSG_READREGISTERS_LENGTH (DS_MIN_MSG_LENGTH + 13)
209#define DS_MIN_MSG_READREGISTERS_LENGTH (DS_MIN_MSG_LENGTH + 5)
211#define DS_MIN_REPLY_READREGISTERS_LENGTH DS_MIN_REPLY_LENGTH
213#if DS_PROTOCOL == DS_PROTOCOL_RTOS
214#define DS_MIN_MSG_WRITEREGISTERS_LENGTH (DS_MIN_MSG_LENGTH + 13)
216#define DS_MIN_MSG_WRITEREGISTERS_LENGTH (DS_MIN_MSG_LENGTH + 5)
218#define DS_MIN_REPLY_WRITEREGISTERS_LENGTH DS_MIN_REPLY_LENGTH
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)
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)
235#define DS_MIN_MSG_STEP_LENGTH (DS_MIN_MSG_STEP_COUNT_LENGTH)
236#define DS_MIN_REPLY_STEP_LENGTH DS_MIN_REPLY_LENGTH
DSMessageRegisterOptions
Definition msgcmd.h:221
@ kDSRegistersExtended2
Definition msgcmd.h:225
@ kDSRegistersExtended1
Definition msgcmd.h:224
@ kDSRegistersDefault
Definition msgcmd.h:222
@ kDSRegistersFP
Definition msgcmd.h:223
u8 DSSupportMask[32]
Definition msgcmd.h:161
DSMessageStepOptions
Definition msgcmd.h:239
@ kDSStepIntoCount
Definition msgcmd.h:240
@ kDSStepOverRange
Definition msgcmd.h:243
@ kDSStepOverCount
Definition msgcmd.h:242
@ kDSStepIntoRange
Definition msgcmd.h:241
DSIOResult
Definition msgcmd.h:263
@ kDSIOError
Definition msgcmd.h:265
@ kDSIONoError
Definition msgcmd.h:264
@ kDSIOEOF
Definition msgcmd.h:266
MessageCommandID
Definition msgcmd.h:23
@ kDSReadMemory
Definition msgcmd.h:31
@ kDSReplyNAK
Definition msgcmd.h:40
@ kDSPositionFile
Definition msgcmd.h:47
@ kDSPing
Definition msgcmd.h:24
@ kDSReplyACK
Definition msgcmd.h:39
@ kDSNotifyException
Definition msgcmd.h:42
@ kDSCloseFile
Definition msgcmd.h:46
@ kDSSupportMask
Definition msgcmd.h:29
@ kDSOverride
Definition msgcmd.h:30
@ kDSStop
Definition msgcmd.h:38
@ kDSConnect
Definition msgcmd.h:25
@ kDSVersions
Definition msgcmd.h:28
@ kDSContinue
Definition msgcmd.h:36
@ kDSReadFile
Definition msgcmd.h:44
@ kDSNotifyStopped
Definition msgcmd.h:41
@ kDSSetOption
Definition msgcmd.h:35
@ kDSWriteRegisters
Definition msgcmd.h:34
@ kDSWriteMemory
Definition msgcmd.h:32
@ kDSWriteFile
Definition msgcmd.h:43
@ kDSStep
Definition msgcmd.h:37
@ kDSDisconnect
Definition msgcmd.h:26
@ kDSOpenFile
Definition msgcmd.h:45
@ kDSReset
Definition msgcmd.h:27
@ kDSReadRegisters
Definition msgcmd.h:33
DSFileHandle
Definition msgcmd.h:253
@ kDSStderr
Definition msgcmd.h:256
@ kDSStdin
Definition msgcmd.h:254
@ kDSStdout
Definition msgcmd.h:255
DSReplyError
Definition msgcmd.h:270
@ kDSReplyCWDSError
Definition msgcmd.h:274
@ kDSReplyInvalidProcessId
Definition msgcmd.h:289
@ kDSReplyNoError
Definition msgcmd.h:271
@ kDSReplyOsError
Definition msgcmd.h:288
@ kDSReplyParameterError
Definition msgcmd.h:280
@ kDSReplyBreakpointsFull
Definition msgcmd.h:286
@ kDSReplyUnsupportedCommandError
Definition msgcmd.h:279
@ kDSReplyOverflow
Definition msgcmd.h:277
@ kDSReplyUnsupportedOptionError
Definition msgcmd.h:281
@ kDSReplyNotStopped
Definition msgcmd.h:285
@ kDSDebugSecurityError
Definition msgcmd.h:291
@ kDSReplyInvalidThreadId
Definition msgcmd.h:290
@ kDSReplyCWDSException
Definition msgcmd.h:284
@ kDSReplyBadFCS
Definition msgcmd.h:276
@ kDSReplyError
Definition msgcmd.h:272
@ kDSReplyInvalidMemoryRange
Definition msgcmd.h:282
@ kDSReplyBreakpointConflict
Definition msgcmd.h:287
@ kDSReplyPacketSizeError
Definition msgcmd.h:273
@ kDSReplyEscapeError
Definition msgcmd.h:275
@ kDSReplySequenceMissing
Definition msgcmd.h:278
@ kDSReplyInvalidRegisterRange
Definition msgcmd.h:283