rmonint.h
7.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/*
* ==========================================================================
* Copyright (c) 1994, Silicon Graphics, Inc. All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied
* or duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc. handleSelectExceptions
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished
* rights reserved under the Copyright Laws of the United States.
* ==========================================================================
*/
#include "ultratypes.h"
#include "os.h"
#include "os_internal.h"
#include "dbgproto.h"
#include "sptask.h"
typedef int (* FUNPTR)( KKHeader * );
typedef void (* VFUNPTR)();
/*
Messages that may be sent to the rmon message queue
*/
#define MSG_CHARAVAIL 0x01
#define MSG_BREAKPOINT 0x02
#define MSG_SPBREAKPOINT 0x04
#define MSG_CPUFAULT 0x08
#define MSG_THREADCREATE 0x10
#define MSG_THREADDESTROY 0x20
/*
Error return codes from the rk API - expected in reply
packets by DBGIF process.
*/
#define TV_ERROR_NO_ERROR 0
#define TV_ERROR_ILLEGAL_CALL -1
#define TV_ERROR_INVALID_ID -2
#define TV_ERROR_INVALID_TYPE -3
#define TV_ERROR_OP_PROTECTED -4
#define TV_ERROR_INVALID_ADDRESS -5
#define TV_ERROR_INVALID_PRIORITY -6
#define TV_ERROR_INVALID_FLAGS -7
#define TV_ERROR_INVALID_CAPABILITY -8
#define TV_ERROR_NO_HANDLER -9
#define TV_ERROR_NO_MORE_IDS -10
#define TV_ERROR_NO_MORE_MESSAGES -11
#define TV_ERROR_NO_MORE_PROCESSES -12
#define TV_ERROR_NO_MORE_THREADS -13
#define TV_ERROR_NO_MORE_REGIONS -14
#define TV_ERROR_NO_MORE_TIMERS -15
#define TV_ERROR_NO_MORE_LOCKS -16
#define TV_ERROR_NO_MORE_QUEUES -17
#define TV_ERROR_NO_MORE_SETS -18
#define TV_ERROR_NO_MORE_MEMORY -19
#define TV_ERROR_NOT_LOCKED -20
#define TV_ERROR_REGION_ALREADY_MAPPED -30
#define TV_ERROR_ADDRESS_ALREADY_MAPPED -31
#define TV_ERROR_NOT_MAPPED -32
#define TV_ERROR_INVALID_SIZE -33
#define TV_ERROR_INVALID_PADDR -34
#define TV_ERROR_RESERVED_MESSAGE_TYPE -40
#define TV_ERROR_QUEUE_FULL -41
#define TV_ERROR_FULL_SET -50
#define TV_ERROR_EMPTY_SET -51
#define TV_ERROR_DEVICE_BUSY -60
#define TV_ERROR_NOT_NAVIGATOR -61
#define TV_ERROR_NO_EXECUTABLE -62
#define TV_ERROR_DEVICE_INIT -63
#define TV_ERROR_DEVICE_NOTOPEN -64
#define TV_ERROR_DEVICE_CONFIG -65
#define TV_ERROR_INVALID_ARG -66
#define TV_ERROR_NOT_READY -67
#define TV_ERROR_CM_CHECKSUM -68
#define TV_ERROR_CM_BADRSP -69
#define TV_ERROR_CM_BADRSPLEN -70
#define TV_ERROR_ATM_OUT_OF_VCC -71
#define TV_ERROR_ATM_VCC_INUSE -72
#define TV_ERROR_ATM_DEVICE_DOWN -73
#define TV_ERROR_ATM_INVALID_OP -74
#define TV_ERROR_ATM_VIDEO_INUSE -75
#define TV_ERROR_ATM_INVALID_SERVICE -76
#define TV_ERROR_NV_BAD_NVRAM -77
#define TV_ERROR_NV_VAL_TOO_LONG -78
#define TV_ERROR_NV_NOT_FOUND -79
#define TV_ERROR_NV_FULL -80
#define TV_ERROR_LOG_BUF_EMPTY -81
#define __TV_LAST_KERNEL_ERROR -99
#define EV_BREAK 1 /* Event: a breakpoint has been hit */
#define VERSION 2
/*
Memory regions
*/
#define RAM_START 0
#define RAM_END 0x03efffff
#define ROM_START 0x05000000
#define ROM_END 0x7fffffff
#define DMEM_START 0x4000000
#define DMEM_END 0x4000fff
#define IMEM_START 0x4001000
#define IMEM_END 0x4001fff
#define RCPMEM_START 0x4000000 /* any */
#define RCPMEM_END 0x4ffffff
#define METHOD_NORMAL 0
#define METHOD_RSP 1
#define METHOD_VECT 2
#define RSP_PROC 1001
#define RSP_THREAD 1000 /* scalar space */
#define CPU_PROC 1002
#define CPU_THREAD 1003
#define BREAKMASK 0xfc00003f
#define MEMBASE 0x88200000
#if defined( RMONDEBUG )
#define Debug rmonPrintf
#else /* not RMONDEBUG, do nothing */
#ifdef __GNUC__
#define Debug(arg...)
#else
#define Debug
#endif
#endif
#define MEMK 0
#define MAXMEMREQ 1024
#define MAXPACKET MAXMEMREQ+16
#define MAXENCODED ((MAXPACKET*5)/4)+16
#define _PTYPE u32 *
/* Function Prototypes */
/* exports from rcp.s */
extern u32 __rmonRCPrunning( void );
extern void __rmonIdleRCP( void );
extern void __rmonRunRCP( void );
extern void __rmonStepRCP( void );
/* exports from rmonbrk.c */
extern void __rmonHitBreak( void );
extern void __rmonHitSpBreak( void );
extern void __rmonHitCpuFault( void );
extern u32 __rmonGetBranchTarget( int, int, char * );
extern int __rmonSetSingleStep( int, u32 * );
extern void __rmonGetExceptionStatus( KKStatusEvent * );
extern int __rmonSetBreak( KKHeader * );
extern int __rmonClearBreak( KKHeader * );
extern int __rmonListBreak( KKHeader * );
extern u8 __rmonRcpAtBreak;
/* exports from rmoncmd.c */
extern int __rmonExecute( KKHeader * );
/* exports from rmonmain.c */
extern void __rmonSendReply( KKHeader * const, u32, u32 );
extern void __rmonSendHeader( KKHeader * const, u32, u32 );
extern void __rmonSendData( const char *, unsigned int );
extern int __rmonActive;
/* exports from rmonmem.c */
extern u32 __rmonReadWordAt( u32 * );
extern void __rmonWriteWordTo( u32 *, u32 );
extern void __rmonMemcpy( u8 *, u8 *, u32 );
extern void __rmonCopyWords( u32 *, u32 *, u32 );
extern int __rmonLoadProgram( KKHeader * );
extern int __rmonReadMem( KKHeader * );
extern int __rmonWriteMem( KKHeader * );
extern int __rmonListProcesses( KKHeader * );
extern int __rmonGetExeName( KKHeader * );
extern int __rmonGetRegionCount( KKHeader * );
extern int __rmonGetRegions( KKHeader * );
extern u8 __rmonUtilityBuffer[]; /* 256 bytes -watch it if it
gets to about 50 tasks! */
/* exports from rmonmisc.c */
extern void __rmonInit( void );
extern void __rmonPanic( void );
extern int __rmonSetFault( KKHeader * );
extern int __rmonSetComm( KKHeader * );
extern OSMesgQueue __rmonMQ;
/* exports from rmonregs.c */
extern u32 __rmonGetRegisterContents( int, int, int );
extern int __rmonGetGRegisters( KKHeader * );
extern int __rmonSetGRegisters( KKHeader * );
extern int __rmonGetFRegisters( KKHeader * );
extern int __rmonSetFRegisters( KKHeader * );
extern int __rmonGetSRegs( KKHeader * );
extern int __rmonSetSRegs( KKHeader * );
extern int __rmonGetVRegs( KKHeader * );
extern int __rmonSetVRegs( KKHeader * );
/* exports from rmonsio.c */
extern void __rmonAcquirePrintf( void );
extern void __rmonReleasePrintf( void );
extern int __rmonIOread( u32 * );
extern void __rmonPflush( void );
extern void __rmonSendFault( OSThread * );
extern void __rmonIOflush( void );
extern void __rmonIOputw( u32 );
extern void __rmonPputw( u32 );
extern void __rmonIOhandler( void );
extern OSMesgQueue rmonCalloutMQ;
extern OSMesgQueue __rmonLogAckMesgQueue;
extern OSMesgQueue __rmonDataAckMesgQueue;
extern OSMesgQueue __rmonProfReqMesgQueue;
extern OSMesgQueue __rmonProfAckMesgQueue;
/* exports from rmontask.c */
extern void __rmonMaskIdleThreadInts( void );
extern OSThread * __rmonGetTCB( int );
extern int __rmonStopUserThreads( int );
extern int __rmonGetThreadStatus( int, int, KKStatusEvent * );
extern int __rmonListThreads( KKHeader * );
extern int __rmonThreadStatus( KKHeader * );
extern int __rmonStopThread( KKHeader * );
extern int __rmonRunThread( KKHeader * );