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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
|
/* local type decs. and macro defs.
Copyright 1993 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "udiphcfg.h" /* Get host specific configuration */
#include "udiptcfg.h" /* Get target specific configuration */
/* Here are all of the CPU Families for which UDI is currently defined */
#define Am29K 1 /* AMD's Am290xx and Am292xx parts */
typedef UDIInt UDIError;
typedef UDIInt UDISessionId;
typedef UDIInt UDIPId;
typedef UDIInt UDIStepType;
typedef UDIInt UDIBreakType;
typedef UDIUInt UDIBreakId;
typedef UDIUInt UDIMode;
typedef UDIStruct
{
CPUSpace Space;
CPUOffset Offset;
} UDIResource;
typedef UDIStruct
{
CPUOffset Low;
CPUOffset High;
} UDIRange;
typedef UDIStruct
{
CPUSpace Space;
CPUOffset Offset;
CPUSizeT Size;
} UDIMemoryRange;
/* Values for UDIStepType parameters */
#define UDIStepNatural 0x0000
#define UDIStepOverTraps 0x0001
#define UDIStepOverCalls 0x0002
#define UDIStepInRange 0x0004
#define UDIStepNatural 0x0000
/* Values for UDIBreakType parameters */
#define UDIBreakFlagExecute 0x0001
#define UDIBreakFlagRead 0x0002
#define UDIBreakFlagWrite 0x0004
#define UDIBreakFlagFetch 0x0008
/* Special values for UDIWait MaxTime parameter */
#define UDIWaitForever (UDIInt32) -1 /* Infinite time delay */
/* Special values for PId */
#define UDIProcessProcessor -1 /* Raw Hardware, if possible */
/* Values for UDIWait StopReason */
#define UDIGrossState 0xff
#define UDITrapped 0 /* Fine state - which trap */
#define UDINotExecuting 1
#define UDIRunning 2
#define UDIStopped 3
#define UDIWarned 4
#define UDIStepped 5
#define UDIWaiting 6
#define UDIHalted 7
#define UDIStdoutReady 8 /* fine state - size */
#define UDIStderrReady 9 /* fine state - size */
#define UDIStdinNeeded 10 /* fine state - size */
#define UDIStdinModeX 11 /* fine state - mode */
#define UDIBreak 12 /* Fine state - Breakpoint Id */
#define UDIExited 13 /* Fine state - exit code */
/* Enumerate the return values from the callback function
for UDIEnumerateTIPs.
*/
#define UDITerminateEnumeration 0
#define UDIContinueEnumeration 1
/* Enumerate values for Terminate parameter to UDIDisconnect */
#define UDITerminateSession 1
#define UDIContinueSession 0
/* Error codes */
#define UDINoError 0 /* No error occured */
#define UDIErrorNoSuchConfiguration 1
#define UDIErrorCantHappen 2
#define UDIErrorCantConnect 3
#define UDIErrorNoSuchConnection 4
#define UDIErrorNoConnection 5
#define UDIErrorCantOpenConfigFile 6
#define UDIErrorCantStartTIP 7
#define UDIErrorConnectionUnavailable 8
#define UDIErrorTryAnotherTIP 9
#define UDIErrorExecutableNotTIP 10
#define UDIErrorInvalidTIPOption 11
#define UDIErrorCantDisconnect 12
#define UDIErrorUnknownError 13
#define UDIErrorCantCreateProcess 14
#define UDIErrorNoSuchProcess 15
#define UDIErrorUnknownResourceSpace 16
#define UDIErrorInvalidResource 17
#define UDIErrorUnsupportedStepType 18
#define UDIErrorCantSetBreakpoint 19
#define UDIErrorTooManyBreakpoints 20
#define UDIErrorInvalidBreakId 21
#define UDIErrorNoMoreBreakIds 22
#define UDIErrorUnsupportedService 23
#define UDIErrorTryAgain 24
#define UDIErrorIPCLimitation 25
#define UDIErrorIncomplete 26
#define UDIErrorAborted 27
#define UDIErrorTransDone 28
#define UDIErrorCantAccept 29
#define UDIErrorTransInputNeeded 30
#define UDIErrorTransModeX 31
#define UDIErrorInvalidSize 32
#define UDIErrorBadConfigFileEntry 33
#define UDIErrorIPCInternal 34
/* TBD */
/****************************************************************** PROCEDURES
*/
UDIError UDIConnect UDIParams((
char *Configuration, /* In */
UDISessionId *Session /* Out */
));
UDIError UDIDisconnect UDIParams((
UDISessionId Session, /* In */
UDIBool Terminate /* In */
));
UDIError UDISetCurrentConnection UDIParams((
UDISessionId Session /* In */
));
UDIError UDICapabilities UDIParams((
UDIUInt32 *TIPId, /* Out */
UDIUInt32 *TargetId, /* Out */
UDIUInt32 DFEId, /* In */
UDIUInt32 DFE, /* In */
UDIUInt32 *TIP, /* Out */
UDIUInt32 *DFEIPCId, /* Out */
UDIUInt32 *TIPIPCId, /* Out */
char *TIPString /* Out */
));
UDIError UDIEnumerateTIPs UDIParams((
UDIInt (*UDIETCallback) /* In */
UDIParams(( char *Configuration )) /* In to callback() */
));
UDIError UDIGetErrorMsg UDIParams((
UDIError ErrorCode, /* In */
UDISizeT MsgSize, /* In */
char *Msg, /* Out */
UDISizeT *CountDone /* Out */
));
UDIError UDIGetTargetConfig UDIParams((
UDIMemoryRange KnownMemory[], /* Out */
UDIInt *NumberOfRanges, /* In/Out */
UDIUInt32 ChipVersions[], /* Out */
UDIInt *NumberOfChips /* In/Out */
));
UDIError UDICreateProcess UDIParams((
UDIPId *PId /* Out */
));
UDIError UDISetCurrentProcess UDIParams((
UDIPId PId /* In */
));
UDIError UDIDestroyProcess UDIParams((
UDIPId PId /* In */
));
UDIError UDIInitializeProcess UDIParams((
UDIMemoryRange ProcessMemory[], /* In */
UDIInt NumberOfRanges, /* In */
UDIResource EntryPoint, /* In */
CPUSizeT StackSizes[], /* In */
UDIInt NumberOfStacks, /* In */
char *ArgString /* In */
));
UDIError UDIRead UDIParams((
UDIResource From, /* In */
UDIHostMemPtr To, /* Out */
UDICount Count, /* In */
UDISizeT Size, /* In */
UDICount *CountDone, /* Out */
UDIBool HostEndian /* In */
));
UDIError UDIWrite UDIParams((
UDIHostMemPtr From, /* In */
UDIResource To, /* In */
UDICount Count, /* In */
UDISizeT Size, /* In */
UDICount *CountDone, /* Out */
UDIBool HostEndian /* In */
));
UDIError UDICopy UDIParams((
UDIResource From, /* In */
UDIResource To, /* In */
UDICount Count, /* In */
UDISizeT Size, /* In */
UDICount *CountDone, /* Out */
UDIBool Direction /* In */
));
UDIError UDIExecute UDIParams((
void
));
UDIError UDIStep UDIParams((
UDIUInt32 Steps, /* In */
UDIStepType StepType, /* In */
UDIRange Range /* In */
));
UDIVoid UDIStop UDIParams((
void
));
UDIError UDIWait UDIParams((
UDIInt32 MaxTime, /* In */
UDIPId *PId, /* Out */
UDIUInt32 *StopReason /* Out */
));
UDIError UDISetBreakpoint UDIParams((
UDIResource Addr, /* In */
UDIInt32 PassCount, /* In */
UDIBreakType Type, /* In */
UDIBreakId *BreakId /* Out */
));
UDIError UDIQueryBreakpoint UDIParams((
UDIBreakId BreakId, /* In */
UDIResource *Addr, /* Out */
UDIInt32 *PassCount, /* Out */
UDIBreakType *Type, /* Out */
UDIInt32 *CurrentCount /* Out */
));
UDIError UDIClearBreakpoint UDIParams((
UDIBreakId BreakId /* In */
));
UDIError UDIGetStdout UDIParams((
UDIHostMemPtr Buf, /* Out */
UDISizeT BufSize, /* In */
UDISizeT *CountDone /* Out */
));
UDIError UDIGetStderr UDIParams((
UDIHostMemPtr Buf, /* Out */
UDISizeT BufSize, /* In */
UDISizeT *CountDone /* Out */
));
UDIError UDIPutStdin UDIParams((
UDIHostMemPtr Buf, /* In */
UDISizeT Count, /* In */
UDISizeT *CountDone /* Out */
));
UDIError UDIStdinMode UDIParams((
UDIMode *Mode /* Out */
));
UDIError UDIPutTrans UDIParams((
UDIHostMemPtr Buf, /* In */
UDISizeT Count, /* In */
UDISizeT *CountDone /* Out */
));
UDIError UDIGetTrans UDIParams((
UDIHostMemPtr Buf, /* Out */
UDISizeT BufSize, /* In */
UDISizeT *CountDone /* Out */
));
UDIError UDITransMode UDIParams((
UDIMode *Mode /* Out */
));
|