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