OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [VER_5_3/] [gdb-5.3/] [gdb/] [config/] [i960/] [tm-i960.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1181 sfurman
// OBSOLETE /* Parameters for target machine Intel 960, for GDB, the GNU debugger.
2
// OBSOLETE 
3
// OBSOLETE    Copyright 1990, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002 Free
4
// OBSOLETE    Software Foundation, Inc.
5
// OBSOLETE 
6
// OBSOLETE    Contributed by Intel Corporation.
7
// OBSOLETE    This file is part of GDB.
8
// OBSOLETE 
9
// OBSOLETE    This program is free software; you can redistribute it and/or modify
10
// OBSOLETE    it under the terms of the GNU General Public License as published by
11
// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
12
// OBSOLETE    (at your option) any later version.
13
// OBSOLETE 
14
// OBSOLETE    This program is distributed in the hope that it will be useful,
15
// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
// OBSOLETE    GNU General Public License for more details.
18
// OBSOLETE 
19
// OBSOLETE    You should have received a copy of the GNU General Public License
20
// OBSOLETE    along with this program; if not, write to the Free Software
21
// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
22
// OBSOLETE    Boston, MA 02111-1307, USA.  */
23
// OBSOLETE 
24
// OBSOLETE /* Definitions to target GDB to any i960.  */
25
// OBSOLETE 
26
// OBSOLETE #ifndef I80960
27
// OBSOLETE #define I80960
28
// OBSOLETE #endif
29
// OBSOLETE 
30
// OBSOLETE #include "doublest.h"
31
// OBSOLETE 
32
// OBSOLETE /* Hook for the SYMBOL_CLASS of a parameter when decoding DBX symbol
33
// OBSOLETE    information.  In the i960, parameters can be stored as locals or as
34
// OBSOLETE    args, depending on the type of the debug record.
35
// OBSOLETE 
36
// OBSOLETE    From empirical observation, gcc960 uses N_LSYM to indicate
37
// OBSOLETE    arguments passed in registers and then copied immediately
38
// OBSOLETE    to the frame, and N_PSYM to indicate arguments passed in a
39
// OBSOLETE    g14-relative argument block.  */
40
// OBSOLETE 
41
// OBSOLETE #define     DBX_PARM_SYMBOL_CLASS(type) ((type == N_LSYM)? LOC_LOCAL_ARG: LOC_ARG)
42
// OBSOLETE 
43
// OBSOLETE /* Offset from address of function to start of its code.
44
// OBSOLETE    Zero on most machines.  */
45
// OBSOLETE 
46
// OBSOLETE #define FUNCTION_START_OFFSET 0
47
// OBSOLETE 
48
// OBSOLETE /* Advance ip across any function entry prologue instructions
49
// OBSOLETE    to reach some "real" code.  */
50
// OBSOLETE 
51
// OBSOLETE #define SKIP_PROLOGUE(ip)   (i960_skip_prologue (ip))
52
// OBSOLETE extern CORE_ADDR i960_skip_prologue ();
53
// OBSOLETE 
54
// OBSOLETE /* Immediately after a function call, return the saved ip.
55
// OBSOLETE    Can't always go through the frames for this because on some machines
56
// OBSOLETE    the new frame is not set up until the new function
57
// OBSOLETE    executes some instructions.  */
58
// OBSOLETE 
59
// OBSOLETE #define SAVED_PC_AFTER_CALL(frame) (saved_pc_after_call (frame))
60
// OBSOLETE extern CORE_ADDR saved_pc_after_call ();
61
// OBSOLETE 
62
// OBSOLETE /* Stack grows upward */
63
// OBSOLETE 
64
// OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) > (rhs))
65
// OBSOLETE 
66
// OBSOLETE /* Say how long (ordinary) registers are.  This is a piece of bogosity
67
// OBSOLETE    used in push_word and a few other places; REGISTER_RAW_SIZE is the
68
// OBSOLETE    real way to know how big a register is.  */
69
// OBSOLETE 
70
// OBSOLETE #define REGISTER_SIZE 4
71
// OBSOLETE 
72
// OBSOLETE /* Number of machine registers */
73
// OBSOLETE #define NUM_REGS 40
74
// OBSOLETE 
75
// OBSOLETE /* Initializer for an array of names of registers.
76
// OBSOLETE    There should be NUM_REGS strings in this initializer.  */
77
// OBSOLETE 
78
// OBSOLETE #define REGISTER_NAMES { \
79
// OBSOLETE     /*  0 */ "pfp", "sp",  "rip", "r3",  "r4",  "r5",  "r6",  "r7", \
80
// OBSOLETE     /*  8 */ "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15",\
81
// OBSOLETE     /* 16 */ "g0",  "g1",  "g2",  "g3",  "g4",  "g5",  "g6",  "g7", \
82
// OBSOLETE     /* 24 */ "g8",  "g9",  "g10", "g11", "g12", "g13", "g14", "fp", \
83
// OBSOLETE     /* 32 */ "pcw", "ac",  "tc",  "ip",  "fp0", "fp1", "fp2", "fp3",\
84
// OBSOLETE }
85
// OBSOLETE 
86
// OBSOLETE /* Register numbers of various important registers (used to index
87
// OBSOLETE    into arrays of register names and register values).  */
88
// OBSOLETE 
89
// OBSOLETE #define R0_REGNUM   0               /* First local register           */
90
// OBSOLETE #define SP_REGNUM   1               /* Contains address of top of stack */
91
// OBSOLETE #define RIP_REGNUM  2               /* Return instruction pointer (local r2) */
92
// OBSOLETE #define R15_REGNUM 15               /* Last local register            */
93
// OBSOLETE #define G0_REGNUM  16               /* First global register  */
94
// OBSOLETE #define G13_REGNUM 29               /* g13 - holds struct return address */
95
// OBSOLETE #define G14_REGNUM 30               /* g14 - ptr to arg block / leafproc return address */
96
// OBSOLETE #define FP_REGNUM  31               /* Contains address of executing stack frame */
97
// OBSOLETE #define     PCW_REGNUM 32           /* process control word */
98
// OBSOLETE #define     ACW_REGNUM 33           /* arithmetic control word */
99
// OBSOLETE #define     TCW_REGNUM 34           /* trace control word */
100
// OBSOLETE #define IP_REGNUM  35               /* instruction pointer */
101
// OBSOLETE #define FP0_REGNUM 36               /* First floating point register */
102
// OBSOLETE 
103
// OBSOLETE /* Some registers have more than one name */
104
// OBSOLETE 
105
// OBSOLETE #define PC_REGNUM  IP_REGNUM        /* GDB refers to ip as the Program Counter */
106
// OBSOLETE #define PFP_REGNUM R0_REGNUM        /* Previous frame pointer */
107
// OBSOLETE 
108
// OBSOLETE /* Total amount of space needed to store our copies of the machine's
109
// OBSOLETE    register state, the array `registers'.  */
110
// OBSOLETE #define REGISTER_BYTES ((36*4) + (4*10))
111
// OBSOLETE 
112
// OBSOLETE /* Index within `registers' of the first byte of the space for register N.  */
113
// OBSOLETE 
114
// OBSOLETE #define REGISTER_BYTE(N) ( (N) < FP0_REGNUM ? \
115
// OBSOLETE                             (4*(N)) : ((10*(N)) - (6*FP0_REGNUM)) )
116
// OBSOLETE 
117
// OBSOLETE /* The i960 has register windows, sort of.  */
118
// OBSOLETE 
119
// OBSOLETE extern void i960_get_saved_register (char *raw_buffer,
120
// OBSOLETE                                  int *optimized,
121
// OBSOLETE                                  CORE_ADDR *addrp,
122
// OBSOLETE                                  struct frame_info *frame,
123
// OBSOLETE                                  int regnum,
124
// OBSOLETE                                  enum lval_type *lval);
125
// OBSOLETE 
126
// OBSOLETE #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
127
// OBSOLETE   i960_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval)
128
// OBSOLETE 
129
// OBSOLETE 
130
// OBSOLETE /* Number of bytes of storage in the actual machine representation
131
// OBSOLETE    for register N.  On the i960, all regs are 4 bytes except for floating
132
// OBSOLETE    point, which are 10.  NINDY only sends us 8 byte values for these,
133
// OBSOLETE    which is a pain, but VxWorks handles this correctly, so we must.  */
134
// OBSOLETE 
135
// OBSOLETE #define REGISTER_RAW_SIZE(N)                ( (N) < FP0_REGNUM ? 4 : 10 )
136
// OBSOLETE 
137
// OBSOLETE /* Number of bytes of storage in the program's representation for register N. */
138
// OBSOLETE 
139
// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N)    ( (N) < FP0_REGNUM ? 4 : 8 )
140
// OBSOLETE 
141
// OBSOLETE /* Largest value REGISTER_RAW_SIZE can have.  */
142
// OBSOLETE 
143
// OBSOLETE #define MAX_REGISTER_RAW_SIZE 10
144
// OBSOLETE 
145
// OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have.  */
146
// OBSOLETE 
147
// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 8
148
// OBSOLETE 
149
// OBSOLETE #include "floatformat.h"
150
// OBSOLETE 
151
// OBSOLETE #define TARGET_LONG_DOUBLE_FORMAT &floatformat_i960_ext
152
// OBSOLETE 
153
// OBSOLETE /* Return the GDB type object for the "standard" data type
154
// OBSOLETE    of data in register N.  */
155
// OBSOLETE 
156
// OBSOLETE struct type *i960_register_type (int regnum);
157
// OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) i960_register_type (N)
158
// OBSOLETE 
159
// OBSOLETE /* Macros for understanding function return values... */
160
// OBSOLETE 
161
// OBSOLETE /* Does the specified function use the "struct returning" convention
162
// OBSOLETE    or the "value returning" convention?  The "value returning" convention
163
// OBSOLETE    almost invariably returns the entire value in registers.  The
164
// OBSOLETE    "struct returning" convention often returns the entire value in
165
// OBSOLETE    memory, and passes a pointer (out of or into the function) saying
166
// OBSOLETE    where the value (is or should go).
167
// OBSOLETE 
168
// OBSOLETE    Since this sometimes depends on whether it was compiled with GCC,
169
// OBSOLETE    this is also an argument.  This is used in call_function to build a
170
// OBSOLETE    stack, and in value_being_returned to print return values.
171
// OBSOLETE 
172
// OBSOLETE    On i960, a structure is returned in registers g0-g3, if it will fit.
173
// OBSOLETE    If it's more than 16 bytes long, g13 pointed to it on entry.  */
174
// OBSOLETE 
175
// OBSOLETE extern use_struct_convention_fn i960_use_struct_convention;
176
// OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) i960_use_struct_convention (gcc_p, type)
177
// OBSOLETE 
178
// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state
179
// OBSOLETE    a function return value of type TYPE, and copy that, in virtual format,
180
// OBSOLETE    into VALBUF.  This is only called if USE_STRUCT_CONVENTION for this
181
// OBSOLETE    type is 0.
182
// OBSOLETE 
183
// OBSOLETE    On the i960 we just take as many bytes as we need from G0 through G3.  */
184
// OBSOLETE 
185
// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
186
// OBSOLETE     memcpy(VALBUF, REGBUF+REGISTER_BYTE(G0_REGNUM), TYPE_LENGTH (TYPE))
187
// OBSOLETE 
188
// OBSOLETE /* If USE_STRUCT_CONVENTION produces a 1, 
189
// OBSOLETE    extract from an array REGBUF containing the (raw) register state
190
// OBSOLETE    the address in which a function should return its structure value,
191
// OBSOLETE    as a CORE_ADDR (or an expression that can be used as one).
192
// OBSOLETE 
193
// OBSOLETE    Address of where to put structure was passed in in global
194
// OBSOLETE    register g13 on entry.  God knows what's in g13 now.  The
195
// OBSOLETE    (..., 0) below is to make it appear to return a value, though
196
// OBSOLETE    actually all it does is call error().  */
197
// OBSOLETE 
198
// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
199
// OBSOLETE    (error("Don't know where large structure is returned on i960"), 0)
200
// OBSOLETE 
201
// OBSOLETE /* Write into appropriate registers a function return value
202
// OBSOLETE    of type TYPE, given in virtual format, for "value returning" functions.
203
// OBSOLETE 
204
// OBSOLETE    For 'return' command:  not (yet) implemented for i960.  */
205
// OBSOLETE 
206
// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \
207
// OBSOLETE     error ("Returning values from functions is not implemented in i960 gdb")
208
// OBSOLETE 
209
// OBSOLETE /* Store the address of the place in which to copy the structure the
210
// OBSOLETE    subroutine will return.  This is called from call_function. */
211
// OBSOLETE 
212
// OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \
213
// OBSOLETE     error ("Returning values from functions is not implemented in i960 gdb")
214
// OBSOLETE 
215
// OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame
216
// OBSOLETE    (its caller).  */
217
// OBSOLETE 
218
// OBSOLETE /* FRAME_CHAIN takes a frame's nominal address
219
// OBSOLETE    and produces the frame's chain-pointer.
220
// OBSOLETE 
221
// OBSOLETE    However, if FRAME_CHAIN_VALID returns zero,
222
// OBSOLETE    it means the given frame is the outermost one and has no caller.  */
223
// OBSOLETE 
224
// OBSOLETE /* We cache information about saved registers in the frame structure,
225
// OBSOLETE    to save us from having to re-scan function prologues every time
226
// OBSOLETE    a register in a non-current frame is accessed.  */
227
// OBSOLETE 
228
// OBSOLETE #define EXTRA_FRAME_INFO    \
229
// OBSOLETE     struct frame_saved_regs *fsr;   \
230
// OBSOLETE     CORE_ADDR arg_pointer;
231
// OBSOLETE 
232
// OBSOLETE /* Zero the frame_saved_regs pointer when the frame is initialized,
233
// OBSOLETE    so that FRAME_FIND_SAVED_REGS () will know to allocate and
234
// OBSOLETE    initialize a frame_saved_regs struct the first time it is called.
235
// OBSOLETE    Set the arg_pointer to -1, which is not valid; 0 and other values
236
// OBSOLETE    indicate real, cached values.  */
237
// OBSOLETE 
238
// OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
239
// OBSOLETE     ((fi)->fsr = 0, (fi)->arg_pointer = -1)
240
// OBSOLETE 
241
// OBSOLETE /* On the i960, we get the chain pointer by reading the PFP saved
242
// OBSOLETE    on the stack and clearing the status bits.  */
243
// OBSOLETE 
244
// OBSOLETE #define FRAME_CHAIN(thisframe) \
245
// OBSOLETE   (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf)
246
// OBSOLETE 
247
// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
248
// OBSOLETE    and has no caller.
249
// OBSOLETE 
250
// OBSOLETE    On the i960, each various target system type must define FRAME_CHAIN_VALID,
251
// OBSOLETE    since it differs between NINDY and VxWorks, the two currently supported
252
// OBSOLETE    targets types.  We leave it undefined here.  */
253
// OBSOLETE 
254
// OBSOLETE 
255
// OBSOLETE /* A macro that tells us whether the function invocation represented
256
// OBSOLETE    by FI does not have a frame on the stack associated with it.  If it
257
// OBSOLETE    does not, FRAMELESS is set to 1, else 0.  */
258
// OBSOLETE 
259
// OBSOLETE CORE_ADDR leafproc_return (CORE_ADDR ip);
260
// OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \
261
// OBSOLETE   (leafproc_return ((FI)->pc) != 0)
262
// OBSOLETE 
263
// OBSOLETE /* Note that in the i960 architecture the return pointer is saved in the
264
// OBSOLETE    *caller's* stack frame.
265
// OBSOLETE 
266
// OBSOLETE    Make sure to zero low-order bits because of bug in 960CA A-step part
267
// OBSOLETE    (instruction addresses should always be word-aligned anyway).  */
268
// OBSOLETE 
269
// OBSOLETE #define FRAME_SAVED_PC(frame) \
270
// OBSOLETE                     ((read_memory_integer(FRAME_CHAIN(frame)+8,4)) & ~3)
271
// OBSOLETE 
272
// OBSOLETE /* On the i960, FRAME_ARGS_ADDRESS should return the value of
273
// OBSOLETE    g14 as passed into the frame, if known.  We need a function for this.
274
// OBSOLETE    We cache this value in the frame info if we've already looked it up.  */
275
// OBSOLETE 
276
// OBSOLETE #define FRAME_ARGS_ADDRESS(fi)      \
277
// OBSOLETE   (((fi)->arg_pointer != -1)? (fi)->arg_pointer: frame_args_address (fi, 0))
278
// OBSOLETE extern CORE_ADDR frame_args_address ();             /* i960-tdep.c */
279
// OBSOLETE 
280
// OBSOLETE /* This is the same except it should return 0 when
281
// OBSOLETE    it does not really know where the args are, rather than guessing.
282
// OBSOLETE    This value is not cached since it is only used infrequently.  */
283
// OBSOLETE 
284
// OBSOLETE #define     FRAME_ARGS_ADDRESS_CORRECT(fi)  (frame_args_address (fi, 1))
285
// OBSOLETE 
286
// OBSOLETE #define FRAME_LOCALS_ADDRESS(fi)    (fi)->frame
287
// OBSOLETE 
288
// OBSOLETE /* Set NUMARGS to the number of args passed to a frame.
289
// OBSOLETE    Can return -1, meaning no way to tell.  */
290
// OBSOLETE 
291
// OBSOLETE #define FRAME_NUM_ARGS(fi)  (-1)
292
// OBSOLETE 
293
// OBSOLETE /* Return number of bytes at start of arglist that are not really args.  */
294
// OBSOLETE 
295
// OBSOLETE #define FRAME_ARGS_SKIP 0
296
// OBSOLETE 
297
// OBSOLETE /* Produce the positions of the saved registers in a stack frame.  */
298
// OBSOLETE 
299
// OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \
300
// OBSOLETE     frame_find_saved_regs (frame_info_addr, &sr)
301
// OBSOLETE extern void frame_find_saved_regs ();       /* See i960-tdep.c */
302
// OBSOLETE 
303
// OBSOLETE /* Things needed for making calls to functions in the inferior process */
304
// OBSOLETE 
305
// OBSOLETE /* Push an empty stack frame, to record the current ip, etc.
306
// OBSOLETE 
307
// OBSOLETE    Not (yet?) implemented for i960.  */
308
// OBSOLETE 
309
// OBSOLETE #define PUSH_DUMMY_FRAME    \
310
// OBSOLETE error("Function calls into the inferior process are not supported on the i960")
311
// OBSOLETE 
312
// OBSOLETE /* Discard from the stack the innermost frame, restoring all registers.  */
313
// OBSOLETE 
314
// OBSOLETE 
315
// OBSOLETE void i960_pop_frame (void);
316
// OBSOLETE #define POP_FRAME \
317
// OBSOLETE     i960_pop_frame ()
318
// OBSOLETE 
319
// OBSOLETE 
320
// OBSOLETE /* This sequence of words is the instructions
321
// OBSOLETE 
322
// OBSOLETE    callx 0x00000000
323
// OBSOLETE    fmark
324
// OBSOLETE  */
325
// OBSOLETE 
326
// OBSOLETE /* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */
327
// OBSOLETE 
328
// OBSOLETE                                                                                                                                                         /* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */
329
// OBSOLETE 
330
// OBSOLETE /* Indicate that we don't support calling inferior child functions.  */
331
// OBSOLETE 
332
// OBSOLETE #undef CALL_DUMMY
333
// OBSOLETE 
334
// OBSOLETE /* Insert the specified number of args and function address
335
// OBSOLETE    into a call sequence of the above form stored at 'dummyname'.
336
// OBSOLETE 
337
// OBSOLETE    Ignore arg count on i960.  */
338
// OBSOLETE 
339
// OBSOLETE /* #define FIX_CALL_DUMMY(dummyname, fun, nargs) *(((int *)dummyname)+1) = fun */
340
// OBSOLETE 
341
// OBSOLETE #undef FIX_CALL_DUMMY
342
// OBSOLETE 
343
// OBSOLETE 
344
// OBSOLETE /* Interface definitions for kernel debugger KDB */
345
// OBSOLETE /* (Not relevant to i960.) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.