1 /******************************************************************************
2 * Copyright 1991 Advanced Micro Devices, Inc.
4 * This software is the property of Advanced Micro Devices, Inc (AMD) which
5 * specifically grants the user the right to modify, use and distribute this
6 * software provided this notice is not removed or altered. All other rights
9 * AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
10 * SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
11 * DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
12 * USE OF THIS SOFTWARE.
14 * Comments about this software should be directed to udi@amd.com. If access
15 * to electronic mail isn't available, send mail to:
17 * Advanced Micro Devices, Inc.
18 * 29K Support Products
20 * 5900 E. Ben White Blvd.
23 * For more detailed information about the values, types, and functions
24 * defined and declared here, see the corresponding UDI spec available
25 * from AMD at the address above.
26 *****************************************************************************
28 * $Id: @(#)udiproc.h 2.11, AMD
31 /* local type decs. and macro defs. not in a .h file ************* MACRO/TYPE
33 #include "udiphcfg.h" /* Get host specific configuration */
34 #include "udiptcfg.h" /* Get target specific configuration */
36 /* Here are all of the CPU Families for which UDI is currently defined */
37 #define Am29K 1 /* AMD's Am290xx and Am292xx parts */
39 typedef UDIInt UDIError
;
40 typedef UDIInt UDISessionId
;
41 typedef UDIInt UDIPId
;
42 typedef UDIInt UDIStepType
;
43 typedef UDIInt UDIBreakType
;
44 typedef UDIUInt UDIBreakId
;
45 typedef UDIUInt UDIMode
;
66 /* Values for UDIStepType parameters */
67 #define UDIStepNatural 0x0000
68 #define UDIStepOverTraps 0x0001
69 #define UDIStepOverCalls 0x0002
70 #define UDIStepInRange 0x0004
71 #define UDIStepNatural 0x0000
73 /* Values for UDIBreakType parameters */
74 #define UDIBreakFlagExecute 0x0001
75 #define UDIBreakFlagRead 0x0002
76 #define UDIBreakFlagWrite 0x0004
77 #define UDIBreakFlagFetch 0x0008
79 /* Special values for UDIWait MaxTime parameter */
80 #define UDIWaitForever (UDIInt32) -1 /* Infinite time delay */
82 /* Special values for PId */
83 #define UDIProcessProcessor -1 /* Raw Hardware, if possible */
85 /* Values for UDIWait StopReason */
86 #define UDIGrossState 0xff
87 #define UDITrapped 0 /* Fine state - which trap */
88 #define UDINotExecuting 1
95 #define UDIStdoutReady 8 /* fine state - size */
96 #define UDIStderrReady 9 /* fine state - size */
97 #define UDIStdinNeeded 10 /* fine state - size */
98 #define UDIStdinModeX 11 /* fine state - mode */
99 #define UDIBreak 12 /* Fine state - Breakpoint Id */
100 #define UDIExited 13 /* Fine state - exit code */
102 /* Enumerate the return values from the callback function
103 for UDIEnumerateTIPs.
105 #define UDITerminateEnumeration 0
106 #define UDIContinueEnumeration 1
108 /* Enumerate values for Terminate parameter to UDIDisconnect */
109 #define UDITerminateSession 1
110 #define UDIContinueSession 0
113 #define UDINoError 0 /* No error occured */
114 #define UDIErrorNoSuchConfiguration 1
115 #define UDIErrorCantHappen 2
116 #define UDIErrorCantConnect 3
117 #define UDIErrorNoSuchConnection 4
118 #define UDIErrorNoConnection 5
119 #define UDIErrorCantOpenConfigFile 6
120 #define UDIErrorCantStartTIP 7
121 #define UDIErrorConnectionUnavailable 8
122 #define UDIErrorTryAnotherTIP 9
123 #define UDIErrorExecutableNotTIP 10
124 #define UDIErrorInvalidTIPOption 11
125 #define UDIErrorCantDisconnect 12
126 #define UDIErrorUnknownError 13
127 #define UDIErrorCantCreateProcess 14
128 #define UDIErrorNoSuchProcess 15
129 #define UDIErrorUnknownResourceSpace 16
130 #define UDIErrorInvalidResource 17
131 #define UDIErrorUnsupportedStepType 18
132 #define UDIErrorCantSetBreakpoint 19
133 #define UDIErrorTooManyBreakpoints 20
134 #define UDIErrorInvalidBreakId 21
135 #define UDIErrorNoMoreBreakIds 22
136 #define UDIErrorUnsupportedService 23
137 #define UDIErrorTryAgain 24
138 #define UDIErrorIPCLimitation 25
139 #define UDIErrorIncomplete 26
140 #define UDIErrorAborted 27
141 #define UDIErrorTransDone 28
142 #define UDIErrorCantAccept 29
143 #define UDIErrorTransInputNeeded 30
144 #define UDIErrorTransModeX 31
145 #define UDIErrorInvalidSize 32
146 #define UDIErrorBadConfigFileEntry 33
147 #define UDIErrorIPCInternal 34
150 /****************************************************************** PROCEDURES
153 UDIError UDIConnect
UDIParams((
154 char *Configuration
, /* In */
155 UDISessionId
*Session
/* Out */
158 UDIError UDIDisconnect
UDIParams((
159 UDISessionId Session
, /* In */
160 UDIBool Terminate
/* In */
163 UDIError UDISetCurrentConnection
UDIParams((
164 UDISessionId Session
/* In */
167 UDIError UDICapabilities
UDIParams((
168 UDIUInt32
*TIPId
, /* Out */
169 UDIUInt32
*TargetId
, /* Out */
170 UDIUInt32 DFEId
, /* In */
171 UDIUInt32 DFE
, /* In */
172 UDIUInt32
*TIP
, /* Out */
173 UDIUInt32
*DFEIPCId
, /* Out */
174 UDIUInt32
*TIPIPCId
, /* Out */
175 char *TIPString
/* Out */
178 UDIError UDIEnumerateTIPs
UDIParams((
179 UDIInt (*UDIETCallback
) /* In */
180 UDIParams(( char *Configuration
)) /* In to callback() */
183 UDIError UDIGetErrorMsg
UDIParams((
184 UDIError ErrorCode
, /* In */
185 UDISizeT MsgSize
, /* In */
187 UDISizeT
*CountDone
/* Out */
190 UDIError UDIGetTargetConfig
UDIParams((
191 UDIMemoryRange KnownMemory
[], /* Out */
192 UDIInt
*NumberOfRanges
, /* In/Out */
193 UDIUInt32 ChipVersions
[], /* Out */
194 UDIInt
*NumberOfChips
/* In/Out */
197 UDIError UDICreateProcess
UDIParams((
198 UDIPId
*PId
/* Out */
201 UDIError UDISetCurrentProcess
UDIParams((
205 UDIError UDIDestroyProcess
UDIParams((
209 UDIError UDIInitializeProcess
UDIParams((
210 UDIMemoryRange ProcessMemory
[], /* In */
211 UDIInt NumberOfRanges
, /* In */
212 UDIResource EntryPoint
, /* In */
213 CPUSizeT StackSizes
[], /* In */
214 UDIInt NumberOfStacks
, /* In */
215 char *ArgString
/* In */
218 UDIError UDIRead
UDIParams((
219 UDIResource From
, /* In */
220 UDIHostMemPtr To
, /* Out */
221 UDICount Count
, /* In */
222 UDISizeT Size
, /* In */
223 UDICount
*CountDone
, /* Out */
224 UDIBool HostEndian
/* In */
227 UDIError UDIWrite
UDIParams((
228 UDIHostMemPtr From
, /* In */
229 UDIResource To
, /* In */
230 UDICount Count
, /* In */
231 UDISizeT Size
, /* In */
232 UDICount
*CountDone
, /* Out */
233 UDIBool HostEndian
/* In */
236 UDIError UDICopy
UDIParams((
237 UDIResource From
, /* In */
238 UDIResource To
, /* In */
239 UDICount Count
, /* In */
240 UDISizeT Size
, /* In */
241 UDICount
*CountDone
, /* Out */
242 UDIBool Direction
/* In */
245 UDIError UDIExecute
UDIParams((
249 UDIError UDIStep
UDIParams((
250 UDIUInt32 Steps
, /* In */
251 UDIStepType StepType
, /* In */
252 UDIRange Range
/* In */
255 UDIVoid UDIStop
UDIParams((
259 UDIError UDIWait
UDIParams((
260 UDIInt32 MaxTime
, /* In */
261 UDIPId
*PId
, /* Out */
262 UDIUInt32
*StopReason
/* Out */
265 UDIError UDISetBreakpoint
UDIParams((
266 UDIResource Addr
, /* In */
267 UDIInt32 PassCount
, /* In */
268 UDIBreakType Type
, /* In */
269 UDIBreakId
*BreakId
/* Out */
272 UDIError UDIQueryBreakpoint
UDIParams((
273 UDIBreakId BreakId
, /* In */
274 UDIResource
*Addr
, /* Out */
275 UDIInt32
*PassCount
, /* Out */
276 UDIBreakType
*Type
, /* Out */
277 UDIInt32
*CurrentCount
/* Out */
280 UDIError UDIClearBreakpoint
UDIParams((
281 UDIBreakId BreakId
/* In */
284 UDIError UDIGetStdout
UDIParams((
285 UDIHostMemPtr Buf
, /* Out */
286 UDISizeT BufSize
, /* In */
287 UDISizeT
*CountDone
/* Out */
290 UDIError UDIGetStderr
UDIParams((
291 UDIHostMemPtr Buf
, /* Out */
292 UDISizeT BufSize
, /* In */
293 UDISizeT
*CountDone
/* Out */
296 UDIError UDIPutStdin
UDIParams((
297 UDIHostMemPtr Buf
, /* In */
298 UDISizeT Count
, /* In */
299 UDISizeT
*CountDone
/* Out */
302 UDIError UDIStdinMode
UDIParams((
303 UDIMode
*Mode
/* Out */
306 UDIError UDIPutTrans
UDIParams((
307 UDIHostMemPtr Buf
, /* In */
308 UDISizeT Count
, /* In */
309 UDISizeT
*CountDone
/* Out */
312 UDIError UDIGetTrans
UDIParams((
313 UDIHostMemPtr Buf
, /* Out */
314 UDISizeT BufSize
, /* In */
315 UDISizeT
*CountDone
/* Out */
318 UDIError UDITransMode
UDIParams((
319 UDIMode
*Mode
/* Out */