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

Subversion Repositories or1k

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

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

Line No. Rev Author Line
1 1181 sfurman
// OBSOLETE /* Target machine description for generic Motorola 88000, for GDB.
2
// OBSOLETE 
3
// OBSOLETE    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1996,
4
// OBSOLETE    1998, 1999, 2000, 2002 Free Software Foundation, Inc.
5
// OBSOLETE 
6
// OBSOLETE    This file is part of GDB.
7
// OBSOLETE 
8
// OBSOLETE    This program is free software; you can redistribute it and/or modify
9
// OBSOLETE    it under the terms of the GNU General Public License as published by
10
// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
11
// OBSOLETE    (at your option) any later version.
12
// OBSOLETE 
13
// OBSOLETE    This program is distributed in the hope that it will be useful,
14
// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
// OBSOLETE    GNU General Public License for more details.
17
// OBSOLETE 
18
// OBSOLETE    You should have received a copy of the GNU General Public License
19
// OBSOLETE    along with this program; if not, write to the Free Software
20
// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
21
// OBSOLETE    Boston, MA 02111-1307, USA.  */
22
// OBSOLETE 
23
// OBSOLETE #include "doublest.h"
24
// OBSOLETE #include "regcache.h"
25
// OBSOLETE 
26
// OBSOLETE /* g++ support is not yet included.  */
27
// OBSOLETE 
28
// OBSOLETE /* We cache information about saved registers in the frame structure,
29
// OBSOLETE    to save us from having to re-scan function prologues every time
30
// OBSOLETE    a register in a non-current frame is accessed.  */
31
// OBSOLETE 
32
// OBSOLETE #define EXTRA_FRAME_INFO    \
33
// OBSOLETE     struct frame_saved_regs *fsr;   \
34
// OBSOLETE     CORE_ADDR locals_pointer;       \
35
// OBSOLETE     CORE_ADDR args_pointer;
36
// OBSOLETE 
37
// OBSOLETE /* Zero the frame_saved_regs pointer when the frame is initialized,
38
// OBSOLETE    so that FRAME_FIND_SAVED_REGS () will know to allocate and
39
// OBSOLETE    initialize a frame_saved_regs struct the first time it is called.
40
// OBSOLETE    Set the arg_pointer to -1, which is not valid; 0 and other values
41
// OBSOLETE    indicate real, cached values.  */
42
// OBSOLETE 
43
// OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
44
// OBSOLETE     init_extra_frame_info (fromleaf, fi)
45
// OBSOLETE extern void init_extra_frame_info ();
46
// OBSOLETE 
47
// OBSOLETE /* Offset from address of function to start of its code.
48
// OBSOLETE    Zero on most machines.  */
49
// OBSOLETE 
50
// OBSOLETE #define FUNCTION_START_OFFSET 0
51
// OBSOLETE 
52
// OBSOLETE /* Advance PC across any function entry prologue instructions
53
// OBSOLETE    to reach some "real" code.  */
54
// OBSOLETE 
55
// OBSOLETE extern CORE_ADDR m88k_skip_prologue (CORE_ADDR);
56
// OBSOLETE #define SKIP_PROLOGUE(frompc) (m88k_skip_prologue (frompc))
57
// OBSOLETE 
58
// OBSOLETE /* The m88k kernel aligns all instructions on 4-byte boundaries.  The
59
// OBSOLETE    kernel also uses the least significant two bits for its own hocus
60
// OBSOLETE    pocus.  When gdb receives an address from the kernel, it needs to
61
// OBSOLETE    preserve those right-most two bits, but gdb also needs to be careful
62
// OBSOLETE    to realize that those two bits are not really a part of the address
63
// OBSOLETE    of an instruction.  Shrug.  */
64
// OBSOLETE 
65
// OBSOLETE extern CORE_ADDR m88k_addr_bits_remove (CORE_ADDR);
66
// OBSOLETE #define ADDR_BITS_REMOVE(addr) m88k_addr_bits_remove (addr)
67
// OBSOLETE 
68
// OBSOLETE /* Immediately after a function call, return the saved pc.
69
// OBSOLETE    Can't always go through the frames for this because on some machines
70
// OBSOLETE    the new frame is not set up until the new function executes
71
// OBSOLETE    some instructions.  */
72
// OBSOLETE 
73
// OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \
74
// OBSOLETE   (ADDR_BITS_REMOVE (read_register (SRP_REGNUM)))
75
// OBSOLETE 
76
// OBSOLETE /* Stack grows downward.  */
77
// OBSOLETE 
78
// OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
79
// OBSOLETE 
80
// OBSOLETE /* Sequence of bytes for breakpoint instruction.  */
81
// OBSOLETE 
82
// OBSOLETE /* instruction 0xF000D1FF is 'tb0 0,r0,511'
83
// OBSOLETE    If Bit bit 0 of r0 is clear (always true),
84
// OBSOLETE    initiate exception processing (trap).
85
// OBSOLETE  */
86
// OBSOLETE #define BREAKPOINT {0xF0, 0x00, 0xD1, 0xFF}
87
// OBSOLETE 
88
// OBSOLETE /* Amount PC must be decremented by after a breakpoint.
89
// OBSOLETE    This is often the number of bytes in BREAKPOINT
90
// OBSOLETE    but not always.  */
91
// OBSOLETE 
92
// OBSOLETE #define DECR_PC_AFTER_BREAK 0
93
// OBSOLETE 
94
// OBSOLETE /* Say how long (ordinary) registers are.  This is a piece of bogosity
95
// OBSOLETE    used in push_word and a few other places; REGISTER_RAW_SIZE is the
96
// OBSOLETE    real way to know how big a register is.  */
97
// OBSOLETE 
98
// OBSOLETE #define REGISTER_SIZE 4
99
// OBSOLETE 
100
// OBSOLETE /* Number of machine registers */
101
// OBSOLETE 
102
// OBSOLETE #define GP_REGS (38)
103
// OBSOLETE #define FP_REGS (32)
104
// OBSOLETE #define NUM_REGS (GP_REGS + FP_REGS)
105
// OBSOLETE 
106
// OBSOLETE /* Initializer for an array of names of registers.
107
// OBSOLETE    There should be NUM_REGS strings in this initializer.  */
108
// OBSOLETE 
109
// OBSOLETE #define REGISTER_NAMES {\
110
// OBSOLETE                       "r0",\
111
// OBSOLETE                       "r1",\
112
// OBSOLETE                       "r2",\
113
// OBSOLETE                       "r3",\
114
// OBSOLETE                       "r4",\
115
// OBSOLETE                       "r5",\
116
// OBSOLETE                       "r6",\
117
// OBSOLETE                       "r7",\
118
// OBSOLETE                       "r8",\
119
// OBSOLETE                       "r9",\
120
// OBSOLETE                       "r10",\
121
// OBSOLETE                       "r11",\
122
// OBSOLETE                       "r12",\
123
// OBSOLETE                       "r13",\
124
// OBSOLETE                       "r14",\
125
// OBSOLETE                       "r15",\
126
// OBSOLETE                       "r16",\
127
// OBSOLETE                       "r17",\
128
// OBSOLETE                       "r18",\
129
// OBSOLETE                       "r19",\
130
// OBSOLETE                       "r20",\
131
// OBSOLETE                       "r21",\
132
// OBSOLETE                       "r22",\
133
// OBSOLETE                       "r23",\
134
// OBSOLETE                       "r24",\
135
// OBSOLETE                       "r25",\
136
// OBSOLETE                       "r26",\
137
// OBSOLETE                       "r27",\
138
// OBSOLETE                       "r28",\
139
// OBSOLETE                       "r29",\
140
// OBSOLETE                       "r30",\
141
// OBSOLETE                       "r31",\
142
// OBSOLETE                       "psr",\
143
// OBSOLETE                       "fpsr",\
144
// OBSOLETE                       "fpcr",\
145
// OBSOLETE                       "sxip",\
146
// OBSOLETE                       "snip",\
147
// OBSOLETE                       "sfip",\
148
// OBSOLETE                       "x0",\
149
// OBSOLETE                       "x1",\
150
// OBSOLETE                       "x2",\
151
// OBSOLETE                       "x3",\
152
// OBSOLETE                       "x4",\
153
// OBSOLETE                       "x5",\
154
// OBSOLETE                       "x6",\
155
// OBSOLETE                       "x7",\
156
// OBSOLETE                       "x8",\
157
// OBSOLETE                       "x9",\
158
// OBSOLETE                       "x10",\
159
// OBSOLETE                       "x11",\
160
// OBSOLETE                       "x12",\
161
// OBSOLETE                       "x13",\
162
// OBSOLETE                       "x14",\
163
// OBSOLETE                       "x15",\
164
// OBSOLETE                       "x16",\
165
// OBSOLETE                       "x17",\
166
// OBSOLETE                       "x18",\
167
// OBSOLETE                       "x19",\
168
// OBSOLETE                       "x20",\
169
// OBSOLETE                       "x21",\
170
// OBSOLETE                       "x22",\
171
// OBSOLETE                       "x23",\
172
// OBSOLETE                       "x24",\
173
// OBSOLETE                       "x25",\
174
// OBSOLETE                       "x26",\
175
// OBSOLETE                       "x27",\
176
// OBSOLETE                       "x28",\
177
// OBSOLETE                       "x29",\
178
// OBSOLETE                       "x30",\
179
// OBSOLETE                       "x31",\
180
// OBSOLETE                       "vbr",\
181
// OBSOLETE                       "dmt0",\
182
// OBSOLETE                       "dmd0",\
183
// OBSOLETE                       "dma0",\
184
// OBSOLETE                       "dmt1",\
185
// OBSOLETE                       "dmd1",\
186
// OBSOLETE                       "dma1",\
187
// OBSOLETE                       "dmt2",\
188
// OBSOLETE                       "dmd2",\
189
// OBSOLETE                       "dma2",\
190
// OBSOLETE                       "sr0",\
191
// OBSOLETE                       "sr1",\
192
// OBSOLETE                       "sr2",\
193
// OBSOLETE                       "sr3",\
194
// OBSOLETE                       "fpecr",\
195
// OBSOLETE                       "fphs1",\
196
// OBSOLETE                       "fpls1",\
197
// OBSOLETE                       "fphs2",\
198
// OBSOLETE                       "fpls2",\
199
// OBSOLETE                       "fppt",\
200
// OBSOLETE                       "fprh",\
201
// OBSOLETE                       "fprl",\
202
// OBSOLETE                       "fpit",\
203
// OBSOLETE                       "fpsr",\
204
// OBSOLETE                       "fpcr",\
205
// OBSOLETE                   }
206
// OBSOLETE 
207
// OBSOLETE 
208
// OBSOLETE /* Register numbers of various important registers.
209
// OBSOLETE    Note that some of these values are "real" register numbers,
210
// OBSOLETE    and correspond to the general registers of the machine,
211
// OBSOLETE    and some are "phony" register numbers which are too large
212
// OBSOLETE    to be actual register numbers as far as the user is concerned
213
// OBSOLETE    but do serve to get the desired values when passed to read_register.  */
214
// OBSOLETE 
215
// OBSOLETE #define R0_REGNUM 0         /* Contains the constant zero */
216
// OBSOLETE #define SRP_REGNUM 1                /* Contains subroutine return pointer */
217
// OBSOLETE #define RV_REGNUM 2         /* Contains simple return values */
218
// OBSOLETE #define SRA_REGNUM 12               /* Contains address of struct return values */
219
// OBSOLETE #define SP_REGNUM 31                /* Contains address of top of stack */
220
// OBSOLETE 
221
// OBSOLETE /* Instruction pointer notes...
222
// OBSOLETE 
223
// OBSOLETE    On the m88100:
224
// OBSOLETE 
225
// OBSOLETE    * cr04 = sxip.  On exception, contains the excepting pc (probably).
226
// OBSOLETE    On rte, is ignored.
227
// OBSOLETE 
228
// OBSOLETE    * cr05 = snip.  On exception, contains the NPC (next pc).  On rte,
229
// OBSOLETE    pc is loaded from here.
230
// OBSOLETE 
231
// OBSOLETE    * cr06 = sfip.  On exception, contains the NNPC (next next pc).  On
232
// OBSOLETE    rte, the NPC is loaded from here.
233
// OBSOLETE 
234
// OBSOLETE    * lower two bits of each are flag bits.  Bit 1 is V means address
235
// OBSOLETE    is valid.  If address is not valid, bit 0 is ignored.  Otherwise,
236
// OBSOLETE    bit 0 is E and asks for an exception to be taken if this
237
// OBSOLETE    instruction is executed.
238
// OBSOLETE 
239
// OBSOLETE    On the m88110:
240
// OBSOLETE 
241
// OBSOLETE    * cr04 = exip.  On exception, contains the address of the excepting
242
// OBSOLETE    pc (always).  On rte, pc is loaded from here.  Bit 0, aka the D
243
// OBSOLETE    bit, is a flag saying that the offending instruction was in a
244
// OBSOLETE    branch delay slot.  If set, then cr05 contains the NPC.
245
// OBSOLETE 
246
// OBSOLETE    * cr05 = enip.  On exception, if the instruction pointed to by cr04
247
// OBSOLETE    was in a delay slot as indicated by the bit 0 of cr04, aka the D
248
// OBSOLETE    bit, the cr05 contains the NPC.  Otherwise ignored.
249
// OBSOLETE 
250
// OBSOLETE    * cr06 is invalid  */
251
// OBSOLETE 
252
// OBSOLETE /* Note that the Harris Unix kernels emulate the m88100's behavior on
253
// OBSOLETE    the m88110.  */
254
// OBSOLETE 
255
// OBSOLETE #define SXIP_REGNUM 35              /* On m88100, Contains Shadow Execute
256
// OBSOLETE                                Instruction Pointer.  */
257
// OBSOLETE #define SNIP_REGNUM 36              /* On m88100, Contains Shadow Next
258
// OBSOLETE                                Instruction Pointer.  */
259
// OBSOLETE #define SFIP_REGNUM 37              /* On m88100, Contains Shadow Fetched
260
// OBSOLETE                                Intruction pointer.  */
261
// OBSOLETE 
262
// OBSOLETE #define EXIP_REGNUM 35              /* On m88110, Contains Exception
263
// OBSOLETE                                Executing Instruction Pointer.  */
264
// OBSOLETE #define ENIP_REGNUM 36              /* On m88110, Contains the Exception
265
// OBSOLETE                                Next Instruction Pointer.  */
266
// OBSOLETE 
267
// OBSOLETE #define PC_REGNUM SXIP_REGNUM       /* Program Counter */
268
// OBSOLETE #define NPC_REGNUM SNIP_REGNUM      /* Next Program Counter */
269
// OBSOLETE #define M88K_NNPC_REGNUM SFIP_REGNUM        /* Next Next Program Counter */
270
// OBSOLETE 
271
// OBSOLETE 
272
// OBSOLETE #define PSR_REGNUM 32               /* Processor Status Register */
273
// OBSOLETE #define FPSR_REGNUM 33              /* Floating Point Status Register */
274
// OBSOLETE #define FPCR_REGNUM 34              /* Floating Point Control Register */
275
// OBSOLETE #define XFP_REGNUM 38               /* First Extended Float Register */
276
// OBSOLETE #define X0_REGNUM XFP_REGNUM        /* Which also contains the constant zero */
277
// OBSOLETE 
278
// OBSOLETE /* This is rather a confusing lie.  Our m88k port using a stack pointer value
279
// OBSOLETE    for the frame address.  Hence, the frame address and the frame pointer are
280
// OBSOLETE    only indirectly related.  The value of this macro is the register number
281
// OBSOLETE    fetched by the machine "independent" portions of gdb when they want to know
282
// OBSOLETE    about a frame address.  Thus, we lie here and claim that FP_REGNUM is
283
// OBSOLETE    SP_REGNUM.  */
284
// OBSOLETE #define FP_REGNUM SP_REGNUM /* Reg fetched to locate frame when pgm stops */
285
// OBSOLETE #define ACTUAL_FP_REGNUM 30
286
// OBSOLETE 
287
// OBSOLETE /* PSR status bit definitions.  */
288
// OBSOLETE 
289
// OBSOLETE #define PSR_MODE            0x80000000
290
// OBSOLETE #define PSR_BYTE_ORDER              0x40000000
291
// OBSOLETE #define PSR_SERIAL_MODE             0x20000000
292
// OBSOLETE #define PSR_CARRY           0x10000000
293
// OBSOLETE #define PSR_SFU_DISABLE             0x000003f0
294
// OBSOLETE #define PSR_SFU1_DISABLE    0x00000008
295
// OBSOLETE #define PSR_MXM                     0x00000004
296
// OBSOLETE #define PSR_IND                     0x00000002
297
// OBSOLETE #define PSR_SFRZ            0x00000001
298
// OBSOLETE 
299
// OBSOLETE 
300
// OBSOLETE 
301
// OBSOLETE /* The following two comments come from the days prior to the m88110
302
// OBSOLETE    port.  The m88110 handles the instruction pointers differently.  I
303
// OBSOLETE    do not know what any m88110 kernels do as the m88110 port I'm
304
// OBSOLETE    working with is for an embedded system.  rich@cygnus.com
305
// OBSOLETE    13-sept-93.  */
306
// OBSOLETE 
307
// OBSOLETE /* BCS requires that the SXIP_REGNUM (or PC_REGNUM) contain the
308
// OBSOLETE    address of the next instr to be executed when a breakpoint occurs.
309
// OBSOLETE    Because the kernel gets the next instr (SNIP_REGNUM), the instr in
310
// OBSOLETE    SNIP needs to be put back into SFIP, and the instr in SXIP should
311
// OBSOLETE    be shifted to SNIP */
312
// OBSOLETE 
313
// OBSOLETE /* Are you sitting down?  It turns out that the 88K BCS (binary
314
// OBSOLETE    compatibility standard) folks originally felt that the debugger
315
// OBSOLETE    should be responsible for backing up the IPs, not the kernel (as is
316
// OBSOLETE    usually done).  Well, they have reversed their decision, and in
317
// OBSOLETE    future releases our kernel will be handling the backing up of the
318
// OBSOLETE    IPs.  So, eventually, we won't need to do the SHIFT_INST_REGS
319
// OBSOLETE    stuff.  But, for now, since there are 88K systems out there that do
320
// OBSOLETE    need the debugger to do the IP shifting, and since there will be
321
// OBSOLETE    systems where the kernel does the shifting, the code is a little
322
// OBSOLETE    more complex than perhaps it needs to be (we still go inside
323
// OBSOLETE    SHIFT_INST_REGS, and if the shifting hasn't occurred then gdb goes
324
// OBSOLETE    ahead and shifts).  */
325
// OBSOLETE 
326
// OBSOLETE extern int target_is_m88110;
327
// OBSOLETE #define SHIFT_INST_REGS() \
328
// OBSOLETE if (!target_is_m88110) \
329
// OBSOLETE { \
330
// OBSOLETE     CORE_ADDR pc = read_register (PC_REGNUM); \
331
// OBSOLETE     CORE_ADDR npc = read_register (NPC_REGNUM); \
332
// OBSOLETE     if (pc != npc) \
333
// OBSOLETE     { \
334
// OBSOLETE     write_register (M88K_NNPC_REGNUM, npc); \
335
// OBSOLETE     write_register (NPC_REGNUM, pc); \
336
// OBSOLETE     } \
337
// OBSOLETE }
338
// OBSOLETE 
339
// OBSOLETE     /* Storing the following registers is a no-op. */
340
// OBSOLETE #define CANNOT_STORE_REGISTER(regno)        (((regno) == R0_REGNUM) \
341
// OBSOLETE                                      || ((regno) == X0_REGNUM))
342
// OBSOLETE 
343
// OBSOLETE   /* Number of bytes of storage in the actual machine representation
344
// OBSOLETE      for register N.  On the m88k,  the general purpose registers are 4
345
// OBSOLETE      bytes and the 88110 extended registers are 10 bytes. */
346
// OBSOLETE 
347
// OBSOLETE #define REGISTER_RAW_SIZE(N) ((N) < XFP_REGNUM ? 4 : 10)
348
// OBSOLETE 
349
// OBSOLETE   /* Total amount of space needed to store our copies of the machine's
350
// OBSOLETE      register state, the array `registers'.  */
351
// OBSOLETE 
352
// OBSOLETE #define REGISTER_BYTES ((GP_REGS * REGISTER_RAW_SIZE(0)) \
353
// OBSOLETE                     + (FP_REGS * REGISTER_RAW_SIZE(XFP_REGNUM)))
354
// OBSOLETE 
355
// OBSOLETE   /* Index within `registers' of the first byte of the space for
356
// OBSOLETE      register N.  */
357
// OBSOLETE 
358
// OBSOLETE #define REGISTER_BYTE(N) (((N) * REGISTER_RAW_SIZE(0)) \
359
// OBSOLETE                       + ((N) >= XFP_REGNUM \
360
// OBSOLETE                          ? (((N) - XFP_REGNUM) \
361
// OBSOLETE                             * REGISTER_RAW_SIZE(XFP_REGNUM)) \
362
// OBSOLETE                          : 0))
363
// OBSOLETE 
364
// OBSOLETE   /* Number of bytes of storage in the program's representation for
365
// OBSOLETE      register N.  On the m88k, all registers are 4 bytes excepting the
366
// OBSOLETE      m88110 extended registers which are 8 byte doubles. */
367
// OBSOLETE 
368
// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) ((N) < XFP_REGNUM ? 4 : 8)
369
// OBSOLETE 
370
// OBSOLETE   /* Largest value REGISTER_RAW_SIZE can have.  */
371
// OBSOLETE 
372
// OBSOLETE #define MAX_REGISTER_RAW_SIZE (REGISTER_RAW_SIZE(XFP_REGNUM))
373
// OBSOLETE 
374
// OBSOLETE   /* Largest value REGISTER_VIRTUAL_SIZE can have.
375
// OBSOLETE      Are FPS1, FPS2, FPR "virtual" regisers? */
376
// OBSOLETE 
377
// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE (REGISTER_RAW_SIZE(XFP_REGNUM))
378
// OBSOLETE 
379
// OBSOLETE /* Return the GDB type object for the "standard" data type
380
// OBSOLETE    of data in register N.  */
381
// OBSOLETE 
382
// OBSOLETE struct type *m88k_register_type (int regnum);
383
// OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) m88k_register_type (N)
384
// OBSOLETE 
385
// OBSOLETE /* The 88k call/return conventions call for "small" values to be returned
386
// OBSOLETE    into consecutive registers starting from r2.  */
387
// OBSOLETE 
388
// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
389
// OBSOLETE   memcpy ((VALBUF), &(((char *)REGBUF)[REGISTER_BYTE(RV_REGNUM)]), TYPE_LENGTH (TYPE))
390
// OBSOLETE 
391
// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
392
// OBSOLETE 
393
// OBSOLETE /* Write into appropriate registers a function return value
394
// OBSOLETE    of type TYPE, given in virtual format.  */
395
// OBSOLETE 
396
// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \
397
// OBSOLETE   write_register_bytes (2*REGISTER_RAW_SIZE(0), (VALBUF), TYPE_LENGTH (TYPE))
398
// OBSOLETE 
399
// OBSOLETE /* In COFF, if PCC says a parameter is a short or a char, do not
400
// OBSOLETE    change it to int (it seems the convention is to change it). */
401
// OBSOLETE 
402
// OBSOLETE #define BELIEVE_PCC_PROMOTION 1
403
// OBSOLETE 
404
// OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame
405
// OBSOLETE    (its caller).  */
406
// OBSOLETE 
407
// OBSOLETE /* FRAME_CHAIN takes a frame's nominal address
408
// OBSOLETE    and produces the frame's chain-pointer.
409
// OBSOLETE 
410
// OBSOLETE    However, if FRAME_CHAIN_VALID returns zero,
411
// OBSOLETE    it means the given frame is the outermost one and has no caller.  */
412
// OBSOLETE 
413
// OBSOLETE extern CORE_ADDR frame_chain ();
414
// OBSOLETE extern int frame_chain_valid ();
415
// OBSOLETE extern int frameless_function_invocation ();
416
// OBSOLETE 
417
// OBSOLETE #define FRAME_CHAIN(thisframe) \
418
// OBSOLETE     frame_chain (thisframe)
419
// OBSOLETE 
420
// OBSOLETE #define     FRAMELESS_FUNCTION_INVOCATION(frame)    \
421
// OBSOLETE     (frameless_function_invocation (frame))
422
// OBSOLETE 
423
// OBSOLETE /* Define other aspects of the stack frame.  */
424
// OBSOLETE 
425
// OBSOLETE #define FRAME_SAVED_PC(FRAME)       \
426
// OBSOLETE     frame_saved_pc (FRAME)
427
// OBSOLETE extern CORE_ADDR frame_saved_pc ();
428
// OBSOLETE 
429
// OBSOLETE #define FRAME_ARGS_ADDRESS(fi)      \
430
// OBSOLETE     frame_args_address (fi)
431
// OBSOLETE extern CORE_ADDR frame_args_address ();
432
// OBSOLETE 
433
// OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) \
434
// OBSOLETE     frame_locals_address (fi)
435
// OBSOLETE extern CORE_ADDR frame_locals_address ();
436
// OBSOLETE 
437
// OBSOLETE /* Return number of args passed to a frame.
438
// OBSOLETE    Can return -1, meaning no way to tell.  */
439
// OBSOLETE 
440
// OBSOLETE #define FRAME_NUM_ARGS(fi)  (-1)
441
// OBSOLETE 
442
// OBSOLETE /* Return number of bytes at start of arglist that are not really args.  */
443
// OBSOLETE 
444
// OBSOLETE #define FRAME_ARGS_SKIP 0
445
// OBSOLETE 
446
// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs,
447
// OBSOLETE    the addresses of the saved registers of frame described by FRAME_INFO.
448
// OBSOLETE    This includes special registers such as pc and fp saved in special
449
// OBSOLETE    ways in the stack frame.  sp is even more special:
450
// OBSOLETE    the address we return for it IS the sp for the next frame.  */
451
// OBSOLETE 
452
// OBSOLETE /* On the 88k, parameter registers get stored into the so called "homing"
453
// OBSOLETE    area.  This *always* happens when you compiled with GCC and use -g.
454
// OBSOLETE    Also, (with GCC and -g) the saving of the parameter register values
455
// OBSOLETE    always happens right within the function prologue code, so these register
456
// OBSOLETE    values can generally be relied upon to be already copied into their
457
// OBSOLETE    respective homing slots by the time you will normally try to look at
458
// OBSOLETE    them (we hope).
459
// OBSOLETE 
460
// OBSOLETE    Note that homing area stack slots are always at *positive* offsets from
461
// OBSOLETE    the frame pointer.  Thus, the homing area stack slots for the parameter
462
// OBSOLETE    registers (passed values) for a given function are actually part of the
463
// OBSOLETE    frame area of the caller.  This is unusual, but it should not present
464
// OBSOLETE    any special problems for GDB.
465
// OBSOLETE 
466
// OBSOLETE    Note also that on the 88k, we are only interested in finding the
467
// OBSOLETE    registers that might have been saved in memory.  This is a subset of
468
// OBSOLETE    the whole set of registers because the standard calling sequence allows
469
// OBSOLETE    the called routine to clobber many registers.
470
// OBSOLETE 
471
// OBSOLETE    We could manage to locate values for all of the so called "preserved"
472
// OBSOLETE    registers (some of which may get saved within any particular frame) but
473
// OBSOLETE    that would require decoding all of the tdesc information.  That would be
474
// OBSOLETE    nice information for GDB to have, but it is not strictly manditory if we
475
// OBSOLETE    can live without the ability to look at values within (or backup to)
476
// OBSOLETE    previous frames.
477
// OBSOLETE  */
478
// OBSOLETE 
479
// OBSOLETE struct frame_saved_regs;
480
// OBSOLETE struct frame_info;
481
// OBSOLETE 
482
// OBSOLETE void frame_find_saved_regs (struct frame_info *fi,
483
// OBSOLETE                         struct frame_saved_regs *fsr);
484
// OBSOLETE 
485
// OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
486
// OBSOLETE         frame_find_saved_regs (frame_info, &frame_saved_regs)
487
// OBSOLETE 
488
// OBSOLETE 
489
// OBSOLETE #define POP_FRAME pop_frame ()
490
// OBSOLETE extern void pop_frame ();
491
// OBSOLETE 
492
// OBSOLETE /* Call function stuff contributed by Kevin Buettner of Motorola.  */
493
// OBSOLETE 
494
// OBSOLETE #define CALL_DUMMY_LOCATION AFTER_TEXT_END
495
// OBSOLETE 
496
// OBSOLETE extern void m88k_push_dummy_frame ();
497
// OBSOLETE #define PUSH_DUMMY_FRAME    m88k_push_dummy_frame()
498
// OBSOLETE 
499
// OBSOLETE #define CALL_DUMMY {                                \
500
// OBSOLETE 0x67ff00c0, /*   0:   subu  #sp,#sp,0xc0 */ \
501
// OBSOLETE 0x243f0004, /*   4:   st    #r1,#sp,0x4 */ \
502
// OBSOLETE 0x245f0008, /*   8:   st    #r2,#sp,0x8 */ \
503
// OBSOLETE 0x247f000c, /*   c:   st    #r3,#sp,0xc */ \
504
// OBSOLETE 0x249f0010, /*  10:   st    #r4,#sp,0x10 */ \
505
// OBSOLETE 0x24bf0014, /*  14:   st    #r5,#sp,0x14 */ \
506
// OBSOLETE 0x24df0018, /*  18:   st    #r6,#sp,0x18 */ \
507
// OBSOLETE 0x24ff001c, /*  1c:   st    #r7,#sp,0x1c */ \
508
// OBSOLETE 0x251f0020, /*  20:   st    #r8,#sp,0x20 */ \
509
// OBSOLETE 0x253f0024, /*  24:   st    #r9,#sp,0x24 */ \
510
// OBSOLETE 0x255f0028, /*  28:   st    #r10,#sp,0x28 */ \
511
// OBSOLETE 0x257f002c, /*  2c:   st    #r11,#sp,0x2c */ \
512
// OBSOLETE 0x259f0030, /*  30:   st    #r12,#sp,0x30 */ \
513
// OBSOLETE 0x25bf0034, /*  34:   st    #r13,#sp,0x34 */ \
514
// OBSOLETE 0x25df0038, /*  38:   st    #r14,#sp,0x38 */ \
515
// OBSOLETE 0x25ff003c, /*  3c:   st    #r15,#sp,0x3c */ \
516
// OBSOLETE 0x261f0040, /*  40:   st    #r16,#sp,0x40 */ \
517
// OBSOLETE 0x263f0044, /*  44:   st    #r17,#sp,0x44 */ \
518
// OBSOLETE 0x265f0048, /*  48:   st    #r18,#sp,0x48 */ \
519
// OBSOLETE 0x267f004c, /*  4c:   st    #r19,#sp,0x4c */ \
520
// OBSOLETE 0x269f0050, /*  50:   st    #r20,#sp,0x50 */ \
521
// OBSOLETE 0x26bf0054, /*  54:   st    #r21,#sp,0x54 */ \
522
// OBSOLETE 0x26df0058, /*  58:   st    #r22,#sp,0x58 */ \
523
// OBSOLETE 0x26ff005c, /*  5c:   st    #r23,#sp,0x5c */ \
524
// OBSOLETE 0x271f0060, /*  60:   st    #r24,#sp,0x60 */ \
525
// OBSOLETE 0x273f0064, /*  64:   st    #r25,#sp,0x64 */ \
526
// OBSOLETE 0x275f0068, /*  68:   st    #r26,#sp,0x68 */ \
527
// OBSOLETE 0x277f006c, /*  6c:   st    #r27,#sp,0x6c */ \
528
// OBSOLETE 0x279f0070, /*  70:   st    #r28,#sp,0x70 */ \
529
// OBSOLETE 0x27bf0074, /*  74:   st    #r29,#sp,0x74 */ \
530
// OBSOLETE 0x27df0078, /*  78:   st    #r30,#sp,0x78 */ \
531
// OBSOLETE 0x63df0000, /*  7c:   addu  #r30,#sp,0x0 */ \
532
// OBSOLETE 0x145f0000, /*  80:   ld    #r2,#sp,0x0 */ \
533
// OBSOLETE 0x147f0004, /*  84:   ld    #r3,#sp,0x4 */ \
534
// OBSOLETE 0x149f0008, /*  88:   ld    #r4,#sp,0x8 */ \
535
// OBSOLETE 0x14bf000c, /*  8c:   ld    #r5,#sp,0xc */ \
536
// OBSOLETE 0x14df0010, /*  90:   ld    #r6,#sp,0x10 */ \
537
// OBSOLETE 0x14ff0014, /*  94:   ld    #r7,#sp,0x14 */ \
538
// OBSOLETE 0x151f0018, /*  98:   ld    #r8,#sp,0x18 */ \
539
// OBSOLETE 0x153f001c, /*  9c:   ld    #r9,#sp,0x1c */ \
540
// OBSOLETE 0x5c200000, /*  a0:   or.u  #r1,#r0,0x0 */ \
541
// OBSOLETE 0x58210000, /*  a4:   or    #r1,#r1,0x0 */ \
542
// OBSOLETE 0xf400c801, /*  a8:   jsr   #r1 */ \
543
// OBSOLETE 0xf000d1ff  /*  ac:   tb0   0x0,#r0,0x1ff */ \
544
// OBSOLETE }
545
// OBSOLETE 
546
// OBSOLETE #define CALL_DUMMY_START_OFFSET 0x80
547
// OBSOLETE #define CALL_DUMMY_LENGTH 0xb0
548
// OBSOLETE 
549
// OBSOLETE /* FIXME: byteswapping.  */
550
// OBSOLETE #define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)    \
551
// OBSOLETE {                                                                   \
552
// OBSOLETE   *(unsigned long *)((char *) (dummy) + 0xa0) |=                    \
553
// OBSOLETE     (((unsigned long) (fun)) >> 16);                                \
554
// OBSOLETE   *(unsigned long *)((char *) (dummy) + 0xa4) |=                    \
555
// OBSOLETE     (((unsigned long) (fun)) & 0xffff);                             \
556
// OBSOLETE }
557
// OBSOLETE 
558
// OBSOLETE /* Stack must be aligned on 64-bit boundaries when synthesizing
559
// OBSOLETE    function calls. */
560
// OBSOLETE 
561
// OBSOLETE #define STACK_ALIGN(addr) (((addr) + 7) & -8)
562
// OBSOLETE 
563
// OBSOLETE #define STORE_STRUCT_RETURN(addr, sp) \
564
// OBSOLETE     write_register (SRA_REGNUM, (addr))
565
// OBSOLETE 
566
// OBSOLETE #define NEED_TEXT_START_END 1
567
// OBSOLETE 
568
// OBSOLETE /* According to the MC88100 RISC Microprocessor User's Manual, section
569
// OBSOLETE    6.4.3.1.2:
570
// OBSOLETE 
571
// OBSOLETE    ... can be made to return to a particular instruction by placing a
572
// OBSOLETE    valid instruction address in the SNIP and the next sequential
573
// OBSOLETE    instruction address in the SFIP (with V bits set and E bits clear).
574
// OBSOLETE    The rte resumes execution at the instruction pointed to by the 
575
// OBSOLETE    SNIP, then the SFIP.
576
// OBSOLETE 
577
// OBSOLETE    The E bit is the least significant bit (bit 0).  The V (valid) bit is
578
// OBSOLETE    bit 1.  This is why we logical or 2 into the values we are writing
579
// OBSOLETE    below.  It turns out that SXIP plays no role when returning from an
580
// OBSOLETE    exception so nothing special has to be done with it.  We could even
581
// OBSOLETE    (presumably) give it a totally bogus value.
582
// OBSOLETE 
583
// OBSOLETE    -- Kevin Buettner
584
// OBSOLETE  */
585
// OBSOLETE 
586
// OBSOLETE extern void m88k_target_write_pc (CORE_ADDR pc, ptid_t ptid);
587
// OBSOLETE #define TARGET_WRITE_PC(VAL, PID) m88k_target_write_pc (VAL, PID)

powered by: WebSVN 2.1.0

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