dbgagents/trkagent/engine/msgcmd.h
author ravikurupati
Tue, 02 Mar 2010 10:33:16 +0530
changeset 0 c6b0df440bee
permissions -rw-r--r--
Initial contribution of EPL licensed sources
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     1
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     3
* All rights reserved.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     4
* This component and the accompanying materials are made available
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     6
* which accompanies this distribution, and is available
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     8
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     9
* Initial Contributors:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    11
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    12
* Contributors:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    13
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    14
* Description: 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    15
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    16
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    17
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    18
#ifndef __MSGCMD_H__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    19
#define __MSGCMD_H__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    20
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    21
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    22
#include "dstypes.h"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    23
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    24
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    25
** This is the maximum number of fields that will be encountered
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    26
** in a message, including the header field(s).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    27
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    28
#define DS_MAXMESSAGEFIELDCOUNT	15
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    29
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    30
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    31
** Some items are declared here only for debug purposes (e.g., 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    32
** string names for messages and fields).  The following macros
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    33
** allow these items to be removed when debugging is disabled,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    34
** eliminating otherwise wasted data space.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    35
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    36
#ifndef DEBUG_MSGCMD
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    37
	#error "DEBUG_MSGCMD must be defined to either 0 or 1"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    38
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    39
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    40
#if DEBUG_MSGCMD
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    41
	#define __debug_only_parm( x )		x,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    42
	#define __debug_only_field( x )		x;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    43
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    44
	#define __debug_only_parm( x )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    45
	#define	__debug_only_field( x )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    46
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    47
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    48
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    49
** Descriptor for a message field.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    50
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    51
typedef struct TrkMsgFieldDesc
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    52
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    53
	__debug_only_field( char *name )	/* Field name - for debugging */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    54
	int length;							/* Length of the field in bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    55
} TrkMsgFieldDesc;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    56
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    57
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    58
** Use this macro to initialize TrkMsgFieldDesc variables.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    59
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    60
#define __trk_msg_field( name, length )	{ __debug_only_parm( name ) length }
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    61
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    62
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    63
** Descriptor for a message.  Each message consists of a header followed
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    64
** by additional fields.  Note that length, count, and farray should
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    65
** only account for the additional fields.  For example: if the header
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    66
** has 1 field and the message has 3 additional fields (4 total), count
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    67
** should be 3.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    68
**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    69
** Only fixed-length numeric fields should be included in the descriptor.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    70
** Variable-length portions of a message, such as memory data, are
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    71
** typically handled by code that is specific to the message type.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    72
** They are outside the scope of the general-purpose routines which use
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    73
** these descriptors.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    74
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    75
//#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    76
#if 0	/* SCM: MIPS compiler defect generates bad code in this case */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    77
	#define __TrkMsgFieldMax
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    78
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    79
	#define __TrkMsgFieldMax	DS_MAXMESSAGEFIELDCOUNT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    80
#endif /* #if __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    81
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    82
typedef struct TrkMsgDesc
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    83
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    84
	__debug_only_field( char *name )	/* Message name - for debugging */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    85
	const struct TrkMsgDesc	*header;	/* Descriptor for header/previous fragment */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    86
	int 				length;			/* Length of the message in bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    87
	unsigned int 		count;			/* Number of fields in the message */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    88
	TrkMsgFieldDesc 	farray[__TrkMsgFieldMax];/* Descriptors for the message fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    89
} TrkMsgDesc;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    90
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    91
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    92
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    93
	#define DESCDECLNC			
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    94
	#define DESCDECL			const
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    95
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    96
	#define DESCDECLNC			extern
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    97
	#define DESCDECL			extern const
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    98
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    99
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   100
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   101
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   102
 *	Commands
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   103
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   104
 *	constant definitions of commands sent from host to target
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   105
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   106
 *	L1 = Level 1 CWDS (required)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   107
 *	L2 = Level 2 CWDS (extended board-level debugger)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   108
 *	L3 = Level 3 CWDS (OS-level debugger)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   109
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   110
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   111
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   112
#define DS_PROTOCOL_MIN			1	/* L1 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   113
#define DS_PROTOCOL_BOARD		2	/* L2 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   114
#define DS_PROTOCOL_RTOS		3	/* L3 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   115
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   116
#if (!defined( DS_PROTOCOL )) || (DS_PROTOCOL == 0)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   117
	#pragma error "Protocol level must be defined"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   118
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   119
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   120
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   121
** The current protocol version.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   122
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   123
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   124
#define DS_PROTOCOL_MAJOR_VERSION_3	3
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   125
#define DS_PROTOCOL_MINOR_VERSION_0 0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   126
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   127
#define DS_PROTOCOL_MINOR_VERSION_1 1
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   128
#define DS_PROTOCOL_MINOR_VERSION_2 2
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   129
#define DS_PROTOCOL_MINOR_VERSION_3 3
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   130
#define DS_PROTOCOL_MINOR_VERSION_4 4
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   131
#define DS_PROTOCOL_MINOR_VERSION_5 5
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   132
#define DS_PROTOCOL_MINOR_VERSION_6 6
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   133
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   134
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   135
#define DS_PROTOCOL_MAJOR_VERSION	DS_PROTOCOL_MAJOR_VERSION_3
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   136
#define DS_PROTOCOL_MINOR_VERSION   DS_PROTOCOL_MINOR_VERSION_6
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   137
#define DS_PROTOCOL_VERSION_STRING	version_str( DS_PROTOCOL_MAJOR_VERSION, \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   138
												 DS_PROTOCOL_MINOR_VERSION )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   139
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   140
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   141
** Named constants for significant protocol revisions can be added
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   142
** here (the existing definitions should not be changed).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   143
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   144
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   145
/* Sequence IDs were introduced in version 2.0 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   146
#define DS_PROTOCOL_MAJOR_VERSION_SEQUENCEIDS	2
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   147
#define DS_PROTOCOL_MINOR_VERSION_SEQUENCEIDS	0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   148
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   149
/* Multi-channel communication, ethernet, & other comm enhancements in 3.0 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   150
#define DS_PROTOCOL_MAJOR_VERSION_MULTICHANNEL	3
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   151
#define DS_PROTOCOL_MINOR_VERSION_MULTICHANNEL	0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   152
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   153
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   154
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   155
#pragma mark  MessageCommandID command value list
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   156
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   157
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   158
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   159
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   160
 *	MessageCommandID command value list
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   161
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   162
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   163
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   164
typedef enum MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   165
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   166
	/* meta commands, minimum feature set */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   167
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   168
	kDSPing						= 0x00,		/*					*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   169
	kDSConnect					= 0x01,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   170
	kDSDisconnect				= 0x02,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   171
	kDSReset					= 0x03,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   172
	kDSVersions					= 0x04,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   173
	kDSSupportMask              = 0x05,     /*  L1	L2	L3      */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   174
	kDSCPUType					= 0x06,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   175
	kDSConfigTransport			= 0x07,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   176
	kDSVersions2				= 0x08,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   177
	kDSHostVersions				= 0x09,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   178
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   179
	/* state commands */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   180
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   181
	kDSReadMemory				= 0x10,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   182
	kDSWriteMemory				= 0x11,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   183
	kDSReadRegisters			= 0x12,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   184
	kDSWriteRegisters			= 0x13,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   185
	kDSFillMemory				= 0x14,		/*					*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   186
	kDSCopyMemory				= 0x15,		/*					*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   187
	kDSFlushCache				= 0x16,		/*					*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   188
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   189
	/* execution commands */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   190
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   191
	kDSContinue					= 0x18,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   192
	kDSStep						= 0x19,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   193
	kDSStop						= 0x1a,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   194
	kDSSetBreak					= 0x1b,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   195
	kDSClearBreak				= 0x1c,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   196
	kDSDownload					= 0x1d,		/*					*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   197
	kDSModifyBreakThread		= 0x1e,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   198
	/* Note: kDSSetWatch & kDSClearWatch are obsolete and have been removed */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   199
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   200
	/* host->target IO management */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   201
	kDSNotifyFileInput			= 0x20,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   202
	kDSBlockFileIo				= 0x21,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   203
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   204
	/* host->target OS commands */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   205
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   206
	kDSOSCreateItem				= 0x40,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   207
	kDSOSDeleteItem				= 0x41,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   208
	kDSOSReadInfo				= 0x42,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   209
	kDSOSWriteInfo				= 0x43,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   210
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   211
	kDSOSWriteFile				= 0x48,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   212
	kDSOSReadFile				= 0x49,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   213
	kDSOSOpenFile				= 0x4a,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   214
	kDSOSCloseFile				= 0x4b,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   215
	kDSOSPositionFile			= 0x4c,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   216
	kDSOSInstallFile			= 0x4d,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   217
	kDSOSInstallFile2			= 0x4e,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   218
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   219
	kDSOSPhoneSWVersion         = 0x4f,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   220
	kDSOSPhoneName              = 0x50,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   221
	kDSVersions3				= 0x51,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   222
	/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   223
	 * 0x70 - 0x7F reserved for host->target target-specific commands
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   224
	 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   225
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   226
	/* replies */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   227
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   228
	kDSReplyACK					= 0x80,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   229
	kDSReplyNAK					= 0xFF,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   230
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   231
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   232
	/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   233
	 * target->host notification
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   234
	 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   235
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   236
	kDSNotifyStopped			= 0x90,		/*	L1	L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   237
	kDSNotifyException			= 0x91,		/*  OBSOLETE!       */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   238
		/* kDSNotifyException (0x91) is included for historical */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   239
		/* reasons only; DON'T IMPLEMENT IN NEW DEBUG NUB CODE! */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   240
	kDSNotifyInternalError		= 0x92,		/*					*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   241
//not used, remove?	kDSNotifyBreak				= 0x93,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   242
	kDSNotifyStopped2			= 0x94,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   243
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   244
	/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   245
	 * target->host OS notification
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   246
	 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   247
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   248
	kDSOSNotifyCreated			= 0xa0,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   249
	kDSOSNotifyDeleted			= 0xa1,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   250
	kDSOSNotifyProcessorStarted	= 0xa2,		/*          L3      */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   251
	kDSOSNotifyProcessorStandby	= 0xa6,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   252
	kDSOSNotifyProcessorReset	= 0xa7,		/*			L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   253
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   254
	/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   255
	 * target->host support commands
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   256
	 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   257
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   258
	kDSWriteFile				= 0xD0,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   259
	kDSReadFile					= 0xD1,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   260
	kDSOpenFile					= 0xD2,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   261
	kDSCloseFile				= 0xD3,		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   262
	kDSPositionFile				= 0xD4		/*		L2	L3		*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   263
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   264
	/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   265
	 * 0xE0 - 0xEF reserved for target->host target-specific commands
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   266
	 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   267
} MessageCommandID;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   268
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   269
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   270
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   271
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   272
 *	Formatted data for messages sent between host and target.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   273
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   274
 *	Primitive Scalar Types:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   275
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   276
 *		Only use hard data types with fixed sizes:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   277
 *		ui8		8-bit unsigned integer
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   278
 *		ui16	16-bit unsigned integer
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   279
 *		ui32	32-bit unsigned integer
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   280
 *		ui8 []	array of bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   281
 *		char[]	array of characters (C string)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   282
 *		etc.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   283
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   284
 *	Endian:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   285
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   286
 *		Messages are sent in big-endian format.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   287
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   288
 *		Example layouts:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   289
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   290
 *   Type Value                  Big Endian                    Little Endian
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   291
 * -------------------- ---------------------------     ---------------------------
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   292
 *    ui8 0x12          [0x12]                          [0x12]
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   293
 *   ui16 0x1234        [0x12] [0x34]					[0x34] [0x12]
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   294
 *   ui32 0x12345678    [0x12] [0x34] [0x56] [0x78]     [0x78] [0x56] [0x34] [0x12]
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   295
 *  ui8[] 0x12 0x34     [0x12] [0x34]                   [0x12] [0x34]
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   296
 * ui16[] 0x1234 0x5678 [0x12] [0x34] [0x56] [0x78]     [0x34] [0x12] [0x78] [0x56]
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   297
 * ui32[] 0x12345678    [0x12] [0x34] [0x56] [0x78]     [0x78] [0x56] [0x34] [0x12]
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   298
 *        0x9ABCDEF0    [0x9A] [0xBC] [0xDE] [0xF0]     [0xF0] [0xDE] [0xBC] [0x9A]
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   299
 * char[] "Abcd 234"    [0x41] [0x62] [0x63] [0x64]     [0x41] [0x62] [0x63] [0x64]
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   300
 *                      [0x20] [0x32] [0x33] [0x34]     [0x20] [0x32] [0x33] [0x34]
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   301
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   302
 *	Alignment:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   303
 *		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   304
 *    Messages have no alignment restrictions.  For transmission efficiency,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   305
 *    alignment padding is not recommended in messages.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   306
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   307
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   308
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   309
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   310
#pragma mark  -
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   311
#pragma mark Message Formats
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   312
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   313
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   314
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   315
 *	M E S S A G E  F O R M A T S
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   316
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   317
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   318
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   319
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   320
#pragma mark  Message Header (common)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   321
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   322
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   323
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   324
 *	Message Header (new format):
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   325
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   326
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   327
 *		ui8		sequenceId			- (1) sequence ID of message
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   328
 *									  <2> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   329
 *	- OR - (old format):
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   330
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   331
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   332
 *									  <1> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   333
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   334
 *	All messages, including replies begin with this header.  Some may consist
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   335
 *	of nothing else (e.g., the Reset message).  Others contain additional
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   336
 *	information following the header.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   337
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   338
 *	Currently MetroTRK only supports sending 1 message at a time, which
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   339
 *	means that the sender must wait for a reply to each message before
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   340
 *	sending the next message.  For this case, the sequence IDs follow
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   341
 *	these rules:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   342
 *		- For non-reply messages, the sequence ID should be 1 larger
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   343
 *		  than the sequence ID of the previous message from the same
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   344
 *		  sender, or 0x01 if the previous value was 0xFF.  The host
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   345
 *		  and target sequence ID's are independent.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   346
 *		  A sequence ID of 0 is a special case.  It is always valid
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   347
 *		  and resets the sequence so that the next expected ID is 1
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   348
 *        for both the host and target.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   349
 *		- For ACK reply messages, the sequence ID should equal the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   350
 *		  sequence ID of the message to which it is replying.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   351
 *		- For NAK reply messages, if the error code is 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   352
 *		  kDSReplySequenceMissing then the sequence ID should be the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   353
 *		  next value that was expected by the receiver.  For
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   354
 *		  any other error code, the sequence ID is indeterminate.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   355
 *		- If a received, non-reply sequence ID is the same as the 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   356
 *		  previous received sequence ID, the receiver should re-send
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   357
 *		  the reply to the previous message *without* re-processing
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   358
 *		  the message.  It is important for certain messages (e.g., file
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   359
 *		  writes) that duplicates not be re-processed.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   360
 *		- If a received, non-reply sequence ID is not equal to the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   361
 *		  previous received sequence ID, the next expected ID, or 0,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   362
 *		  the receiver should send a NAK reply with the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   363
 *		  kDSReplySequenceMissing error code and discard the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   364
 *		  received message.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   365
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   366
 *	The sequenceId field is new in version 2.0 of the protocol.  For
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   367
 *	backwards compatibility, descriptors are included for both the new
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   368
 *	and the old header formats.  The new format will be used by default,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   369
 *	but it can be changed at runtime.  The old format can also be forced
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   370
 *	at build time by defining the following in target.h:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   371
 *		#define TRK_MSG_SEQUENCE_IDS		0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   372
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   373
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   374
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   375
#define TRK_MSG_HEADER_LENGTH		(gTrkMsgHeader.length)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   376
#define TRK_MSG_HEADER_COUNT		2				/* 2 field in header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   377
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   378
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   379
** For L1 and L2, sequence IDs are disabled by default.  For L3 they are
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   380
** enabled by default.  Individual targets can override this setting by
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   381
** defining TRK_MSG_SEQUENCE_IDS in target.h.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   382
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   383
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   384
#ifndef TRK_MSG_SEQUENCE_IDS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   385
	#if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   386
		#define TRK_MSG_SEQUENCE_IDS		0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   387
	#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   388
		#define TRK_MSG_SEQUENCE_IDS		1
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   389
	#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   390
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   391
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   392
/* The current header descriptor as of protocol version 2.0 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   393
#define TRK_MSG_HEADER_20_INIT \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   394
{ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   395
	__debug_only_parm( "Header" ) \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   396
	NULL,										/* previous fragment/header */ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   397
	2,											/* # of bytes */ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   398
	TRK_MSG_HEADER_COUNT,						/* # of fields */ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   399
	{						/* field descriptors: */ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   400
		__trk_msg_field( "command", 1 ), \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   401
		__trk_msg_field( "sequence ID", 1 ) \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   402
	} \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   403
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   404
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   405
DESCDECL TrkMsgDesc gTrkMsgHeader20
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   406
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   407
= TRK_MSG_HEADER_20_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   408
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   409
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   410
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   411
/* The old header descriptor prior to protocol version 2.0 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   412
#define TRK_MSG_HEADER_PRE_20_INIT \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   413
{ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   414
	__debug_only_parm( "Header" ) \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   415
	NULL,										/* previous fragment/header */ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   416
	1,											/* # of bytes */ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   417
	TRK_MSG_HEADER_COUNT,						/* # of fields */ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   418
	{						/* field descriptors: */ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   419
		__trk_msg_field( "command", 1 ), \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   420
		__trk_msg_field( "sequence ID (N/A)", 0 )		/* placeholder to make indices consistent */ \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   421
	} \
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   422
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   423
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   424
DESCDECL TrkMsgDesc gTrkMsgHeaderPre20
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   425
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   426
= TRK_MSG_HEADER_PRE_20_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   427
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   428
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   429
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   430
/* Use new header by default - can be changed at runtime. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   431
DESCDECLNC TrkMsgDesc gTrkMsgHeader
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   432
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   433
	#if TRK_MSG_SEQUENCE_IDS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   434
		= TRK_MSG_HEADER_20_INIT;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   435
	#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   436
		= TRK_MSG_HEADER_PRE_20_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   437
	#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   438
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   439
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   440
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   441
/* "Index" of fields. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   442
#define TRK_MSG_COMMAND_INDEX	0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   443
#define TRK_MSG_SID_INDEX		1
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   444
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   445
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   446
#pragma mark  Reply Header (common)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   447
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   448
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   449
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   450
 *	Reply Message Header
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   451
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   452
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   453
 *		ui8		error				- (1) CWDS error value
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   454
 *									  <1 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   455
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   456
 *	The command for a reply message must be either kDSReplyACK or kDSReplyNAK.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   457
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   458
 *	A NAK reply indicates that an invalid message or portion of a message
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   459
 *  was received.  The error value will specify the problem.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   460
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   461
 *	An ACK with an error value other than kDSReplyNoError indicates that 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   462
 *	the message was valid but could not be processed for some reason (e.g.,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   463
 *	invalid memory ranges, bad parameters, etc.).  The error value will
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   464
 *	specify the problem.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   465
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   466
 *	Some command replies include additional information that is specific to
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   467
 *  the command.  This additional information is included ONLY if the 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   468
 *  reply is an ACK with kDSReplyNoError.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   469
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   470
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   471
#define TRK_MSG_REPLY_HEADER_LENGTH	(1 + TRK_MSG_HEADER_LENGTH)	/* 1 addl bytes  */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   472
#define TRK_MSG_REPLY_HEADER_COUNT	(1 + TRK_MSG_HEADER_COUNT)	/* 1 addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   473
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   474
DESCDECL TrkMsgDesc gTrkMsgReplyHeader
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   475
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   476
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   477
	__debug_only_parm( "Reply Header" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   478
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   479
	1,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   480
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   481
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   482
		__trk_msg_field( "error", 1 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   483
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   484
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   485
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   486
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   487
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   488
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   489
#define TRK_MSG_REPLY_ERROR_INDEX			(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   490
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   491
/* Retain these for compatibility with older code */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   492
#define DS_MIN_MSG_LENGTH					TRK_MSG_HEADER_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   493
#define DS_MIN_REPLY_LENGTH					TRK_MSG_REPLY_HEADER_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   494
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   495
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   496
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   497
 *	Required Send and Reply Messsages
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   498
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   499
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   500
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   501
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   502
#pragma mark  Ping
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   503
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   504
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   505
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   506
 *	kDSPing
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   507
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   508
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   509
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   510
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   511
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   512
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   513
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   514
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   515
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   516
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   517
 *	Can be sent by the host at any time.  Simply replies with an
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   518
 *	ACK.  Currently not supported.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   519
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   520
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   521
 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   522
#define DS_MIN_MSG_PING_LENGTH				DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   523
#define DS_MIN_REPLY_PING_LENGTH			DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   524
 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   525
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   526
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   527
#pragma mark  Connect
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   528
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   529
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   530
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   531
 *	kDSConnect
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   532
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   533
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   534
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   535
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   536
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   537
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   538
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   539
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   540
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   541
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   542
 *	The host should send a connect message once at the beginning of
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   543
 *	a debug session.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   544
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   545
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   546
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   547
#define DS_MIN_MSG_CONNECT_LENGTH			DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   548
#define DS_MIN_REPLY_CONNECT_LENGTH			DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   549
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   550
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   551
#pragma mark  Disconnect
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   552
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   553
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   554
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   555
 *	kDSDisconnect
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   556
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   557
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   558
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   559
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   560
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   561
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   562
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   563
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   564
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   565
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   566
 *	The host should send a disconnect message once at the end of
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   567
 *	a debug session.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   568
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   569
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   570
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   571
#define DS_MIN_MSG_DISCONNECT_LENGTH		DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   572
#define DS_MIN_REPLY_DISCONNECT_LENGTH		DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   573
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   574
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   575
#pragma mark  Reset
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   576
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   577
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   578
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   579
 *	kDSReset
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   580
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   581
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   582
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   583
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   584
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   585
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   586
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   587
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   588
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   589
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   590
 *  Sent by the host.  Causes a soft reset on the target board.  The
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   591
 *	ACK reply is sent before reset.  The host should also expect a 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   592
 *	welcome message after reset.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   593
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   594
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   595
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   596
#define DS_MIN_MSG_RESET_LENGTH				DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   597
#define DS_MIN_REPLY_RESET_LENGTH			DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   598
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   599
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   600
#pragma mark  Versions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   601
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   602
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   603
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   604
 *	kDSVersions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   605
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   606
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   607
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   608
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   609
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   610
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   611
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   612
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   613
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   614
 *		ui8		kernelMajor			- (1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   615
 *		ui8		kernelMinor			- (1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   616
 *		ui8		protocolMajor		- (1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   617
 *		ui8		protocolMinor		- (1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   618
 *									  <4 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   619
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   620
 *	Sent by the host, returns TRK version numbers.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   621
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   622
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   623
#define DS_MIN_MSG_VERSIONS_LENGTH			DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   624
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   625
DESCDECL TrkMsgDesc gTrkMsgVersionsReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   626
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   627
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   628
	__debug_only_parm( "Versions Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   629
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   630
	4,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   631
	4,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   632
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   633
		__trk_msg_field( "kernel major", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   634
		__trk_msg_field( "kernel minor", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   635
		__trk_msg_field( "protocol major", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   636
		__trk_msg_field( "protocol minor", 1 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   637
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   638
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   639
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   640
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   641
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   642
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   643
#define TRK_MSG_VR_KMAJOR_INDEX		(0 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   644
#define TRK_MSG_VR_KMINOR_INDEX		(1 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   645
#define TRK_MSG_VR_PMAJOR_INDEX		(2 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   646
#define TRK_MSG_VR_PMINOR_INDEX		(3 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   647
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   648
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   649
#pragma mark  CPUType
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   650
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   651
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   652
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   653
 *	kDSCPUType
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   654
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   655
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   656
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   657
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   658
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   659
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   660
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   661
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   662
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   663
 *		ui8		CPU major type		- (1) DS_CPU_MAJOR_* (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   664
 *		ui8		CPU minor type		- (1) DS_CPU_* (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   665
 *		ui8		big_endian			- (1) 1 ==> big endian, 0 ==> little endian
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   666
 *		ui8		default type size	- (1) size of DefaultType
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   667
 *		ui8		FP type size 		- (1) size of FPType (0 if unsupported)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   668
 *		ui8		extended1 type size - (1) size of Extended1Type (0 if unsupported)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   669
 *		ui8		extended2 type size - (1) size of Extended2Type (0 if unsupported)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   670
 *									  <7 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   671
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   672
 *	Sent by the host, returns information indicating the CPU type and
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   673
 *	CPU implementation details for the target system.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   674
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   675
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   676
#define DS_MIN_MSG_CPUTYPE_LENGTH			DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   677
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   678
DESCDECL TrkMsgDesc gTrkMsgCpuTypeReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   679
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   680
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   681
	__debug_only_parm( "CPU Type Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   682
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   683
	7,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   684
	7,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   685
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   686
		__trk_msg_field( "CPU major", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   687
		__trk_msg_field( "CPU minor", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   688
		__trk_msg_field( "big endian", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   689
		__trk_msg_field( "default type size", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   690
		__trk_msg_field( "FP type size", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   691
		__trk_msg_field( "extended1 type size", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   692
		__trk_msg_field( "extended2 type size", 1 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   693
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   694
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   695
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   696
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   697
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   698
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   699
#define TRK_MSG_CTR_CMAJOR_INDEX			(0 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   700
#define TRK_MSG_CTR_CMINOR_INDEX			(1 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   701
#define TRK_MSG_CTR_BIGENDIAN_INDEX			(2 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   702
#define TRK_MSG_CTR_DEFAULT_SIZE_INDEX		(3 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   703
#define TRK_MSG_CTR_FP_SIZE_INDEX			(4 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   704
#define TRK_MSG_CTR_EXTENDED1_SIZE_INDEX	(5 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   705
#define TRK_MSG_CTR_EXTENDED2_SIZE_INDEX	(6 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   706
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   707
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   708
** CPU Major types.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   709
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   710
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   711
#define DS_CPU_MAJOR_PPC					0x00
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   712
#define DS_CPU_MAJOR_MIPS					0x01
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   713
#define DS_CPU_MAJOR_NEC_V8XX				0x02
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   714
#define DS_CPU_MAJOR_MOT_DSP				0x03
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   715
#define DS_CPU_MAJOR_ARM					0x04
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   716
#define DS_CPU_MAJOR_X86					0x05
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   717
#define DS_CPU_MAJOR_MCORE					0x06
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   718
#define DS_CPU_MAJOR_M68K					0x07	/* includes ColdFire */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   719
#define DS_CPU_MAJOR_SUPERH					0x08
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   720
#define DS_CPU_MAJOR_STARCORE				0x09
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   721
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   722
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   723
** ARM CPU minor types.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   724
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   725
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   726
#define DS_CPU_ARM_920T					0x00
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   727
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   728
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   729
** MIPS CPU minor types.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   730
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   731
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   732
#define DS_CPU_MIPS_R3000				0x00
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   733
#define DS_CPU_MIPS_R3081E				0x01
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   734
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   735
#define DS_CPU_MIPS_VR4100				0x20
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   736
#define DS_CPU_MIPS_VR4300				0x21
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   737
#define DS_CPU_MIPS_VR4500				0x22
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   738
#define DS_CPU_MIPS_VR4111				0x23
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   739
#define DS_CPU_MIPS_TR4101				0x24
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   740
#define DS_CPU_MIPS_EZ4103				0x25
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   741
#define DS_CPU_MIPS_RM7000				0x26
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   742
#define DS_CPU_MIPS_MIPS32_4kc			0x27
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   743
#define DS_CPU_MIPS_RM5231				0x28
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   744
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   745
#define DS_CPU_MIPS_VR5000				0x40
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   746
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   747
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   748
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   749
** PowerPC CPU minor types.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   750
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   751
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   752
#define	DS_CPU_PPC_403					0x00
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   753
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   754
#define DS_CPU_PPC_5XX					0x20	/* used when not precisely known */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   755
#define DS_CPU_PPC_505					0x21
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   756
#define DS_CPU_PPC_509					0x22
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   757
#define DS_CPU_PPC_50X					0x27	/* used when not precisely known */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   758
#define DS_CPU_PPC_555					0x28
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   759
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   760
#define DS_CPU_PPC_603E					0x40
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   761
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   762
#define DS_CPU_PPC_7XX					0x50	/* used when not precisely known */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   763
#define DS_CPU_PPC_740					0x51
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   764
#define DS_CPU_PPC_750					0x52
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   765
#define DS_CPU_PPC_7400                 0x53
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   766
#define DS_CPU_PPC_7410                 0x54
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   767
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   768
#define DS_CPU_PPC_8260					0x61
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   769
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   770
#define DS_CPU_PPC_8XX					0x80	/* used when not precisely known */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   771
#define DS_CPU_PPC_821					0x81
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   772
#define DS_CPU_PPC_823					0x82
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   773
#define DS_CPU_PPC_860					0x83
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   774
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   775
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   776
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   777
** NEC V8xx CPU minor types.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   778
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   779
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   780
#define DS_CPU_NEC_V8XX_V810			0x00
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   781
#define DS_CPU_NEC_V8XX_V821			0x01
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   782
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   783
#define DS_CPU_NEC_V8XX_V830			0x10
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   784
#define DS_CPU_NEC_V8XX_V831			0x11
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   785
#define DS_CPU_NEC_V8XX_V832			0x12
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   786
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   787
#define DS_CPU_NEC_V8XX_V850			0x20
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   788
#define DS_CPU_NEC_V8XX_V853			0x21
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   789
#define DS_CPU_NEC_V8XX_V850E			0x22
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   790
#define DS_CPU_NEC_V8XX_V850_SA1		0x23
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   791
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   792
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   793
** M68K/Coldfire CPU minor types.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   794
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   795
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   796
#define DS_CPU_M68K_68000				0x00
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   797
#define DS_CPU_M68K_68020				0x02
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   798
#define DS_CPU_M68K_68030				0x04
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   799
#define DS_CPU_M68K_68040				0x06
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   800
#define DS_CPU_M68K_68060				0x08
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   801
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   802
#define DS_CPU_M68K_68302				0x20
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   803
#define DS_CPU_M68K_68306				0x22
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   804
#define DS_CPU_M68K_68307				0x24
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   805
#define DS_CPU_M68K_68328				0x26
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   806
#define DS_CPU_M68K_68EZ328				0x28
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   807
#define DS_CPU_M68K_68VZ328				0x29
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   808
#define DS_CPU_M68K_68340				0x2a
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   809
#define DS_CPU_M68K_68360				0x2c
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   810
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   811
#define DS_CPU_M68K_CF5102				0x80
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   812
#define DS_CPU_M68K_CF5202				0x82
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   813
#define DS_CPU_M68K_CF5204				0x84
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   814
#define DS_CPU_M68K_CF5206				0x86
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   815
#define DS_CPU_M68K_CF5206E				0x88
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   816
#define DS_CPU_M68K_CF5307				0x8a
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   817
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   818
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   819
** MCore CPU minor types.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   820
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   821
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   822
#define DS_CPU_MCORE_200				0x00
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   823
#define DS_CPU_MCORE_340				0x20
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   824
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   825
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   826
** STARCORE CPU minor types
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   827
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   828
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   829
#define DS_CPU_STARCORE_8101			0x01
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   830
#define	DS_CPU_STARCORE_8102			0x02
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   831
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   832
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   833
#pragma mark  SupportMask
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   834
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   835
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   836
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   837
 *	kDSSupportMask
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   838
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   839
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   840
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   841
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   842
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   843
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   844
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   845
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   846
 *		ui8		command				- (1) ack/nak MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   847
 *		ui8		error				- (1) CWDS error value
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   848
 *		ui8		mask[32]			- (32) DSSupportMask
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   849
 *		ui8		protocolLevel		- (1) value of DS_PROTOCOL (1-3)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   850
 *									  <34>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   851
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   852
 *	Sent by the host, returns support mask indicating which commands are
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   853
 *	supported by that particular TRK.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   854
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   855
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   856
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   857
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   858
 * Meaning: (bit x == 1) <==> (command x is supported)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   859
 * where bit 0 is the least significant bit of mask[0] and
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   860
 * bit 255 is the most significant bit of mask[31].
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   861
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   862
typedef ui8	DSSupportMask[32];				/* 256 bits total */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   863
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   864
#define DS_MIN_MSG_SUPPORTMASK_LENGTH		DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   865
#define DS_MIN_REPLY_SUPPORTMASK_LENGTH		(DS_MIN_REPLY_LENGTH + sizeof( DSSupportMask ) + 1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   866
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   867
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   868
#pragma mark  ConfigTransport
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   869
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   870
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   871
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   872
 *	kDSConfigTransport
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   873
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   874
 *	Send: (if type == TRK_TRANSPORT_TYPE_ETHERNET)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   875
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   876
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   877
 *		ui32	general options		- (4) reserved (set to 0)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   878
 *		ui32	type				- (4) TRK_TRANSPORT_TYPE_ETHERNET (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   879
 *		ui32	channel#			- (4) reserved (set to 0)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   880
 *		ui32	ethernet options	- (4) reserved (set to 0)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   881
 *		ui32	address				- (4) IP address of TRK
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   882
 *		ui32	port				- (4) port used by TRK
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   883
 *		ui32	gateway				- (4) gateway IP address (0 if none)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   884
 *		ui32	subnet mask			- (4) IP subnet mask (0 if none)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   885
 *									  <header + 32> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   886
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   887
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   888
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   889
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   890
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   891
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   892
 *	Sent by the host, configures a transport channel on the target with 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   893
 *	appropriate parameters.  The first 3 fields should be common to all
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   894
 *	transport types.  The number and format of any remaining fields 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   895
 *	depend on the value of the "type" field.  Currently only ethernet
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   896
 *	channels can be configured in this way.  Also, since the bare-board
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   897
 *	TRK TCP/IP stack only supports a single hardware ethernet channel, the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   898
 *	"channel#" field should be set to 0 for now.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   899
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   900
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   901
/* values to be used in the "type" field */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   902
#define TRK_MSG_TRANSPORT_TYPE_ETHERNET		0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   903
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   904
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   905
/* common segment of message */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   906
#define TRK_MSG_CT_HEADER_COUNT			(3 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   907
DESCDECL TrkMsgDesc gTrkMsgConfigTransport
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   908
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   909
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   910
	__debug_only_parm( "Config Transport" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   911
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   912
	12,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   913
	3,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   914
	{											/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   915
		__trk_msg_field( "general options", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   916
		__trk_msg_field( "type", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   917
		__trk_msg_field( "channel#", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   918
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   919
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   920
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   921
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   922
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   923
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   924
#define TRK_MSG_CT_GENOPT_INDEX				(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   925
#define TRK_MSG_CT_TYPE_INDEX				(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   926
#define TRK_MSG_CT_CHANNEL_INDEX			(2 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   927
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   928
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   929
/* ethernet-specific segment of message */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   930
DESCDECL TrkMsgDesc gTrkMsgConfigTransportEthernet
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   931
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   932
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   933
	__debug_only_parm( "Config Transport (Ethernet)" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   934
	&gTrkMsgConfigTransport,					/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   935
	20,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   936
	5,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   937
	{											/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   938
		__trk_msg_field( "ethernet options", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   939
		__trk_msg_field( "address", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   940
		__trk_msg_field( "port", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   941
		__trk_msg_field( "gateway", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   942
		__trk_msg_field( "netmask", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   943
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   944
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   945
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   946
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   947
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   948
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   949
#define TRK_MSG_CTE_ETHOPT_INDEX			(0 + TRK_MSG_CT_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   950
#define TRK_MSG_CTE_ADDRESS_INDEX			(1 + TRK_MSG_CT_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   951
#define TRK_MSG_CTE_PORT_INDEX				(2 + TRK_MSG_CT_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   952
#define TRK_MSG_CTE_GATEWAY_INDEX			(3 + TRK_MSG_CT_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   953
#define TRK_MSG_CTE_NETMASK_INDEX			(4 + TRK_MSG_CT_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   954
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   955
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   956
#pragma mark  Versions2
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   957
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   958
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   959
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   960
 *	kDSVersions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   961
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   962
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   963
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   964
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   965
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   966
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   967
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   968
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   969
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   970
 *		ui8		kernelMajor			- (1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   971
 *		ui8		kernelMinor			- (1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   972
 *		ui8		protocolMajor		- (1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   973
 *		ui8		protocolMinor		- (1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   974
 *									  <4 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   975
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   976
 *	Sent by the host, returns TRK version numbers.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   977
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   978
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   979
#define DS_MIN_MSG_VERSIONS2_LENGTH			DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   980
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   981
DESCDECL TrkMsgDesc gTrkMsgVersions2Reply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   982
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   983
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   984
	__debug_only_parm( "Versions2 Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   985
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   986
	5,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   987
	5,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   988
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   989
		__trk_msg_field( "kernel major", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   990
		__trk_msg_field( "kernel minor", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   991
		__trk_msg_field( "protocol major", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   992
		__trk_msg_field( "protocol minor", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   993
		__trk_msg_field( "build number", 1 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   994
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   995
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   996
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   997
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   998
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   999
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1000
#define TRK_MSG_VR2_KMAJOR_INDEX		(0 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1001
#define TRK_MSG_VR2_KMINOR_INDEX		(1 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1002
#define TRK_MSG_VR2_PMAJOR_INDEX		(2 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1003
#define TRK_MSG_VR2_PMINOR_INDEX		(3 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1004
#define TRK_MSG_VR2_BUILDNUM_INDEX		(4 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1005
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1006
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1007
#pragma mark  ReadMemory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1008
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1009
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1010
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1011
 *	kDSReadMemory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1012
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1013
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1014
 *			 (header.options & DS_MSG_MEMORYEXTENDED) == 0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1015
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1016
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1017
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1018
 *		ui16	length				- (2) memory data length
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1019
 *		ui32	start				- (4) memory start address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1020
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1021
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1022
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1023
 *			 (header.options & DS_MSG_MEMORYEXTENDED) != 0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1024
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1025
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1026
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1027
 *		ui16	length				- (2) memory data length
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1028
 *		ui32	startHigh			- (4) memory start high-order address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1029
 *		ui32	startLow			- (4) memory start low-order address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1030
 *									  <12> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1031
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1032
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1033
 *			 (header.options & DS_MSG_MEMORYEXTENDED) == 0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1034
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1035
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1036
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1037
 *		ui16	length				- (2) memory data length
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1038
 *		ui32	start				- (4) memory start address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1039
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1040
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1041
 *									  <16> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1042
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1043
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1044
 *			 (header.options & DS_MSG_MEMORYEXTENDED) != 0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1045
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1046
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1047
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1048
 *		ui16	length				- (2) memory data length
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1049
 *		ui32	startHigh			- (4) memory start high-order address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1050
 *		ui32	startLow			- (4) memory start low-order address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1051
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1052
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1053
 *									  <20> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1054
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1055
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1056
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1057
 *		ui8		command				- (1) ack/nak MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1058
 *		ui8		error				- (1) CWDS error value
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1059
 *		ui16	length				- (2) amount that was read
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1060
 *		ui8		data[]				- (0 to 2048) data
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1061
 *									  <4 + length> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1062
 *		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1063
 *	Sent by the host, returns the requested memory contents.  The TRK
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1064
 *	will attempt to catch and handle any memory access exceptions that
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1065
 *	occur during this operation.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1066
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1067
 *	This command can only be used on a stopped system (protocol level 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1068
 *	or stopped thread (protocol level 3).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1069
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1070
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1071
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1072
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1073
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1074
	#define DS_MIN_MSG_READMEMORY_LENGTH		(DS_MIN_MSG_LENGTH + 15)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1075
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1076
	#define DS_MIN_MSG_READMEMORY_LENGTH		(DS_MIN_MSG_LENGTH + 7)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1077
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1078
#define DS_MIN_REPLY_READMEMORY_LENGTH		(DS_MIN_REPLY_LENGTH + 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1079
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1080
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1081
#pragma mark  WriteMemory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1082
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1083
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1084
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1085
 *	kDSWriteMemory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1086
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1087
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1088
 *			 (header.options & DS_MSG_MEMORYEXTENDED) == 0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1089
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1090
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1091
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1092
 *		ui16	length				- (2) memory data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1093
 *		ui32	start				- (4) memory start address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1094
 *		ui8		data[]				- (0 to 2048) data
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1095
 *									  <8 + length> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1096
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1097
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1098
 *			 (header.options & DS_MSG_MEMORYEXTENDED) != 0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1099
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1100
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1101
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1102
 *		ui16	length				- (2) memory data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1103
 *		ui32	startHigh			- (4) memory start high-order address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1104
 *		ui32	startLow			- (4) memory start low-order address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1105
 *		ui8		data[]				- (0 to 2048) data
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1106
 *									  <12 + length> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1107
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1108
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1109
 *			 (header.options & DS_MSG_MEMORYEXTENDED) == 0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1110
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1111
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1112
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1113
 *		ui16	length				- (2) memory data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1114
 *		ui32	start				- (4) memory start address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1115
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1116
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1117
 *		ui8		data[]				- (0 to 2048) data
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1118
 *									  <16 + length> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1119
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1120
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1121
 *			 (header.options & DS_MSG_MEMORYEXTENDED) != 0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1122
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1123
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1124
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1125
 *		ui16	length				- (2) memory data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1126
 *		ui32	startHigh			- (4) memory start high-order address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1127
 *		ui32	startLow			- (4) memory start low-order address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1128
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1129
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1130
 *		ui8		data[]				- (0 to 2048) data
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1131
 *									  <20 + length> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1132
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1133
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1134
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1135
 *		ui8		command				- (1) ack/nak MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1136
 *		ui8		error				- (1) CWDS error value
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1137
 *		ui16	length				- (2) amount that was written in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1138
 *									  <4> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1139
 *		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1140
 *	Sent by the host, writes the specified values to target memory  The TRK
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1141
 *	will attempt to catch and handle any memory access exceptions that
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1142
 *	occur during this operation.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1143
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1144
 *	This command can only be used on a stopped system (protocol level 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1145
 *	or stopped thread (protocol level 3).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1146
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1147
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1148
 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1149
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1150
	#define DS_MIN_MSG_WRITEMEMORY_LENGTH		(DS_MIN_MSG_LENGTH + 15)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1151
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1152
	#define DS_MIN_MSG_WRITEMEMORY_LENGTH		(DS_MIN_MSG_LENGTH + 7)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1153
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1154
#define DS_MIN_REPLY_WRITEMEMORY_LENGTH		(DS_MIN_REPLY_LENGTH + 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1155
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1156
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1157
#pragma mark  FillMemory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1158
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1159
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1160
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1161
 *	kDSFillMemory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1162
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1163
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1164
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1165
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1166
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1167
 *		ui8		fillValue			- (1) value with which to fill memory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1168
 *		ui32	length				- (4) data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1169
 *		ui32	start				- (4) memory start address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1170
 *									  <11> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1171
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1172
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1173
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1174
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1175
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1176
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1177
 *		ui8		fillValue			- (1) value with which to fill memory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1178
 *		ui32	length				- (4) data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1179
 *		ui32	start				- (4) memory start address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1180
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1181
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1182
 *									  <19> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1183
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1184
 *	Reply - Basic Reply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1185
 *		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1186
 *	Sent by the host, fills the specified memory range with the given
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1187
 *	fillValue.  The TRK	will attempt to catch and handle any memory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1188
 *	access exceptions that occur during this operation.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1189
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1190
 *	This command can only be used on a stopped system (protocol level 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1191
 *	or stopped thread (protocol level 3).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1192
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1193
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1194
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1195
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1196
	#define DS_MIN_MSG_FILLMEMORY_LENGTH		(DS_MIN_MSG_LENGTH + 18)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1197
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1198
	#define DS_MIN_MSG_FILLMEMORY_LENGTH		(DS_MIN_MSG_LENGTH + 10)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1199
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1200
#define DS_MIN_REPLY_FILLMEMORY_LENGTH		(DS_MIN_REPLY_LENGTH)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1201
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1202
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1203
#pragma mark  CopyMemory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1204
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1205
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1206
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1207
 *	kDSCopyMemory
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1208
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1209
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1210
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1211
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1212
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1213
 *		ui32	length				- (4) data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1214
 *		ui32	source				- (4) source memory start address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1215
 *		ui32	destination			- (4) destination memory start address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1216
 *									  <14> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1217
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1218
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1219
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1220
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1221
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1222
 *		ui8		options				- (1) One of DS_MSG_MEMORY_* below
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1223
 *		ui32	length				- (4) data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1224
 *		ui32	source				- (4) source memory start address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1225
 *		ui32	destination			- (4) destination memory start address
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1226
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1227
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1228
 *									  <22> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1229
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1230
 *	Reply - Basic Reply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1231
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1232
 *	Sent by the host, copies a block of memory with the specified
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1233
 *	size from the source address to the destination address.  This
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1234
 *	operation will function correctly even if the source and
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1235
 *	destination memory ranges overlap.  The TRK	will attempt to
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1236
 *	catch and handle any memory access exceptions that occur during
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1237
 *	this operation.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1238
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1239
 *	This command can only be used on a stopped system (protocol level 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1240
 *	or stopped thread (protocol level 3).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1241
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1242
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1243
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1244
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1245
	#define DS_MIN_MSG_COPYMEMORY_LENGTH		(DS_MIN_MSG_LENGTH + 21)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1246
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1247
	#define DS_MIN_MSG_COPYMEMORY_LENGTH		(DS_MIN_MSG_LENGTH + 13)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1248
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1249
#define DS_MIN_REPLY_COPYMEMORY_LENGTH		(DS_MIN_REPLY_LENGTH)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1250
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1251
											/* option flags in DSMessage.options */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1252
#define DS_MSG_MEMORY_SEGMENTED	0x01		/* non-flat addr space */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1253
#define DS_MSG_MEMORY_EXTENDED	0x02		/* > 32-bit data addr */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1254
#define DS_MSG_MEMORY_PROTECTED	0x04		/* non-user memory */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1255
#define DS_MSG_MEMORY_USERVIEW	0x08		/* breakpoints are invisible */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1256
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1257
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1258
** The desired memory space can be specified using one of
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1259
** the following options.  It can be logically OR'ed with
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1260
** the flags defined above.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1261
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1262
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1263
#define DS_MSG_MEMORY_SPACE_PROGRAM	0x00
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1264
#define DS_MSG_MEMORY_SPACE_DATA	0x40
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1265
#define DS_MSG_MEMORY_SPACE_IO		0x80
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1266
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1267
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1268
** Use this mask to extract the memory space specifier
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1269
** from the options field.  The specifier occupies the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1270
** 2 most significant bits.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1271
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1272
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1273
#define DS_MSG_MEMORY_SPACE_MASK	0xc0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1274
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1275
#define DS_MAXREADWRITELENGTH	0x0800	/* 2K data portion */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1276
#define DS_MAXMESSAGESIZE (DS_MAXREADWRITELENGTH + 0x80)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1277
											/* max size of all message including cmd hdr */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1278
#define MAXMESSAGESIZE	DS_MAXMESSAGESIZE
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1279
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1280
#define DS_MAXREADWRITELENGTH_V2	0x0716	/* for some comms API, packet len needs bet less 2K */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1281
#define DS_MAXMESSAGESIZE_V2 (DS_MAXREADWRITELENGTH_V2 + 0x80)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1282
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1283
// With USB connection, transferring big chunks of data seems to be cause problems.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1284
// So reduce the size of each data transfer by almost half.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1285
#define DS_MAXFILEWRITELENGTH 0x0400 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1286
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1287
#define MAXMESSAGESIZE_V2	DS_MAXMESSAGESIZE_V2
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1288
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1289
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1290
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1291
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1292
#pragma mark  FlushCache
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1293
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1294
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1295
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1296
 *	kDSFlushCache
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1297
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1298
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1299
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1300
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1301
 *		ui8		options				- (1) DS_MSG_CACHE_* (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1302
 *		ui32	start				- (4) start of mem region for which to clear cache
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1303
 *		ui32	end					- (4) end of mem region for which to clear cache
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1304
 *									  <10> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1305
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1306
 *	Reply - Basic Reply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1307
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1308
 *	Sent by the host, flushes all cache entries corresponding to the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1309
 *	given memory range, at least.  Additional cache entries may
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1310
 *	be flushed as well, depending on the target implementation.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1311
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1312
 *	This command can only be used on a stopped system.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1313
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1314
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1315
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1316
#define DS_MIN_MSG_FLUSHCACHE_LENGTH	(DS_MIN_MSG_LENGTH + 9)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1317
#define DS_MIN_REPLY_FLUSHCACHE_LENGTH	(DS_MIN_REPLY_LENGTH)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1318
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1319
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1320
** The following values may be logically OR'ed together in the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1321
** options field of the kDSFlushCache command to specify
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1322
** the cache types to be flushed.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1323
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1324
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1325
#define DS_MSG_CACHE_TYPE_INSTRUCTION	0x01
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1326
#define DS_MSG_CACHE_TYPE_DATA			0x02
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1327
#define DS_MSG_CACHE_TYPE_SECONDARY		0x04
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1328
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1329
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1330
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1331
#pragma mark  ReadRegisters
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1332
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1333
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1334
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1335
 *	kDSReadRegisters
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1336
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1337
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1338
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1339
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1340
 *		ui8		options				- (1) DSMessageRegisterOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1341
 *		ui16	firstRegister		- (2) first register ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1342
 *		ui16	lastRegister		- (2) last register ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1343
 *									  <6>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1344
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1345
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1346
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1347
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1348
 *		ui8		options				- (1) DSMessageRegisterOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1349
 *		ui16	firstRegister		- (2) first register ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1350
 *		ui16	lastRegister		- (2) last register ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1351
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1352
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1353
 *									  <14>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1354
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1355
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1356
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1357
 *		ui8		command				- (1) ack/nak MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1358
 *		ui8		error				- (1) CWDS error value
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1359
 *				register data		- (0-2048) 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1360
 *									  <2 + register data>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1361
 *       
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1362
 *	Sent by the host, reads the requested register contents.  The TRK
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1363
 *	will attempt to catch and handle any access exceptions that
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1364
 *	occur during this operation.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1365
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1366
 *	This command can only be used on a stopped system (protocol level 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1367
 *	or stopped thread (protocol level 3).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1368
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1369
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1370
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1371
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1372
	#define DS_MIN_MSG_READREGISTERS_LENGTH		(DS_MIN_MSG_LENGTH + 13)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1373
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1374
	#define DS_MIN_MSG_READREGISTERS_LENGTH		(DS_MIN_MSG_LENGTH + 5)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1375
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1376
#define DS_MIN_REPLY_READREGISTERS_LENGTH	DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1377
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1378
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1379
#pragma mark  WriteRegisters
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1380
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1381
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1382
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1383
 *	kDSWriteRegisters
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1384
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1385
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1386
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1387
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1388
 *		ui8		options				- (1) DSMessageRegisterOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1389
 *		ui16	firstRegister		- (2) first register ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1390
 *		ui16	lastRegister		- (2) last register ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1391
 *				register data		- (0-2048) 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1392
 *									  <6 + register data>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1393
 * 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1394
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1395
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1396
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1397
 *		ui8		options				- (1) DSMessageRegisterOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1398
 *		ui16	firstRegister		- (2) first register ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1399
 *		ui16	lastRegister		- (2) last register ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1400
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1401
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1402
 *				register data		- (0-2048) 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1403
 *									  <14 + register data>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1404
 * 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1405
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1406
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1407
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1408
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1409
 *       
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1410
 *	Sent by the host, writes the specified values to target registers.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1411
 *	The TRK will attempt to catch and handle any access exceptions that
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1412
 *	occur during this operation.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1413
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1414
 *	This command can only be used on a stopped system (protocol level 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1415
 *	or stopped thread (protocol level 3).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1416
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1417
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1418
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1419
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1420
	#define DS_MIN_MSG_WRITEREGISTERS_LENGTH	(DS_MIN_MSG_LENGTH + 13)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1421
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1422
	#define DS_MIN_MSG_WRITEREGISTERS_LENGTH	(DS_MIN_MSG_LENGTH + 5)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1423
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1424
#define DS_MIN_REPLY_WRITEREGISTERS_LENGTH	DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1425
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1426
											/* option flags for reading registers */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1427
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1428
#define DS_MSG_REGISTERS_TYPE_MASK	0x07	/* "register type" mask */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1429
#define DS_MSG_REGISTERS_TYPE_SHIFT	0		/* # bits to shift mask from lsb. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1430
#define DS_MSG_REGISTERS_TYPE(_x_)	((_x_ & DS_MSG_REGISTERS_TYPE_MASK) << DS_MSG_REGISTERS_TYPE_SHIFT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1431
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1432
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1433
 *	kDSReadRegisters & kDSWriteRegister options
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1434
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1435
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1436
typedef enum DSMessageRegisterOptions {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1437
	kDSRegistersDefault = 0x0,			/* Default register block */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1438
	kDSRegistersFP = 0x1,				/* floating point registers */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1439
	kDSRegistersExtended1 = 0x2,		/* Extended register set 1 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1440
	kDSRegistersExtended2 = 0x3			/* Extended register set 2 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1441
} DSMessageRegisterOptions;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1442
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1443
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1444
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1445
#pragma mark  Continue
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1446
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1447
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1448
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1449
 *	kDSContinue
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1450
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1451
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1452
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1453
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1454
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1455
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1456
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1457
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1458
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1459
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1460
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1461
 *									  <header + 8> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1462
 * 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1463
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1464
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1465
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1466
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1467
 *       
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1468
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1469
 *	Sent by the host.  Begins execution on the target at the current PC.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1470
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1471
 *	Replies with an ACK before execution starts.  Once execution begins,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1472
 *	most commands which access that process or thread will not be
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1473
 *	accepted.  For DS_PROTOCOL values of 1 or 2, this means that it
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1474
 *	will not respond to any of the state or execution commands 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1475
 *	except kDSStop.  It will respond to meta-commands.  For
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1476
 *	a DS_PROTOCOL value of 3, it will not accept any commands
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1477
 *	specifying that process or thread except kDSStop or 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1478
 *	kDSOSDeleteItem.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1479
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1480
 *	The host should wait for a NotifyStopped or NotifyException command
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1481
 *	and reply with a corresponding ACK.  Once that process and thread
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1482
 *	have stopped again, MetroTRK will once again accept other commands
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1483
 *	which access them.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1484
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1485
 *	This command can only be used on a stopped system (protocol level 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1486
 *	or stopped thread (protocol level 3).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1487
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1488
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1489
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1490
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1491
	#define DS_MIN_MSG_CONTINUE_LENGTH			(DS_MIN_MSG_LENGTH + 8)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1492
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1493
	#define DS_MIN_MSG_CONTINUE_LENGTH			DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1494
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1495
#define DS_MIN_REPLY_CONTINUE_LENGTH		DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1496
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1497
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1498
#pragma mark  Step
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1499
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1500
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1501
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1502
 *	kDSStep
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1503
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1504
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1505
 *			 (options == kDSStepIntoCount || options == kDSStepOverCount)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1506
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1507
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1508
 *		ui8		options				- (1) DSMessageStepOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1509
 *		ui8		count				- (1) # of instructions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1510
 *									  <3>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1511
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1512
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1513
 *			 (options == kDSStepIntoCount || options == kDSStepOverCount)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1514
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1515
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1516
 *		ui8		options				- (1) DSMessageStepOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1517
 *		ui8		count				- (1) # of instructions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1518
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1519
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1520
 *									  <11>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1521
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1522
 *	Sent by the host.  Steps over the specified number of instructions.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1523
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1524
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1525
 *			 (options == kDSStepIntoRange || options == kDSStepOverRange)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1526
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1527
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1528
 *		ui8		options				- (1) DSMessageStepOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1529
 *		ui32	rangeStart			- (4) Start address of memory range
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1530
 *		ui32	rangeEnd			- (4) End address of memory range
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1531
 *									  <10>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1532
 * 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1533
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1534
 *			 (options == kDSStepIntoRange || options == kDSStepOverRange)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1535
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1536
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1537
 *		ui8		options				- (1) DSMessageStepOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1538
 *		ui32	rangeStart			- (4) Start address of memory range
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1539
 *		ui32	rangeEnd			- (4) End address of memory range
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1540
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1541
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1542
 *									  <18>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1543
 * 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1544
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1545
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1546
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1547
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1548
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1549
 *	Sent by the host.  Steps until the PC is outside of the specified
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1550
 *	range.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1551
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1552
 *	Replies with an ACK before execution starts.  Once execution begins,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1553
 *	most commands which access that process or thread will not be
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1554
 *	accepted.  For DS_PROTOCOL values of 1 or 2, this means that it
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1555
 *	will not respond to any of the state or execution commands 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1556
 *	except kDSStop.  It will respond to meta-commands.  For
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1557
 *	a DS_PROTOCOL value of 3, it will not accept any commands
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1558
 *	specifying that process or thread except kDSStop or 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1559
 *	kDSOSDeleteItem.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1560
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1561
 *	The host should wait for a NotifyStopped or NotifyException command
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1562
 *	and reply with a corresponding ACK.  Once that process and thread
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1563
 *	have stopped again, MetroTRK will once again accept other commands
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1564
 *	which access them.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1565
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1566
 *	This command can only be used on a stopped system (protocol level 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1567
 *	or stopped thread (protocol level 3).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1568
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1569
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1570
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1571
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1572
	#define DS_MIN_MSG_STEP_COUNT_LENGTH	(DS_MIN_MSG_LENGTH + 10)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1573
	#define DS_MIN_MSG_STEP_RANGE_LENGTH	(DS_MIN_MSG_LENGTH + 17)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1574
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1575
	#define DS_MIN_MSG_STEP_COUNT_LENGTH	(DS_MIN_MSG_LENGTH + 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1576
	#define DS_MIN_MSG_STEP_RANGE_LENGTH	(DS_MIN_MSG_LENGTH + 9)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1577
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1578
#define DS_MIN_MSG_STEP_LENGTH			(DS_MIN_MSG_STEP_COUNT_LENGTH)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1579
#define DS_MIN_REPLY_STEP_LENGTH		DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1580
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1581
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1582
** The following option values are predefined.  Desired
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1583
** target-specific options can be added to the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1584
** DSTargMessageStepOptions enum (see msgtarg.h).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1585
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1586
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1587
typedef enum {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1588
	kDSStepIntoCount = 0x00,			/* Exec count instructions & stop */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1589
	kDSStepIntoRange = 0x01,			/* Exec until PC is out of specified range */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1590
	kDSStepOverCount = 0x10,			/* Step over 1*count instructions & stop */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1591
	kDSStepOverRange = 0x11				/* Step over until PC is out of specified range */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1592
} DSMessageStepOptions;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1593
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1594
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1595
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1596
#pragma mark  Stop
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1597
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1598
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1599
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1600
 *	kDSStop
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1601
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1602
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1603
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1604
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1605
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1606
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1607
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1608
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1609
 *			 (options == kDSStopSystem)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1610
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1611
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1612
 *		ui8		options				- (1) DSMessageStopOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1613
 *									  <2>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1614
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1615
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1616
 *			 (options == kDSStopProcess)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1617
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1618
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1619
 *		ui8		options				- (1) DSMessageStopOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1620
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1621
 *									  <6>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1622
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1623
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS &&
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1624
 *			 (options == kDSStopThread)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1625
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1626
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1627
 *		ui8		options				- (1) DSMessageStopOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1628
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1629
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1630
 *									  <10>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1631
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1632
 *	Sent by the host.  Forces the target system/process/thread to stop.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1633
 *  Replies	with an ACK.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1634
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1635
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1636
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1637
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1638
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1639
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1640
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1641
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1642
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1643
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1644
	#define DS_MIN_MSG_STOP_LENGTH			(DS_MIN_MSG_LENGTH + 3)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1645
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1646
	#define DS_MIN_MSG_STOP_LENGTH			(DS_MIN_MSG_LENGTH + 2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1647
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1648
#define DS_MIN_REPLY_STOP_LENGTH		DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1649
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1650
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1651
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1652
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1653
** The following option values are predefined.  Desired
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1654
** target-specific options can be added to the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1655
** DSTargMessageStopOptions enum (see msgtarg.h).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1656
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1657
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1658
typedef enum {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1659
	kDSStopSystem	= 0x0,		/* Stop the entire system */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1660
	kDSStopProcess	= 0x1,		/* Stop all threads in a specific process */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1661
	kDSStopThread	= 0x2		/* Stop a specific thread in a specific process */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1662
} DSMessageStopOptions;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1663
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1664
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1665
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1666
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1667
#pragma mark  SetBreak
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1668
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1669
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1670
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1671
 *	kDSSetBreak
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1672
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1673
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1674
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1675
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1676
 *		ui8		options				- (1) DSMessageBreakOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1677
 *		ui8		targetOptions		- (1) target-defined
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1678
 *		ui32	address				- (4) Start of breakpoint memory range
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1679
 *		ui32	length				- (4) Length of breakpoint memory range
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1680
 *		ui32	count				- (4) Only stop after triggered this many times (currently not used, set to 0)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1681
 *									  <14 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1682
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1683
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1684
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1685
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1686
 *		ui8		options				- (1) DSMessageBreakOptions
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1687
 *		ui8		targetOptions		- (1) target-defined
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1688
 *		ui32	address				- (4) Start of breakpoint memory range
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1689
 *		ui32	length				- (4) Length of breakpoint memory range
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1690
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1691
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1692
 *		ui32	count				- (4) Only stop after triggered this many times (currently not used, set to 0)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1693
 *									  <22 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1694
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1695
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1696
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1697
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1698
 *		ui32	id					- (4) ID of the new breakpoint
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1699
 *									  <4 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1700
 *	Sent by the host.  Sets a breakpoint at the specified location.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1701
 *	Replies with an ACK.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1702
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1703
 *  For software execution breakpoints, the length field should be 1.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1704
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1705
 *	Note: This command should not be implemented unless there is a
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1706
 *	compelling reason to do so.  In most cases, both software and
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1707
 *	hardware breakpoints can be implemented via memory and register reads
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1708
 *	and writes.  
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1709
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1710
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1711
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1712
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1713
#define TRK_MSG_REPLY_HEADER_LENGTH	(1 + TRK_MSG_HEADER_LENGTH)	/* 1 addl bytes  */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1714
#define TRK_MSG_REPLY_HEADER_COUNT	(1 + TRK_MSG_HEADER_COUNT)	/* 1 addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1715
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1716
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1717
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1718
	DESCDECL TrkMsgDesc gTrkMsgSetBreak
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1719
	#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1720
	= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1721
		__debug_only_parm( "Set Breakpoint" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1722
		&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1723
		22,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1724
		7,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1725
		{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1726
			__trk_msg_field( "options", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1727
			__trk_msg_field( "target options", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1728
			__trk_msg_field( "address", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1729
			__trk_msg_field( "length", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1730
			__trk_msg_field( "count", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1731
			__trk_msg_field( "process ID", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1732
			__trk_msg_field( "thread ID", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1733
		}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1734
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1735
	#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1736
	;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1737
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1738
#else /* #if DS_PROTOCOL == DS_PROTOCOL_RTOS */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1739
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1740
	DESCDECL TrkMsgDesc gTrkMsgSetBreak
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1741
	#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1742
	= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1743
		__debug_only_parm( "Set Breakpoint" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1744
		&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1745
		14,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1746
		5,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1747
		{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1748
			__trk_msg_field( "options", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1749
			__trk_msg_field( "target options", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1750
			__trk_msg_field( "address", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1751
			__trk_msg_field( "length", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1752
			__trk_msg_field( "count", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1753
		}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1754
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1755
	#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1756
	;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1757
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1758
#endif /* #if DS_PROTOCOL == DS_PROTOCOL_RTOS */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1759
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1760
/* field indices */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1761
#define TRK_MSG_SETBREAK_OPTIONS_INDEX	(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1762
#define TRK_MSG_SETBREAK_TOPTIONS_INDEX	(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1763
#define TRK_MSG_SETBREAK_ADDRESS_INDEX	(2 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1764
#define TRK_MSG_SETBREAK_LENGTH_INDEX	(3 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1765
#define TRK_MSG_SETBREAK_COUNT_INDEX	(4 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1766
#define TRK_MSG_SETBREAK_PID_INDEX		(5 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1767
#define TRK_MSG_SETBREAK_TID_INDEX		(6 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1768
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1769
DESCDECL TrkMsgDesc gTrkMsgSetBreakReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1770
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1771
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1772
	__debug_only_parm( "Set Breakpoint Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1773
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1774
	4,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1775
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1776
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1777
		__trk_msg_field( "breakpoint ID", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1778
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1779
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1780
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1781
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1782
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1783
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1784
#define TRK_MSG_SETBREAKREPLY_BID_INDEX	(0 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1785
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1786
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1787
#pragma mark  ClearBreak
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1788
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1789
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1790
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1791
 *	kDSClearBreak
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1792
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1793
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1794
 *		ui32	id					- (4) ID of the breakpoint to clear
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1795
 *									  <4 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1796
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1797
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1798
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1799
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1800
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1801
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1802
 *	Sent by the host.  Clears the specified breakpoint.  If the specified
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1803
 *	id is DS_MSG_BREAK_ID_ALL, clears all breakpoints.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1804
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1805
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1806
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1807
DESCDECL TrkMsgDesc gTrkMsgClearBreak
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1808
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1809
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1810
	__debug_only_parm( "Clear Breakpoint" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1811
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1812
	8,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1813
	2,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1814
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1815
		__trk_msg_field( "breakpoint ID", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1816
		__trk_msg_field( "breakpoint Address", 4)	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1817
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1818
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1819
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1820
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1821
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1822
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1823
#define TRK_MSG_CLEARBREAK_BID_INDEX	(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1824
#define TRK_MSG_CLEARBREAK_BADDR_INDEX	(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1825
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1826
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1827
** The following values should be logically OR'ed with one
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1828
** of the DSMessageBreakOptions values to specify the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1829
** type of access which will cause the target program to
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1830
** stop.  More than one stop type can be specified.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1831
** the kDSSetBreak command will fail if one of the specified
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1832
** conditions is not supported on the target, but there is
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1833
** one exception:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1834
**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1835
** NOTE: If both the write and modify conditions are
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1836
** specified, the kDSSetBreak command will succeed if
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1837
** one of the two is supported.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1838
** 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1839
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1840
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1841
#define DS_MSG_BREAK_CONDITION_READ		0x10	/* stop on read access */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1842
#define DS_MSG_BREAK_CONDITION_WRITE	0x20	/* stop on write access */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1843
#define DS_MSG_BREAK_CONDITION_MODIFY	0x40	/* stop on modify access */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1844
#define DS_MSG_BREAK_CONDITION_EXECUTE	0x80	/* stop on execution */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1845
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1846
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1847
** Use the following mask to extract the breakpoint condition flags
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1848
** from the options.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1849
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1850
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1851
#define DS_MSG_BREAK_CONDITION_MASK		0xf0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1852
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1853
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1854
** The following option values are predefined.  Desired
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1855
** target-specific options can be added to the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1856
** DSTargMessageBreakOptions enum (see msgtarg.h).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1857
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1858
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1859
typedef enum {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1860
	kDSBreakSoftware	= 0x00,		/* Set a software breakpoint */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1861
	kDSBreakHardware	= 0x01,		/* Set a hardware breakpoint */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1862
	kDSBreakAuto		= 0x02		/* Set a SW BP if possible, otherwise HW */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1863
} DSMessageBreakOptions;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1864
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1865
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1866
** If the following is provided as the breakpoint ID in the kDSClearBreak
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1867
** command, all breakpoints will be cleared.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1868
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1869
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1870
#define DS_MSG_BREAK_ID_ALL				0xffffffff
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1871
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1872
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1873
** If the following is provided as the thread ID in the kDSSetBreak
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1874
** command, the operation will apply to all threads in the process.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1875
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1876
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1877
#define DS_MSG_BREAK_THREAD_ID_ALL		0xffffffff
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1878
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1879
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1880
#pragma mark  ModifyBreakThread
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1881
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1882
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1883
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1884
 *	kDSModifyBreakThread
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1885
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1886
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1887
 *		ui32	id					- (4) ID of the breakpoint to modify
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1888
 *		ui32	threadID			- (4) new thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1889
 *									  <8 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1890
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1891
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1892
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1893
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1894
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1895
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1896
 *	Sent by the host.  Associates an existing breakpoint with the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1897
 *	specified thread.  The thread ID can be for a specific thread or
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1898
 *	it can be DS_MSG_BREAK_THREAD_ID_ALL.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1899
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1900
 *	This command is only valid if DS_PROTOCOL == DS_PROTOCOL_RTOS.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1901
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1902
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1903
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1904
DESCDECL TrkMsgDesc gTrkMsgModifyBreakThread
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1905
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1906
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1907
	__debug_only_parm( "Modify Breakpoint Thread" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1908
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1909
	8,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1910
	2,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1911
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1912
		__trk_msg_field( "breakpoint ID", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1913
		__trk_msg_field( "thread ID", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1914
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1915
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1916
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1917
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1918
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1919
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1920
#define TRK_MSG_MBT_BID_INDEX		(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1921
#define TRK_MSG_MBT_TID_INDEX		(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1922
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1923
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1924
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1925
#pragma mark  Download
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1926
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1927
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1928
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1929
 *	kDSDownload
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1930
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1931
 *	Send: if (DSMessageDownloadOptions == kDSMessageDownloadTFTP)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1932
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1933
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1934
 *		ui8		options				- (1) DSMessageDownloadOptions (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1935
 *		ui32	IP address			- (4) IP address of the target system
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1936
 *		ui32	TFTP address		- (4) IP address of the TFTP server
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1937
 *		ui32	length				- (4) file size in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1938
 *		ui32	start address		- (4) load address of the file
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1939
 *		ui16	name_length			- (2) length of file name in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1940
 *		ui8[]	file name			  (0 - 2048) name of the file to download
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1941
 *									  <20 + name_length>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1942
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1943
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1944
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1945
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1946
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1947
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1948
 *	Sent by the host.  Downloads a file to the target system according
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1949
 *	to the specified parameters.  This command is intended to allow
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1950
 *	downloading via communication channels other than the TRK's command
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1951
 *	channel.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1952
 *	Replies with an ACK.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1953
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1954
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1955
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1956
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1957
#define DS_MIN_MSG_DOWNLOAD_LENGTH		(DS_MIN_MSG_LENGTH + 19)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1958
#define DS_MIN_REPLY_CLEARBREAK_LENGTH	DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1959
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1960
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1961
** The following option values are predefined.  Desired
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1962
** target-specific options can be added to the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1963
** DSTargMessageDownloadOptions enum (see msgtarg.h).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1964
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1965
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1966
typedef enum {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1967
	kDSMessageDownloadTFTP		= 0x0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1968
} DSMessageDownloadOptions;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1969
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1970
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1971
#pragma mark  NotifyStopped
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1972
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1973
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1974
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1975
 *	kDSNotifyStopped
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1976
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1977
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1978
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1979
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1980
 *				target-defined info (PC, instr @PC, exception word)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1981
 *									  <1 + target info> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1982
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1983
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1984
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1985
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1986
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1987
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1988
 *	Sent by the target.  This message will only be sent when the target
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1989
 *	is executing (after a kDSContinue or kDSStep command).  It indicates
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1990
 *	that the target stopped running.  On a bare-board system (no OS), this 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1991
 *	typically means the target stopped due to an exception.  The
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1992
 *  target-defind info should provide additional details about why
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1993
 *	the target stopped.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1994
 *	Expects an ACK in response.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1995
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1996
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1997
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1998
 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  1999
#define DS_MIN_MSG_NOTIFYSTOPPED_LENGTH		DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2000
#define DS_MIN_REPLY_NOTIFYSTOPPED_LENGTH	DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2001
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2002
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2003
#pragma mark  NotifyInternalError
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2004
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2005
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2006
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2007
 *	kDSNotifyInternalError
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2008
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2009
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2010
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2011
 *		ui8		command				- (1) MessageCommandID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2012
 *		ui8		error code			- (1) DSInternalError
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2013
 *									  <2> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2014
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2015
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2016
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2017
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2018
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2019
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2020
 *	Sent by the target.  It indicates that an internal error occurred
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2021
 *	in MetroTRK.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2022
 *	Expects an ACK in response.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2023
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2024
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2025
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2026
 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2027
#define DS_MIN_MSG_NOTIFYINTERNALERROR_LENGTH	(DS_MIN_MSG_LENGTH + 1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2028
#define DS_MIN_REPLY_NOTIFYINTERNALERROR_LENGTH	DS_MIN_REPLY_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2029
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2030
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2031
#pragma mark  OSNotifyCreated / OSNotifyDeleted
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2032
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2033
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2034
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2035
 *	kDSOSNotifyCreated / kDSOSNotifyDeleted
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2036
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2037
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2038
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2039
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2040
 *		ui16	itemType			- (2) DSOSItemTypes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2041
 *				target-defined info (e.g., process ID for kDSOSDLLItem)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2042
 *									  <2 + header + target info> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2043
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2044
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2045
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2046
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2047
 *				target-defined info (e.g., code & data offset for
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2048
 *									 kDSOSProcessItem)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2049
 *									  <header + target info> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2050
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2051
 *	Sent by the target.  This message indicates that an item of the 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2052
 *	given type has been created/deleted.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2053
 *	Expects an ACK in response.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2054
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2055
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2056
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2057
 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2058
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2059
#pragma mark  OSCreateItem / OSDeleteItem Header
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2060
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2061
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2062
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2063
 *	kDSOSCreateItem / kDSOSDeleteItem
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2064
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2065
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2066
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2067
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2068
 *		ui16	itemType			- (2) DSOSItemTypes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2069
 *				target-defined info (e.g., DLL name for kDSOSDLLItem)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2070
 *									  <2 + header + target info> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2071
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2072
 *	Reply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2073
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2074
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2075
 *				target-defined info (e.g., code & data offset for
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2076
 *									 kDSOSProcessItem)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2077
 *									  <header + target info> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2078
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2079
 *	Sent by the host.  Creates/deletes an item of the specified type in
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2080
 *	the system.  It allows the host to create/delete processes (load),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2081
 *	threads, DLL's, and any other system resources.  This command may
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2082
 *	either operate synchronously or asynchronously.  The behavior may be
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2083
 *	differ on an item-by-item basis.  The two scenarios:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2084
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2085
 *		synchronous: The host sends a OSCreateItem/OSDeleteItem command.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2086
 *			The target system creates the item and then replies with an
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2087
 *			ACK containing specific information about the 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2088
 *			created/deleted item.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2089
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2090
 *		asynchronous: The host sends a OSCreateItem/OSDeleteItem command.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2091
 *			The target system queues the request and replies with
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2092
 *			an ACK.  At some later time, when the item is
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2093
 *			actually created/deleted, the target system sends an
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2094
 *			OSNotifyCreated/OSNotifyDeleted message to the host
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2095
 *			containing specific information about the created/deleted
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2096
 *			item.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2097
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2098
 *	Expects an ACK in response.  The reply may contain specific
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2099
 *	information about the created/deleted item, such as code and data 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2100
 *	offsets for relocatable processes (if the operation is
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2101
 *	synchronous).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2102
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2103
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2104
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2105
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2106
#define TRK_MSG_ITEM_HEADER_LENGTH	(2 + TRK_MSG_HEADER_LENGTH)	/* 2 addl bytes  */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2107
#define TRK_MSG_ITEM_HEADER_COUNT	(1 + TRK_MSG_HEADER_COUNT)	/* 1 addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2108
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2109
DESCDECL TrkMsgDesc gTrkMsgItemHeader
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2110
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2111
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2112
	__debug_only_parm( "Item Header" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2113
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2114
	2,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2115
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2116
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2117
		__trk_msg_field( "item type", 2 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2118
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2119
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2120
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2121
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2122
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2123
#define TRK_MSG_ITEM_HEADER_TYPE_INDEX		(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2124
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2125
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2126
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2127
** The following option values are predefined.  Desired
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2128
** target-specific options can be added to the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2129
** DSTargOSItemTypes enum (see msgtarg.h).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2130
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2131
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2132
typedef enum {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2133
	kDSOSProcessItem	= 0x0000,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2134
	kDSOSThreadItem		= 0x0001,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2135
	kDSOSDLLItem		= 0x0002,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2136
	kDSOSAppItem		= 0x0003,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2137
	kDSOSMemBlockItem	= 0x0004,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2138
	kDSOSProcAttachItem	= 0x0005,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2139
	kDSOSThreadAttachItem = 0x0006,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2140
	kDSOSProcAttach2Item	= 0x0007,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2141
	kDSOSProcRunItem	= 0x0008,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2142
	kDSOSProcAttach3Item = 0x0009
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2143
	/* 0x0009 - 0x00ff reserved for general expansion */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2144
	/* 0x0100 - 0xffff available for target-specific use */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2145
} DSOSItemTypes;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2146
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2147
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2148
#pragma mark  OSReadInfo / OSWriteInfo Header
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2149
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2150
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2151
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2152
 *	kDSOSReadInfo / KDSOSWriteInfo (Common Header)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2153
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2154
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2155
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2156
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2157
 *		ui16	infoType			- (2) DSOSInfoTypes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2158
 *				target-defined info (e.g., process ID for
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2159
 *									 kDSOSProcessStateInfo)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2160
 *									  <2 + header + target info> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2161
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2162
 *	Reply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2163
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2164
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2165
 *				target-defined info (e.g., process state for
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2166
 *									 kDSOSProcessStateInfo)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2167
 *									  <header + target info> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2168
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2169
 *	Sent by the host.  Reads/writes the requested info from/to the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2170
 *	target system.  It allows the host to get/set information about the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2171
 *	internal system state.  For ReadInfo, there are additional fields
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2172
 *	specified in a secondary header (see below).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2173
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2174
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2175
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2176
 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2177
#define TRK_MSG_INFO_HEADER_LENGTH	(2 + TRK_MSG_HEADER_LENGTH)	/* 2 addl bytes  */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2178
#define TRK_MSG_INFO_HEADER_COUNT	(1 + TRK_MSG_HEADER_COUNT)	/* 1 addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2179
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2180
DESCDECL TrkMsgDesc gTrkMsgInfoHeader
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2181
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2182
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2183
	__debug_only_parm( "Info Header" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2184
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2185
	2,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2186
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2187
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2188
		__trk_msg_field( "info type", 2 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2189
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2190
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2191
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2192
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2193
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2194
#define TRK_MSG_INFO_HEADER_TYPE_INDEX		(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2195
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2196
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2197
** The following option values are predefined.  Desired
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2198
** target-specific options can be added to the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2199
** DSTargOSInfoTypes enum (see msgtarg.h).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2200
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2201
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2202
typedef enum {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2203
	kDSOSProcessList	= 0x0000,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2204
	kDSOSProcessState	= 0x0001,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2205
	kDSOSThreadList		= 0x0002,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2206
	kDSOSThreadState	= 0x0003,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2207
	kDSOSDLLList		= 0x0004,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2208
	kDSOSDLLState		= 0x0005,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2209
	kDSOSDLLInfo		= 0x0006,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2210
	kDSOSProcessInfo	= 0x0007,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2211
	/* 0x0008 - 0x00ff reserved for expansion */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2212
	/* 0x0100 - 0xffff available for target-specific use */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2213
} DSOSInfoTypes;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2214
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2215
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2216
#pragma mark  OSReadInfo Header
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2217
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2218
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2219
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2220
 *	kDSOSReadInfo (header)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2221
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2222
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2223
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2224
 *		....	<Info Header>	      ... (see gTrkMsgInfoHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2225
 *		ui32	startIndex			- (4) starting index of returned info
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2226
 *				target-defined info (e.g., process ID for
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2227
 *									 kDSOSProcessStateInfo)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2228
 *									  <4 + header + target info> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2229
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2230
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2231
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2232
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2233
 *		ui32	returnedCount		- (4) # of items in this reply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2234
 *		ui32	totalCount			- (4) total # of items in complete response
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2235
 *				target-defined info (e.g., process state for
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2236
 *									 kDSOSProcessStateInfo)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2237
 *									  <8 + header + target info> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2238
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2239
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2240
 *	This is the header to be used by all kDSReadInfo requests.  The
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2241
 *	complete info may not fit in a single MetroTRK message, so it is
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2242
 *	possible to read the info in segments.  When reading the info, the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2243
 *	startIndex should be 0 the first time.  If, in the reply,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2244
 *	totalCount > (startIndex + returnedCount), then the next segment of
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2245
 *	the info can be read by sending another request with the new
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2246
 *	startIndex set to the previous (startIndex + returnedCount).  
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2247
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2248
 *	startIndex, returnedCount, and totalCount all refer to the number of
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2249
 *	"items" (the definition of which depends on the info type), not 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2250
 *	necessarily the number of bytes.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2251
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2252
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2253
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2254
#define TRK_MSG_RI_HEADER_LENGTH	(4 + TRK_MSG_INFO_HEADER_LENGTH)	/* 4 addl bytes  */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2255
#define TRK_MSG_RI_HEADER_COUNT		(1 + TRK_MSG_INFO_HEADER_COUNT)		/* 1 addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2256
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2257
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2258
DESCDECL TrkMsgDesc gTrkMsgReadInfoHeader
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2259
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2260
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2261
	__debug_only_parm( "Read Info Header" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2262
	&gTrkMsgInfoHeader,							/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2263
	4,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2264
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2265
	{											/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2266
		__trk_msg_field( "start index", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2267
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2268
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2269
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2270
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2271
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2272
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2273
#define TRK_MSG_RI_HEADER_START_INDEX	(0 + TRK_MSG_INFO_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2274
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2275
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2276
#define TRK_MSG_RIR_HEADER_LENGTH		(8 + TRK_MSG_REPLY_HEADER_LENGTH)	/* 4 addl bytes  */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2277
#define TRK_MSG_RIR_HEADER_COUNT		(2 + TRK_MSG_REPLY_HEADER_COUNT)	/* 1 addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2278
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2279
DESCDECL TrkMsgDesc gTrkMsgReadInfoReplyHeader
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2280
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2281
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2282
	__debug_only_parm( "Read Info Reply Header" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2283
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2284
	8,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2285
	2,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2286
	{											/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2287
		__trk_msg_field( "returned count", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2288
		__trk_msg_field( "total count", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2289
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2290
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2291
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2292
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2293
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2294
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2295
#define TRK_MSG_RIR_HEADER_RETURNED_INDEX	(0 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2296
#define TRK_MSG_RIR_HEADER_TOTAL_INDEX		(1 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2297
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2298
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2299
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2300
#pragma mark  WriteFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2301
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2302
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2303
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2304
 *	kDSWriteFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2305
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2306
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2307
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2308
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2309
 *		ui32	file_handle			- (4) DSFileHandles (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2310
 *		ui16	length				- (2) file data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2311
 *				file data			- (0 to 2048)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2312
 *									  <6 + length + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2313
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2314
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2315
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2316
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2317
 *		ui32	file_handle			- (4) DSFileHandles (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2318
 *		ui16	length				- (2) file data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2319
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2320
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2321
 *				file data			- (0 to 2048)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2322
 *									  <14 + length + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2323
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2324
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2325
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2326
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2327
 *		ui8		io_result			- (1) DSIOResult (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2328
 *		ui16	length				- (2) amount that was written in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2329
 *									  <3 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2330
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2331
 *	kDSWriteFile: Sent by the target.  Instructs the host to write the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2332
 *	specified data to the file with the given handle.  Assumes that stdout
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2333
 *	and stderr are always open for writing.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2334
 *	Expects a reply from the host in the above format.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2335
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2336
 *	Note: The startup welcome message is sent as a kDSWriteFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2337
 *  message, but it is a special case and does not require a reply.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2338
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2339
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2340
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2341
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2342
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2343
	#define DS_MIN_MSG_WRITEFILE_LENGTH		(DS_MIN_MSG_LENGTH + 14)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2344
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2345
	#define DS_MIN_MSG_WRITEFILE_LENGTH		(DS_MIN_MSG_LENGTH + 6)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2346
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2347
#define DS_MIN_REPLY_WRITEFILE_LENGTH		(DS_MIN_REPLY_LENGTH + 3)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2348
  
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2349
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2350
#pragma mark  ReadFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2351
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2352
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2353
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2354
 *	kDSReadFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2355
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2356
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2357
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2358
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2359
 *		ui32	file_handle			- (4) DSFileHandles (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2360
 *		ui16	length				- (2) file data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2361
 *									  <6 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2362
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2363
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2364
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2365
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2366
 *		ui32	file_handle			- (4) DSFileHandles (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2367
 *		ui16	length				- (2) file data length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2368
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2369
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2370
 *									  <14 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2371
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2372
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2373
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2374
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2375
 *		ui8		io_result			- (1) DSIOResult (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2376
 *		ui16	length				- (2) amount that was read in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2377
 *				file data			- (0 to 2048)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2378
 *									  <3 + length + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2379
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2380
 *	Sent by the target.  Instructs the host to read the specified
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2381
 *	amount of data from the file with the given handle.  Assumes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2382
 *	that stdin is always open for reading.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2383
 *	Expects a reply from the host in the above format.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2384
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2385
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2386
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2387
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2388
	#define DS_MIN_MSG_READFILE_LENGTH		(DS_MIN_MSG_LENGTH + 14)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2389
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2390
	#define DS_MIN_MSG_READFILE_LENGTH		(DS_MIN_MSG_LENGTH + 6)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2391
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2392
#define DS_MIN_REPLY_READFILE_LENGTH		(DS_MIN_REPLY_LENGTH + 3)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2393
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2394
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2395
#pragma mark  NotifyFileInput
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2396
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2397
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2398
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2399
 *	kDSNotifyFileInput
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2400
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2401
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2402
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2403
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2404
 *		ui32	file_handle			- (4) DSFileHandles (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2405
 *									  <4 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2406
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2407
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2408
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2409
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2410
 *		ui32	file_handle			- (4) DSFileHandles (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2411
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2412
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2413
 *									  <12 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2414
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2415
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2416
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2417
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2418
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2419
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2420
 *	Sent by the host.  Notifies MetroTRK that new input is available for
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2421
 *	the given file.  This is intended to be used for stdin, but can be
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2422
 *	used for other files as well.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2423
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2424
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2425
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2426
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2427
/*** kDSNotifyFileInput ***/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2428
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2429
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2430
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2431
	DESCDECL TrkMsgDesc gTrkMsgNotifyFileInput
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2432
	#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2433
	= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2434
		__debug_only_parm( "Notify File Input" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2435
		&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2436
		12,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2437
		3,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2438
		{											/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2439
			__trk_msg_field( "file handle", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2440
			__trk_msg_field( "process ID", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2441
			__trk_msg_field( "thread ID", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2442
		}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2443
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2444
	#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2445
	;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2446
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2447
#else /* #if DS_PROTOCOL == DS_PROTOCOL_RTOS */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2448
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2449
	DESCDECL TrkMsgDesc gTrkMsgNotifyFileInput
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2450
	#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2451
	= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2452
		__debug_only_parm( "Notify File Input" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2453
		&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2454
		4,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2455
		1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2456
		{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2457
			__trk_msg_field( "file handle", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2458
		}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2459
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2460
	#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2461
	;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2462
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2463
#endif /* #if DS_PROTOCOL == DS_PROTOCOL_RTOS */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2464
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2465
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2466
#define TRK_MSG_NFI_HANDLE_INDEX		(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2467
#define TRK_MSG_NFI_PID_INDEX			(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2468
#define TRK_MSG_NFI_TID_INDEX			(2 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2469
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2470
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2471
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2472
#pragma mark  BlockFileIo
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2473
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2474
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2475
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2476
 *	kDSBlockFileIo
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2477
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2478
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2479
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2480
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2481
 *		ui8		block				- (1) if 0, OK to send file IO requests, otherwise no
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2482
 *									  <1 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2483
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2484
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2485
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2486
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2487
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2488
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2489
 *	Sent by the host.  Blocks/unblocks all file IO requests from the target.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2490
 *	If the host becomes overwhelmed with file IO processing, it can send this
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2491
 *	message with a block value of 1.  When it is able to handle more file IO
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2492
 *	requests it can send this message again with a block value of 0.  This
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2493
 *	affects target->host IO requests from all files on all processes and threads.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2494
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2495
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2496
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2497
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2498
/*** kDSBlockFileIo ***/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2499
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2500
DESCDECL TrkMsgDesc gTrkMsgBlockFileIo
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2501
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2502
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2503
	__debug_only_parm( "Block File IO" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2504
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2505
	1,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2506
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2507
	{											/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2508
		__trk_msg_field( "block", 1 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2509
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2510
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2511
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2512
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2513
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2514
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2515
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2516
#define TRK_MSG_BFIO_BLOCK_INDEX		(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2517
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2518
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2519
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2520
#pragma mark  OpenFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2521
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2522
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2523
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2524
 *	kDSOpenFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2525
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2526
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2527
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2528
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2529
 *		ui8		modes				- (1) DSFileOpenModes (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2530
 *		ui16	name_length			- (2) file name length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2531
 *		ui8[]	file_name			- (0 to 2048) file name (no string
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2532
 *												  terminator)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2533
 *									  <3 + name_length + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2534
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2535
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2536
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2537
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2538
 *		ui8		modes				- (1) DSFileOpenModes (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2539
 *		ui16	name_length			- (2) file name length in bytes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2540
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2541
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2542
 *		ui8[]	file_name			- (0 to 2048) file name (no string
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2543
 *												  terminator)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2544
 *									  <11 + name_length + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2545
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2546
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2547
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2548
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2549
 *		ui8		io_result			- (1) DSIOResult (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2550
 *		ui32	file_handle			- (4) handle of the newly opened file
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2551
 *		ui32	timestamp			- (4) timestamp of file on open (replyer-dependent format)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2552
 *									  <9 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2553
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2554
 *	Sent by the target.  Instructs the host to open a file with the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2555
 *	given name and modes.  The resulting file_handle can then be
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2556
 *	used by kDSWriteFile, kDSReadFile, kDSCloseFile, and kDSPositionFile.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2557
 *	Expects a reply from the host in the above format.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2558
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2559
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2560
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2561
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2562
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2563
	#define DS_MIN_MSG_OPENFILE_LENGTH		(DS_MIN_MSG_LENGTH + 11)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2564
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2565
	#define DS_MIN_MSG_OPENFILE_LENGTH		(DS_MIN_MSG_LENGTH + 3)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2566
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2567
#define DS_MIN_REPLY_OPENFILE_LENGTH		(DS_MIN_REPLY_LENGTH + 5)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2568
  
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2569
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2570
#pragma mark  CloseFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2571
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2572
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2573
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2574
 *	kDSCloseFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2575
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2576
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2577
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2578
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2579
 *		ui32	file_handle			- (4) handle of the file to be closed
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2580
 *		ui32	timestamp			- (4) new timestamp value to be set for the file (receiver-dependent format)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2581
 *									  <8 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2582
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2583
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2584
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2585
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2586
 *		ui32	file_handle			- (4) handle of the file to be closed
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2587
 *		ui32	timestamp			- (4) new timestamp value to be set for the file (receiver-dependent format)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2588
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2589
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2590
 *									  <16 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2591
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2592
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2593
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2594
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2595
 *		ui8		io_result			- (1) DSIOResult (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2596
 *									  <1 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2597
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2598
 *	Sent by the target.  Instructs the host to close the file with the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2599
 *	specified file_handle.  Note: the timestamp value will only affect
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2600
 *	the file if it was opened in write mode.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2601
 *	Expects a reply from the host in the above format.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2602
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2603
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2604
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2605
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2606
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2607
	#define DS_MIN_MSG_CLOSEFILE_LENGTH		(DS_MIN_MSG_LENGTH + 16)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2608
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2609
	#define DS_MIN_MSG_CLOSEFILE_LENGTH		(DS_MIN_MSG_LENGTH + 8)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2610
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2611
#define DS_MIN_REPLY_CLOSEFILE_LENGTH		(DS_MIN_REPLY_LENGTH + 1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2612
  
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2613
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2614
#pragma mark  PositionFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2615
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2616
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2617
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2618
 *	kDSPositionFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2619
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2620
 *	Send: if DS_PROTOCOL < DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2621
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2622
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2623
 *		ui8		mode				- (1) DSFilePositionModes (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2624
 *		ui32	file_handle			- (4) handle of the file to be positioned
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2625
 *		ui32	offset				- (4) position offset
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2626
 *									  <9 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2627
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2628
 *	Send: if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2629
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2630
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2631
 *		ui8		mode				- (1) DSFilePositionModes (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2632
 *		ui32	file_handle			- (4) handle of the file to be positioned
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2633
 *		ui32	offset				- (4) position offset
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2634
 *		ui32	processID			- (4) unique process ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2635
 *		ui32	threadID			- (4) unique thread ID
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2636
 *									  <17 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2637
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2638
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2639
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2640
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2641
 *		ui8		io_result			- (1) DSIOResult (see below)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2642
 *									  <1 + header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2643
 *	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2644
 *	Sent by the target.  Instructs the host to set the file position
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2645
 *	of the specified file.  The new position will be at the specified
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2646
 *	offset from one of three reference points in the file, as specified
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2647
 *	by the mode.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2648
 *	Expects a reply from the host in the above format.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2649
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2650
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2651
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2652
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2653
#if DS_PROTOCOL == DS_PROTOCOL_RTOS
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2654
	#define DS_MIN_MSG_POSITIONFILE_LENGTH	(DS_MIN_MSG_LENGTH + 13)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2655
#else
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2656
	#define DS_MIN_MSG_POSITIONFILE_LENGTH	(DS_MIN_MSG_LENGTH + 5)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2657
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2658
#define DS_MIN_REPLY_POSITIONFILE_LENGTH	(DS_MIN_REPLY_LENGTH + 1)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2659
  
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2660
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2661
** These are the predefined file handles.  Additional files may
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2662
** be opened via the kDSOpenFile command.  New file handles 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2663
** returned by that command may be used in addition to the
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2664
** ones defined here.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2665
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2666
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2667
typedef enum DSFileHandle
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2668
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2669
	kDSStdin  = 0x00,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2670
	kDSStdout = 0x01,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2671
	kDSStderr = 0x02
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2672
} DSFileHandle;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2673
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2674
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2675
** The result of an I/O command can be any one of the following.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2676
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2677
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2678
typedef enum DSIOResult
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2679
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2680
	kDSIONoError	= 0x00,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2681
	kDSIOError		= 0x01,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2682
	kDSIOEOF		= 0x02
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2683
} DSIOResult;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2684
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2685
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2686
** When opening a file, the following values can be OR'ed together
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2687
** to specify the desired open modes.  The following table shows
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2688
** the correlation between the various modes and the standard mode
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2689
** option for fopen:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2690
**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2691
**	read	write	append	binary	create		fopen mode
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2692
**	-------------------------------------------------------
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2693
**	yes											"r"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2694
**			yes*					yes			"w"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2695
**			yes*	yes				yes			"a"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2696
**	yes		yes									"r+"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2697
**	yes		yes*					yes			"w+"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2698
**	yes		yes*	yes				yes			"a+"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2699
**	yes						yes					"rb"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2700
**			yes*			yes		yes			"wb"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2701
**			yes*	yes		yes		yes			"ab"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2702
**	yes		yes				yes					"r+b"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2703
**	yes		yes*			yes		yes			"w+b"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2704
**	yes		yes*	yes		yes		yes			"a+b"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2705
**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2706
**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2707
** * Note that when the append or create modes are specified,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2708
** the write mode is always assumed.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2709
**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2710
** If the exec mode is specified, the resulting file will
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2711
** be created as an executable file (with execute permissions).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2712
** This is only meaningful if the create mode is also specified.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2713
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2714
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2715
typedef enum DSFileOpenModes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2716
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2717
	kDSFileOpenRead		= 0x01,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2718
	kDSFileOpenWrite	= 0x02,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2719
	kDSFileOpenAppend	= 0x04,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2720
	kDSFileOpenBinary	= 0x08,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2721
	kDSFileOpenCreate	= 0x10,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2722
	kDSFileOpenExec		= 0x20
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2723
} DSFileOpenModes;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2724
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2725
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2726
** Use one of the following values to specify a file positioning mode.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2727
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2728
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2729
typedef enum DSFilePositionModes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2730
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2731
	kDSFileSeekSet		= 0x00,		/* Position is offset from file start */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2732
	kDSFileSeekCur		= 0x01,		/* Position is offset from current pos. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2733
	kDSFileSeekEnd		= 0x02		/* Position is offset from file end */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2734
} DSFilePositionModes;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2735
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2736
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2737
#pragma mark  OS File Operations
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2738
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2739
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2740
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2741
 *	kDSOSWriteFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2742
 *	kDSOSReadFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2743
 *	kDSOSOpenFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2744
 *	kDSOSCloseFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2745
 *	kDSOSPositionFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2746
 *	kDSOSInstallFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2747
 *  kDSOSInstallFile2
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2748
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2749
 *	The format and function of these commands is identical to
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2750
 *	that of the kDSWriteFile, kDSReadFile, kDSOpenFile,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2751
 *	kDSCloseFile, and kDSPositionFile commands described above.  
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2752
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2753
 *	The difference is that these commands are sent from the host to
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2754
 *	the target, they operate on files on the target system, and they
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2755
 *	do not include the processId and threadId fields (i.e., they are 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2756
 *	formatted as described above as if DS_PROTOCOL < DS_PROTOCOL_RTOS).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2757
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2758
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2759
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2760
/*** kDSOSWriteFile ***/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2761
DESCDECL TrkMsgDesc gTrkMsgOsWriteFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2762
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2763
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2764
	__debug_only_parm( "OS Write File" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2765
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2766
	6,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2767
	2,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2768
	{						/* addl field descriptors (data handled separately): */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2769
		__trk_msg_field( "file handle", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2770
		__trk_msg_field( "length", 2 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2771
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2772
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2773
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2774
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2775
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2776
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2777
#define TRK_MSG_OWF_HANDLE_INDEX		(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2778
#define TRK_MSG_OWF_LENGTH_INDEX		(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2779
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2780
DESCDECL TrkMsgDesc gTrkMsgOsWriteFileReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2781
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2782
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2783
	__debug_only_parm( "OS Write File Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2784
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2785
	3,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2786
	2,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2787
	{						/* addl field descriptors (data handled separately): */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2788
		__trk_msg_field( "io result", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2789
		__trk_msg_field( "length", 2 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2790
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2791
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2792
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2793
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2794
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2795
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2796
#define TRK_MSG_OWFR_IORESULT_INDEX		(0 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2797
#define TRK_MSG_OWFR_LENGTH_INDEX		(1 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2798
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2799
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2800
/*** kDSOSReadFile ***/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2801
DESCDECL TrkMsgDesc gTrkMsgOsReadFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2802
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2803
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2804
	__debug_only_parm( "OS Read File" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2805
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2806
	6,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2807
	2,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2808
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2809
		__trk_msg_field( "file handle", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2810
		__trk_msg_field( "length", 2 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2811
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2812
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2813
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2814
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2815
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2816
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2817
#define TRK_MSG_ORF_HANDLE_INDEX		(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2818
#define TRK_MSG_ORF_LENGTH_INDEX		(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2819
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2820
DESCDECL TrkMsgDesc gTrkMsgOsReadFileReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2821
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2822
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2823
	__debug_only_parm( "OS Read File Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2824
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2825
	3,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2826
	2,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2827
	{						/* addl field descriptors (data handled separately): */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2828
		__trk_msg_field( "IO result", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2829
		__trk_msg_field( "length", 2 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2830
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2831
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2832
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2833
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2834
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2835
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2836
#define TRK_MSG_ORFR_IORESULT_INDEX		(0 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2837
#define TRK_MSG_ORFR_LENGTH_INDEX		(1 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2838
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2839
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2840
/*** kDSOSOpenFile ***/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2841
DESCDECL TrkMsgDesc gTrkMsgOsOpenFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2842
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2843
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2844
	__debug_only_parm( "OS Open File" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2845
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2846
	3,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2847
	2,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2848
	{						/* addl field descriptors (file_name handled separately): */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2849
		__trk_msg_field( "modes", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2850
		__trk_msg_field( "name length", 2 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2851
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2852
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2853
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2854
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2855
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2856
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2857
#define TRK_MSG_OOF_MODES_INDEX		(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2858
#define TRK_MSG_OOF_LENGTH_INDEX	(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2859
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2860
DESCDECL TrkMsgDesc gTrkMsgOsOpenFileReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2861
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2862
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2863
	__debug_only_parm( "OS Open File Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2864
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2865
	9,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2866
	3,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2867
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2868
		__trk_msg_field( "IO result", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2869
		__trk_msg_field( "file handle", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2870
		__trk_msg_field( "timestamp", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2871
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2872
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2873
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2874
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2875
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2876
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2877
#define TRK_MSG_OOFR_IORESULT_INDEX		(0 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2878
#define TRK_MSG_OOFR_HANDLE_INDEX		(1 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2879
#define TRK_MSG_OOFR_TIMESTAMP_INDEX	(2 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2880
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2881
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2882
/*** kDSOSCloseFile ***/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2883
DESCDECL TrkMsgDesc gTrkMsgOsCloseFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2884
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2885
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2886
	__debug_only_parm( "OS Close File" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2887
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2888
	8,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2889
	2,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2890
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2891
		__trk_msg_field( "file handle", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2892
		__trk_msg_field( "timestamp", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2893
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2894
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2895
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2896
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2897
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2898
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2899
#define TRK_MSG_OCF_HANDLE_INDEX	(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2900
#define TRK_MSG_OCF_TIMESTAMP_INDEX	(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2901
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2902
DESCDECL TrkMsgDesc gTrkMsgOsCloseFileReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2903
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2904
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2905
	__debug_only_parm( "OS Close File Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2906
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2907
	1,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2908
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2909
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2910
		__trk_msg_field( "IO result", 1 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2911
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2912
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2913
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2914
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2915
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2916
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2917
#define TRK_MSG_OCFR_IORESULT_INDEX		(0 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2918
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2919
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2920
/*** kDSOSPositionFile ***/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2921
DESCDECL TrkMsgDesc gTrkMsgOsPositionFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2922
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2923
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2924
	__debug_only_parm( "OS Position File" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2925
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2926
	9,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2927
	3,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2928
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2929
		__trk_msg_field( "modes", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2930
		__trk_msg_field( "file handle", 4 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2931
		__trk_msg_field( "offset", 4 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2932
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2933
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2934
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2935
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2936
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2937
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2938
#define TRK_MSG_OPF_MODES_INDEX		(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2939
#define TRK_MSG_OPF_HANDLE_INDEX	(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2940
#define TRK_MSG_OPF_OFFSET_INDEX	(2 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2941
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2942
DESCDECL TrkMsgDesc gTrkMsgOsPositionFileReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2943
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2944
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2945
	__debug_only_parm( "OS Position File Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2946
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2947
	1,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2948
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2949
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2950
		__trk_msg_field( "IO result", 1 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2951
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2952
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2953
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2954
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2955
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2956
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2957
#define TRK_MSG_OPFR_IORESULT_INDEX		(0 + TRK_MSG_REPLY_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2958
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2959
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2960
/*** kDSOSInstallFile ***/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2961
DESCDECL TrkMsgDesc gTrkMsgOsInstallFile
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2962
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2963
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2964
	__debug_only_parm( "OS Install File" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2965
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2966
	3,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2967
	2,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2968
	{											/* addl field descriptors (file_name handled separately): */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2969
		__trk_msg_field( "drive", 1 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2970
		__trk_msg_field( "name length", 2 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2971
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2972
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2973
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2974
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2975
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2976
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2977
#define TRK_MSG_OIF_DRIVE_INDEX		(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2978
#define TRK_MSG_OIF_LENGTH_INDEX	(1 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2979
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2980
DESCDECL TrkMsgDesc gTrkMsgOsInstallFileReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2981
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2982
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2983
	__debug_only_parm( "OS Install File Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2984
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2985
	1,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2986
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2987
	{											/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2988
		__trk_msg_field( "IO result", 1 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2989
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2990
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2991
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2992
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2993
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2994
/*** kDSOSInstallFile2 ***/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2995
DESCDECL TrkMsgDesc gTrkMsgOsInstallFile2
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2996
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2997
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2998
	__debug_only_parm( "OS Install File2" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  2999
	&gTrkMsgHeader,								/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3000
	2,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3001
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3002
	{											/* addl field descriptors (file_name handled separately): */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3003
		__trk_msg_field( "name length", 2 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3004
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3005
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3006
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3007
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3008
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3009
/* "Index" of fields.  Take # of header fields into account. */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3010
#define TRK_MSG_OIF2_LENGTH_INDEX	(0 + TRK_MSG_HEADER_COUNT)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3011
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3012
DESCDECL TrkMsgDesc gTrkMsgOsInstallFile2Reply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3013
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3014
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3015
	__debug_only_parm( "OS Install File2 Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3016
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3017
	1,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3018
	1,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3019
	{											/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3020
		__trk_msg_field( "IO result", 1 )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3021
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3022
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3023
#endif /* #ifdef TRK_MSGCMD_INIT */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3024
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3025
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3026
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3027
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3028
 *	kDSOSPhoneSWVersion
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3029
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3030
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3031
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3032
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3033
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3034
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3035
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3036
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3037
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3038
 *		ui16	version string len	- (2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3039
 *		string  sw version string 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3040
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3041
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3042
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3043
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3044
#define DS_MIN_MSG_PHONESWVERSION_LENGTH			DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3045
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3046
DESCDECL TrkMsgDesc gTrkMsgPhoneSWVersionReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3047
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3048
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3049
	__debug_only_parm( "Phone SW Version Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3050
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3051
	x,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3052
	x,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3053
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3054
		__trk_msg_field( "version string len", 2 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3055
		__trk_msg_field( "version string", x )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3056
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3057
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3058
#endif 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3059
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3060
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3061
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3062
 *	kDSOSPhoneName
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3063
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3064
 *	Send:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3065
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3066
 *		....	<Message Header>	  ... (see gTrkMsgHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3067
 *									  <header> total
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3068
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3069
 *	Reply:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3070
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3071
 *		....	<Reply Header>		  ... (see gTrkMsgReplyHeader)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3072
 *		ui16	phone name len	- (2)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3073
 *		string  phone name string 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3074
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3075
 *
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3076
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3077
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3078
#define DS_MIN_MSG_PHONENAME_LENGTH			DS_MIN_MSG_LENGTH
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3079
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3080
DESCDECL TrkMsgDesc gTrkMsgPhoneNameReply
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3081
#ifdef TRK_MSGCMD_INIT
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3082
= {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3083
	__debug_only_parm( "Phone Name Reply" )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3084
	&gTrkMsgReplyHeader,						/* previous fragment/header */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3085
	x,											/* # of addl bytes */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3086
	x,											/* # of addl fields */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3087
	{						/* addl field descriptors: */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3088
		__trk_msg_field( "phone name string len", 2 ),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3089
		__trk_msg_field( "phone name string", x )
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3090
	}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3091
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3092
#endif 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3093
;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3094
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3095
#if __MWERKS__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3096
#pragma mark  Message Error Values
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3097
#endif /* __MWERKS__ */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3098
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3099
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3100
 *	Error values returned in ACK/NAK packets
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3101
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3102
/****************************************************************************/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3103
 typedef enum {
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3104
 	kDSReplyNoError = 0x00,					/* no error */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3105
	kDSReplyError = 0x01,					/* generic error in CWDS message */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3106
	kDSReplyPacketSizeError = 0x02,			/* unexpected pkt size in send msg */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3107
	kDSReplyCWDSError = 0x03,				/* internal error occurred in CWDS */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3108
	kDSReplyEscapeError = 0x04,				/* escape followed by frame flag */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3109
	kDSReplyBadFCS = 0x05,					/* bad FCS in packet */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3110
	kDSReplyOverflow = 0x06,				/* packet too long */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3111
	kDSReplySequenceMissing = 0x07,			/* sequence ID != expected (gap in sequence) */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3112
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3113
	kDSReplyUnsupportedCommandError = 0x10,	/* command not supported */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3114
	kDSReplyParameterError = 0x11,			/* command param out of range */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3115
	kDSReplyUnsupportedOptionError = 0x12,	/* an option was not supported */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3116
	kDSReplyInvalidMemoryRange = 0x13,		/* read/write to invalid memory */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3117
	kDSReplyInvalidRegisterRange = 0x14,	/* read/write invalid registers */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3118
	kDSReplyCWDSException = 0x15,			/* exception occurred in CWDS */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3119
	kDSReplyNotStopped = 0x16,				/* targeted system or thread is running */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3120
	kDSReplyBreakpointsFull = 0x17,			/* bp resources (HW or SW) exhausted */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3121
	kDSReplyBreakpointConflict = 0x18,		/* requested bp conflicts w/existing bp */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3122
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3123
	kDSReplyOsError = 0x20,					/* general OS-related error */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3124
	kDSReplyInvalidProcessId = 0x21,		/* request specified invalid process */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3125
	kDSReplyInvalidThreadId = 0x22,			/* request specified invalid thread */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3126
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3127
	kDSDebugSecurityError = 0x23			/* security error from DSS */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3128
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3129
} DSReplyError;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3130
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3131
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
  3132
#endif /* __MSGCMD_H__ */