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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.3/] [gdb/] [config/] [arc/] [tm-arc.h] - Blame information for rev 1773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1181 sfurman
// OBSOLETE /* Parameters for target machine ARC, for GDB, the GNU debugger.
2
// OBSOLETE    Copyright 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
3
// OBSOLETE    Contributed by Cygnus Support.
4
// OBSOLETE 
5
// OBSOLETE    This file is part of GDB.
6
// OBSOLETE 
7
// OBSOLETE    This program is free software; you can redistribute it and/or modify
8
// OBSOLETE    it under the terms of the GNU General Public License as published by
9
// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
10
// OBSOLETE    (at your option) any later version.
11
// OBSOLETE 
12
// OBSOLETE    This program is distributed in the hope that it will be useful,
13
// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
// OBSOLETE    GNU General Public License for more details.
16
// OBSOLETE 
17
// OBSOLETE    You should have received a copy of the GNU General Public License
18
// OBSOLETE    along with this program; if not, write to the Free Software
19
// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
20
// OBSOLETE    Boston, MA 02111-1307, USA.  */
21
// OBSOLETE 
22
// OBSOLETE #include "regcache.h"
23
// OBSOLETE 
24
// OBSOLETE /* Used by arc-tdep.c to set the default cpu type.  */
25
// OBSOLETE #define DEFAULT_ARC_CPU_TYPE "base"
26
// OBSOLETE 
27
// OBSOLETE /* Offset from address of function to start of its code.
28
// OBSOLETE    Zero on most machines.  */
29
// OBSOLETE #define FUNCTION_START_OFFSET 0
30
// OBSOLETE 
31
// OBSOLETE /* Advance PC across any function entry prologue instructions
32
// OBSOLETE    to reach some "real" code.  */
33
// OBSOLETE 
34
// OBSOLETE #define SKIP_PROLOGUE(pc) (arc_skip_prologue (pc, 0))
35
// OBSOLETE extern CORE_ADDR arc_skip_prologue (CORE_ADDR, int);
36
// OBSOLETE 
37
// OBSOLETE #define PROLOGUE_FRAMELESS_P(pc) arc_prologue_frameless_p(pc)
38
// OBSOLETE extern int arc_prologue_frameless_p (CORE_ADDR);
39
// OBSOLETE 
40
// OBSOLETE /* Sequence of bytes for breakpoint instruction.
41
// OBSOLETE    ??? The current value is "sr -1,[-1]" and is for the simulator only.
42
// OBSOLETE    The simulator watches for this and does the right thing.
43
// OBSOLETE    The hardware version will have to associate with each breakpoint
44
// OBSOLETE    the sequence "flag 1; nop; nop; nop".  IE: The breakpoint insn will not
45
// OBSOLETE    be a fixed set of bits but instead will be a branch to a semi-random
46
// OBSOLETE    address.  Presumably this will be cleaned up for "second silicon".  */
47
// OBSOLETE #define BIG_BREAKPOINT { 0x12, 0x1f, 0xff, 0xff }
48
// OBSOLETE #define LITTLE_BREAKPOINT { 0xff, 0xff, 0x1f, 0x12 }
49
// OBSOLETE 
50
// OBSOLETE /* Given the exposed pipeline, there isn't any one correct value.
51
// OBSOLETE    However, this value must be 4.  GDB can't handle any other value (other than
52
// OBSOLETE    zero).  See for example infrun.c:
53
// OBSOLETE    "prev_pc != stop_pc - DECR_PC_AFTER_BREAK"  */
54
// OBSOLETE /* FIXME */
55
// OBSOLETE #define DECR_PC_AFTER_BREAK 8
56
// OBSOLETE 
57
// OBSOLETE /* We don't have a reliable single step facility.
58
// OBSOLETE    ??? We do have a cycle single step facility, but that won't work.  */
59
// OBSOLETE #define SOFTWARE_SINGLE_STEP_P() 1
60
// OBSOLETE extern void arc_software_single_step (enum target_signal, int);
61
// OBSOLETE #define SOFTWARE_SINGLE_STEP(sig,bp_p) arc_software_single_step (sig, bp_p)
62
// OBSOLETE 
63
// OBSOLETE /* FIXME: Need to set STEP_SKIPS_DELAY.  */
64
// OBSOLETE 
65
// OBSOLETE /* Given a pc value as defined by the hardware, return the real address.
66
// OBSOLETE    Remember that on the ARC blink contains that status register which
67
// OBSOLETE    includes PC + flags (so we have to mask out the flags).  */
68
// OBSOLETE #define ARC_PC_TO_REAL_ADDRESS(pc) (((pc) & 0xffffff) << 2)
69
// OBSOLETE 
70
// OBSOLETE /* Immediately after a function call, return the saved pc.
71
// OBSOLETE    Can't always go through the frames for this because on some machines
72
// OBSOLETE    the new frame is not set up until the new function
73
// OBSOLETE    executes some instructions.  */
74
// OBSOLETE 
75
// OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \
76
// OBSOLETE   (ARC_PC_TO_REAL_ADDRESS (read_register (BLINK_REGNUM)))
77
// OBSOLETE 
78
// OBSOLETE /* Stack grows upward */
79
// OBSOLETE 
80
// OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
81
// OBSOLETE 
82
// OBSOLETE /* Say how long (ordinary) registers are.  This is a piece of bogosity
83
// OBSOLETE    used in push_word and a few other places; REGISTER_RAW_SIZE is the
84
// OBSOLETE    real way to know how big a register is.  */
85
// OBSOLETE #define REGISTER_SIZE 4
86
// OBSOLETE 
87
// OBSOLETE /* Number of machine registers */
88
// OBSOLETE #define NUM_REGS 92
89
// OBSOLETE 
90
// OBSOLETE /* Initializer for an array of names of registers.
91
// OBSOLETE    There should be NUM_REGS strings in this initializer.  */
92
// OBSOLETE 
93
// OBSOLETE #define REGISTER_NAMES \
94
// OBSOLETE { \
95
// OBSOLETE     /*  0 */ "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7", \
96
// OBSOLETE     /*  8 */ "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15", \
97
// OBSOLETE     /* 16 */ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
98
// OBSOLETE     /* 24 */ "r24", "r25", "r26", "fp", "sp", "ilink1", "ilink2", "blink", \
99
// OBSOLETE     /* 32 */ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \
100
// OBSOLETE     /* 40 */ "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", \
101
// OBSOLETE     /* 48 */ "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \
102
// OBSOLETE     /* 56 */ "r56", "mlo", "mmid", "mhi", "lp_count", \
103
// OBSOLETE     /* 61 */ "status", "sema", "lp_start", "lp_end", "identity", "debug", \
104
// OBSOLETE     /* 67 */ "aux10", "aux11", "aux12", "aux13", "aux14", \
105
// OBSOLETE     /* 72 */ "aux15", "aux16", "aux17", "aux18", "aux19", \
106
// OBSOLETE     /* 77 */ "aux1a", "aux1b", "aux1c", "aux1d", "aux1e", \
107
// OBSOLETE     /* 82 */ "aux1f", "aux20", "aux21", "aux22", \
108
// OBSOLETE     /* 86 */ "aux30", "aux31", "aux32", "aux33", "aux40", \
109
// OBSOLETE     /* 91 */ "pc" \
110
// OBSOLETE }
111
// OBSOLETE 
112
// OBSOLETE /* Register numbers of various important registers (used to index
113
// OBSOLETE    into arrays of register names and register values).  */
114
// OBSOLETE 
115
// OBSOLETE #define R0_REGNUM   0               /* First local register           */
116
// OBSOLETE #define R59_REGNUM 59               /* Last local register            */
117
// OBSOLETE #define FP_REGNUM  27               /* Contains address of executing stack frame */
118
// OBSOLETE #define SP_REGNUM  28               /* stack pointer */
119
// OBSOLETE #define BLINK_REGNUM 31             /* link register */
120
// OBSOLETE #define     STA_REGNUM 61           /* processor status word */
121
// OBSOLETE #define PC_REGNUM  91               /* instruction pointer */
122
// OBSOLETE #define AUX_BEG_REGNUM  61  /* aux reg begins */
123
// OBSOLETE #define AUX_END_REGNUM  90  /* aux reg ends, pc not real aux reg */
124
// OBSOLETE 
125
// OBSOLETE /* Fake registers used to mark immediate data.  */
126
// OBSOLETE #define SHIMM_FLAG_REGNUM 61
127
// OBSOLETE #define LIMM_REGNUM 62
128
// OBSOLETE #define SHIMM_REGNUM 63
129
// OBSOLETE 
130
// OBSOLETE #define AUX_REG_MAP \
131
// OBSOLETE { \
132
// OBSOLETE    {  0,  1,  2,  3,  4,  5, \
133
// OBSOLETE      16, -1, -1, -1, -1, \
134
// OBSOLETE      -1, -1, -1, -1, -1, \
135
// OBSOLETE      -1, -1, -1, -1, 30, \
136
// OBSOLETE      -1, 32, 33, -1, \
137
// OBSOLETE       48, 49, 50, 51, 64, \
138
// OBSOLETE       0 \
139
// OBSOLETE     }, \
140
// OBSOLETE    {  0,  1,  2,  3,  4,  5, \
141
// OBSOLETE      16, -1, -1, -1, -1, \
142
// OBSOLETE      -1, -1, -1, -1, -1, \
143
// OBSOLETE      -1, -1, -1, -1, 30, \
144
// OBSOLETE      31, 32, 33, -1, \
145
// OBSOLETE      -1, -1, -1, -1, -1, \
146
// OBSOLETE       0 \
147
// OBSOLETE     }, \
148
// OBSOLETE    {  0,  1,  2,  3,  4,  5, \
149
// OBSOLETE       16, 17, 18, 19, 20, \
150
// OBSOLETE       21, 22, 23, 24, 25, \
151
// OBSOLETE       26, 27, 28, 29, 30, \
152
// OBSOLETE       31, 32, 33, 34, \
153
// OBSOLETE      -1, -1, -1, -1, -1, \
154
// OBSOLETE       0 \
155
// OBSOLETE     } \
156
// OBSOLETE }
157
// OBSOLETE 
158
// OBSOLETE #define PFP_REGNUM R0_REGNUM        /* Previous frame pointer */
159
// OBSOLETE 
160
// OBSOLETE /* Total amount of space needed to store our copies of the machine's
161
// OBSOLETE    register state, the array `registers'.  */
162
// OBSOLETE #define REGISTER_BYTES (NUM_REGS * 4)
163
// OBSOLETE 
164
// OBSOLETE /* Index within `registers' of the first byte of the space for register N.  */
165
// OBSOLETE #define REGISTER_BYTE(N) (4*(N))
166
// OBSOLETE 
167
// OBSOLETE /* Number of bytes of storage in the actual machine representation
168
// OBSOLETE    for register N. */
169
// OBSOLETE #define REGISTER_RAW_SIZE(N) 4
170
// OBSOLETE 
171
// OBSOLETE /* Number of bytes of storage in the program's representation for register N. */
172
// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) 4
173
// OBSOLETE 
174
// OBSOLETE /* Largest value REGISTER_RAW_SIZE can have.  */
175
// OBSOLETE #define MAX_REGISTER_RAW_SIZE 4
176
// OBSOLETE 
177
// OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have.  */
178
// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 4
179
// OBSOLETE 
180
// OBSOLETE /* Return the GDB type object for the "standard" data type
181
// OBSOLETE    of data in register N.  */
182
// OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int)
183
// OBSOLETE 
184
// OBSOLETE 
185
// OBSOLETE /* Macros for understanding function return values... */
186
// OBSOLETE 
187
// OBSOLETE /* Does the specified function use the "struct returning" convention
188
// OBSOLETE    or the "value returning" convention?  The "value returning" convention
189
// OBSOLETE    almost invariably returns the entire value in registers.  The
190
// OBSOLETE    "struct returning" convention often returns the entire value in
191
// OBSOLETE    memory, and passes a pointer (out of or into the function) saying
192
// OBSOLETE    where the value (is or should go).
193
// OBSOLETE 
194
// OBSOLETE    Since this sometimes depends on whether it was compiled with GCC,
195
// OBSOLETE    this is also an argument.  This is used in call_function to build a
196
// OBSOLETE    stack, and in value_being_returned to print return values.
197
// OBSOLETE 
198
// OBSOLETE    On arc, a structure is always retunred with pointer in r0. */
199
// OBSOLETE 
200
// OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) 1
201
// OBSOLETE 
202
// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state
203
// OBSOLETE    a function return value of type TYPE, and copy that, in virtual format,
204
// OBSOLETE    into VALBUF.  This is only called if USE_STRUCT_CONVENTION for this
205
// OBSOLETE    type is 0.
206
// OBSOLETE  */
207
// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
208
// OBSOLETE     memcpy(VALBUF, REGBUF+REGISTER_BYTE(R0_REGNUM), TYPE_LENGTH (TYPE))
209
// OBSOLETE 
210
// OBSOLETE /* If USE_STRUCT_CONVENTION produces a 1, 
211
// OBSOLETE    extract from an array REGBUF containing the (raw) register state
212
// OBSOLETE    the address in which a function should return its structure value,
213
// OBSOLETE    as a CORE_ADDR (or an expression that can be used as one). */
214
// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
215
// OBSOLETE    (error("Don't know where large structure is returned on arc"), 0)
216
// OBSOLETE 
217
// OBSOLETE /* Write into appropriate registers a function return value
218
// OBSOLETE    of type TYPE, given in virtual format, for "value returning" functions.
219
// OBSOLETE    For 'return' command:  not (yet) implemented for arc.  */
220
// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \
221
// OBSOLETE     error ("Returning values from functions is not implemented in arc gdb")
222
// OBSOLETE 
223
// OBSOLETE /* Store the address of the place in which to copy the structure the
224
// OBSOLETE    subroutine will return.  This is called from call_function. */
225
// OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \
226
// OBSOLETE     error ("Returning values from functions is not implemented in arc gdb")
227
// OBSOLETE 
228
// OBSOLETE 
229
// OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame
230
// OBSOLETE    (its caller).  */
231
// OBSOLETE 
232
// OBSOLETE /* We cache information about saved registers in the frame structure,
233
// OBSOLETE    to save us from having to re-scan function prologues every time
234
// OBSOLETE    a register in a non-current frame is accessed.  */
235
// OBSOLETE 
236
// OBSOLETE #define EXTRA_FRAME_INFO \
237
// OBSOLETE     struct frame_saved_regs *fsr; \
238
// OBSOLETE     CORE_ADDR arg_pointer;
239
// OBSOLETE 
240
// OBSOLETE /* Zero the frame_saved_regs pointer when the frame is initialized,
241
// OBSOLETE    so that FRAME_FIND_SAVED_REGS () will know to allocate and
242
// OBSOLETE    initialize a frame_saved_regs struct the first time it is called.
243
// OBSOLETE    Set the arg_pointer to -1, which is not valid; 0 and other values
244
// OBSOLETE    indicate real, cached values.  */
245
// OBSOLETE 
246
// OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
247
// OBSOLETE     ((fi)->fsr = 0, (fi)->arg_pointer = -1)
248
// OBSOLETE 
249
// OBSOLETE /* FRAME_CHAIN takes a frame's nominal address
250
// OBSOLETE    and produces the frame's chain-pointer.
251
// OBSOLETE    However, if FRAME_CHAIN_VALID returns zero,
252
// OBSOLETE    it means the given frame is the outermost one and has no caller.  */
253
// OBSOLETE /* On the arc, we get the chain pointer by reading the PFP saved
254
// OBSOLETE    on the stack. */
255
// OBSOLETE /* The PFP and RPC is in fp and fp+4.  */
256
// OBSOLETE 
257
// OBSOLETE #define FRAME_CHAIN(thisframe) \
258
// OBSOLETE   (read_memory_integer (FRAME_FP (thisframe), 4))
259
// OBSOLETE 
260
// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
261
// OBSOLETE    and has no caller.  */
262
// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)
263
// OBSOLETE 
264
// OBSOLETE /* An expression that tells us whether the function invocation represented
265
// OBSOLETE    by FI does not have a frame on the stack associated with it. */
266
// OBSOLETE 
267
// OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \
268
// OBSOLETE      (((FI)->signal_handler_caller) ? 0 : frameless_look_for_prologue (FI))
269
// OBSOLETE 
270
// OBSOLETE /* Where is the PC for a specific frame.
271
// OBSOLETE    A leaf function may never save blink, so we have to check for that here.  */
272
// OBSOLETE 
273
// OBSOLETE #define FRAME_SAVED_PC(frame) (arc_frame_saved_pc (frame))
274
// OBSOLETE struct frame_info;          /* in case frame.h not included yet */
275
// OBSOLETE CORE_ADDR arc_frame_saved_pc (struct frame_info *);
276
// OBSOLETE 
277
// OBSOLETE /* If the argument is on the stack, it will be here.
278
// OBSOLETE    We cache this value in the frame info if we've already looked it up.  */
279
// OBSOLETE /* ??? Is the arg_pointer check necessary?  */
280
// OBSOLETE 
281
// OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \
282
// OBSOLETE   (((fi)->arg_pointer != -1) ? (fi)->arg_pointer : (fi)->frame)
283
// OBSOLETE 
284
// OBSOLETE /* This is the same except it should return 0 when
285
// OBSOLETE    it does not really know where the args are, rather than guessing.
286
// OBSOLETE    This value is not cached since it is only used infrequently.  */
287
// OBSOLETE 
288
// OBSOLETE #define FRAME_LOCALS_ADDRESS(fi)    ((fi)->frame)
289
// OBSOLETE 
290
// OBSOLETE /* Set NUMARGS to the number of args passed to a frame.
291
// OBSOLETE    Can return -1, meaning no way to tell.  */
292
// OBSOLETE 
293
// OBSOLETE #define FRAME_NUM_ARGS(fi)  (-1)
294
// OBSOLETE 
295
// OBSOLETE /* Return number of bytes at start of arglist that are not really args.  */
296
// OBSOLETE 
297
// OBSOLETE #define FRAME_ARGS_SKIP 0
298
// OBSOLETE 
299
// OBSOLETE /* Produce the positions of the saved registers in a stack frame.  */
300
// OBSOLETE 
301
// OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \
302
// OBSOLETE     frame_find_saved_regs (frame_info_addr, &sr)
303
// OBSOLETE extern void frame_find_saved_regs ();       /* See arc-tdep.c */
304
// OBSOLETE 
305
// OBSOLETE 
306
// OBSOLETE /* Things needed for making calls to functions in the inferior process */
307
// OBSOLETE void arc_push_dummy_frame (void);
308
// OBSOLETE #define PUSH_DUMMY_FRAME \
309
// OBSOLETE     arc_push_dummy_frame ()
310
// OBSOLETE 
311
// OBSOLETE /* Discard from the stack the innermost frame, restoring all registers.  */
312
// OBSOLETE void arc_pop_frame (void);
313
// OBSOLETE #define POP_FRAME \
314
// OBSOLETE     arc_pop_frame ()
315
// OBSOLETE 
316
// OBSOLETE /* This sequence of words is the instructions  bl xxxx, flag 1 */
317
// OBSOLETE #define CALL_DUMMY { 0x28000000, 0x1fbe8001 }
318
// OBSOLETE #define CALL_DUMMY_LENGTH 8
319
// OBSOLETE 
320
// OBSOLETE /* Start execution at beginning of dummy */
321
// OBSOLETE #define CALL_DUMMY_START_OFFSET 0
322
// OBSOLETE 
323
// OBSOLETE /* Insert the specified number of args and function address
324
// OBSOLETE    into a call sequence of the above form stored at 'dummyname'. */
325
// OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
326
// OBSOLETE { \
327
// OBSOLETE         int from, to, delta, loc; \
328
// OBSOLETE         loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \
329
// OBSOLETE         from = loc + 4; \
330
// OBSOLETE         to = (int)(fun); \
331
// OBSOLETE         delta = (to - from) >> 2; \
332
// OBSOLETE         *((char *)(dummyname) + 1) = (delta & 0x1); \
333
// OBSOLETE         *((char *)(dummyname) + 2) = ((delta >> 1) & 0xff); \
334
// OBSOLETE         *((char *)(dummyname) + 3) = ((delta >> 9) & 0xff); \
335
// OBSOLETE         *((char *)(dummyname) + 4) = ((delta >> 17) & 0x7); \
336
// OBSOLETE }

powered by: WebSVN 2.1.0

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