48d41d355f49efffd0cb613aaa137533dfb7097b
[deliverable/binutils-gdb.git] / gdb / config / pa / tm-hppa64.h
1 /* Parameters for execution on any Hewlett-Packard PA-RISC machine.
2 Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1995, 1999, 2000
3 Free Software Foundation, Inc.
4
5 Contributed by the Center for Software Science at the
6 University of Utah (pa-gdb-bugs@cs.utah.edu).
7
8 This file is part of GDB.
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23
24 /* PA 64-bit specific definitions. Override those which are in
25 tm-hppa.h */
26
27 /* jimb: this must go. I'm just using it to disable code I haven't
28 gotten working yet. */
29 #define GDB_TARGET_IS_HPPA_20W
30
31 /* FIXME: brobecker 2003-04-21: Although 32bit hppa is partially multiarched,
32 the conversion for hppa64 hasn't been completed yet. */
33 #define GDB_MULTI_ARCH 0
34
35 /* FIXME: brobecker 2003-04-21: All the definition from this point until
36 the include of pa/tm-hppah.h are extracted from tm-hppa.h. They have
37 been temporarily moved here, until hppa64 is multiarched too. */
38
39 #if !GDB_MULTI_ARCH
40 extern int hppa_reg_struct_has_addr (int gcc_p, struct type *type);
41 #define REG_STRUCT_HAS_ADDR(gcc_p,type) hppa_reg_struct_has_addr (gcc_p,type)
42 #endif
43
44 /* Offset from address of function to start of its code.
45 Zero on most machines. */
46
47 #if !GDB_MULTI_ARCH
48 #define FUNCTION_START_OFFSET 0
49 #endif
50
51 /* Advance PC across any function entry prologue instructions
52 to reach some "real" code. */
53
54 #if !GDB_MULTI_ARCH
55 extern CORE_ADDR hppa_skip_prologue (CORE_ADDR);
56 #define SKIP_PROLOGUE(pc) (hppa_skip_prologue (pc))
57 #endif
58
59 /* If PC is in some function-call trampoline code, return the PC
60 where the function itself actually starts. If not, return NULL. */
61
62 #if !GDB_MULTI_ARCH
63 #define SKIP_TRAMPOLINE_CODE(pc) hppa_skip_trampoline_code (pc)
64 extern CORE_ADDR hppa_skip_trampoline_code (CORE_ADDR);
65 #endif
66
67 /* Return non-zero if we are in an appropriate trampoline. */
68
69 #if !GDB_MULTI_ARCH
70 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
71 hppa_in_solib_call_trampoline (pc, name)
72 extern int hppa_in_solib_call_trampoline (CORE_ADDR, char *);
73 #endif
74
75 #if !GDB_MULTI_ARCH
76 #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) \
77 hppa_in_solib_return_trampoline (pc, name)
78 extern int hppa_in_solib_return_trampoline (CORE_ADDR, char *);
79 #endif
80
81 #if !GDB_MULTI_ARCH
82 #undef DEPRECATED_SAVED_PC_AFTER_CALL
83 #define DEPRECATED_SAVED_PC_AFTER_CALL(frame) hppa_saved_pc_after_call (frame)
84 extern CORE_ADDR hppa_saved_pc_after_call (struct frame_info *);
85 #endif
86
87 #if !GDB_MULTI_ARCH
88 extern int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
89 #define INNER_THAN(lhs,rhs) hppa_inner_than(lhs,rhs)
90 #endif
91
92 #if !GDB_MULTI_ARCH
93 extern CORE_ADDR hppa_stack_align (CORE_ADDR sp);
94 #define STACK_ALIGN(sp) hppa_stack_align (sp)
95 #endif
96
97 /* Amount PC must be decremented by after a breakpoint.
98 This is often the number of bytes in BREAKPOINT
99 but not always.
100
101 Not on the PA-RISC */
102
103 #if !GDB_MULTI_ARCH
104 #define DECR_PC_AFTER_BREAK 0
105 #endif
106
107 /* Say how long (ordinary) registers are. This is a piece of bogosity
108 used in push_word and a few other places; REGISTER_RAW_SIZE is the
109 real way to know how big a register is. */
110
111 #if !GDB_MULTI_ARCH
112 #define REGISTER_SIZE 4
113 #endif
114
115 /* Number of machine registers */
116
117 #if !GDB_MULTI_ARCH
118 #define NUM_REGS 128
119 #endif
120
121 #if !GDB_MULTI_ARCH
122 #define FP_REGNUM 3 /* Contains address of executing stack */
123 /* frame */
124 #endif
125 #if !GDB_MULTI_ARCH
126 #define SP_REGNUM 30 /* Contains address of top of stack */
127 #endif
128
129 #if !GDB_MULTI_ARCH
130 #define FP0_REGNUM 64 /* floating point reg. 0 (fspr) */
131 #endif
132
133 /* compatibility with the rest of gdb. */
134 #if !GDB_MULTI_ARCH
135 #define PC_REGNUM PCOQ_HEAD_REGNUM
136 #endif
137 #if !GDB_MULTI_ARCH
138 #define NPC_REGNUM PCOQ_TAIL_REGNUM
139 #endif
140
141 /* Number of bytes of storage in the actual machine representation
142 for register N. On the PA-RISC, all regs are 4 bytes, including
143 the FP registers (they're accessed as two 4 byte halves). */
144
145 #if !GDB_MULTI_ARCH
146 extern int hppa_register_raw_size (int reg_nr);
147 #define REGISTER_RAW_SIZE(N) hppa_register_raw_size (N)
148 #endif
149
150 /* Total amount of space needed to store our copies of the machine's
151 register state, the array `registers'. */
152 #if !GDB_MULTI_ARCH
153 #define REGISTER_BYTES (NUM_REGS * 4)
154 #endif
155
156 #if !GDB_MULTI_ARCH
157 extern int hppa_register_byte (int reg_nr);
158 #define REGISTER_BYTE(N) hppa_register_byte (N)
159 #endif
160
161 /* Number of bytes of storage in the program's representation
162 for register N. */
163
164 #if !GDB_MULTI_ARCH
165 #define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
166 #endif
167
168 /* Largest value REGISTER_RAW_SIZE can have. */
169
170 #if !GDB_MULTI_ARCH
171 #define DEPRECATED_MAX_REGISTER_RAW_SIZE 4
172 #endif
173
174 /* Largest value REGISTER_VIRTUAL_SIZE can have. */
175
176 #if !GDB_MULTI_ARCH
177 #define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
178 #endif
179
180 #if !GDB_MULTI_ARCH
181 extern struct type * hppa_register_virtual_type (int reg_nr);
182 #define REGISTER_VIRTUAL_TYPE(N) hppa_register_virtual_type (N)
183 #endif
184
185 #if !GDB_MULTI_ARCH
186 extern void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
187 #define STORE_STRUCT_RETURN(ADDR, SP) hppa_store_struct_return (ADDR, SP)
188 #endif
189
190 /* Extract from an array REGBUF containing the (raw) register state
191 a function return value of type TYPE, and copy that, in virtual format,
192 into VALBUF. */
193
194 #if !GDB_MULTI_ARCH
195 void hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf);
196 #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
197 hppa_extract_return_value (TYPE, REGBUF, VALBUF);
198 #endif
199
200 /* elz: decide whether the function returning a value of type type
201 will put it on the stack or in the registers.
202 The pa calling convention says that:
203 register 28 (called ret0 by gdb) contains any ASCII char,
204 and any non_floating point value up to 32-bits.
205 reg 28 and 29 contain non-floating point up tp 64 bits and larger
206 than 32 bits. (higer order word in reg 28).
207 fr4: floating point up to 64 bits
208 sr1: space identifier (32-bit)
209 stack: any lager than 64-bit, with the address in r28
210 */
211 #if !GDB_MULTI_ARCH
212 extern use_struct_convention_fn hppa_use_struct_convention;
213 #define USE_STRUCT_CONVENTION(gcc_p,type) hppa_use_struct_convention (gcc_p,type)
214 #endif
215
216 /* Write into appropriate registers a function return value
217 of type TYPE, given in virtual format. */
218
219 #if !GDB_MULTI_ARCH
220 extern void hppa_store_return_value (struct type *type, char *valbuf);
221 #define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
222 hppa_store_return_value (TYPE, VALBUF);
223 #endif
224
225 #if !GDB_MULTI_ARCH
226 extern CORE_ADDR hppa_extract_struct_value_address (char *regbuf);
227 #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
228 hppa_extract_struct_value_address (REGBUF)
229 #endif
230
231 #if !GDB_MULTI_ARCH
232 extern int hppa_cannot_store_register (int regnum);
233 #define CANNOT_STORE_REGISTER(regno) hppa_cannot_store_register (regno)
234 #endif
235
236 #if !GDB_MULTI_ARCH
237 #define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) hppa_init_extra_frame_info (fromleaf, frame)
238 extern void hppa_init_extra_frame_info (int, struct frame_info *);
239 #endif
240
241 /* Describe the pointer in each stack frame to the previous stack frame
242 (its caller). */
243
244 /* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces
245 the frame's chain-pointer. */
246
247 /* In the case of the PA-RISC, the frame's nominal address
248 is the address of a 4-byte word containing the calling frame's
249 address (previous FP). */
250
251 #if !GDB_MULTI_ARCH
252 #define DEPRECATED_FRAME_CHAIN(thisframe) hppa_frame_chain (thisframe)
253 extern CORE_ADDR hppa_frame_chain (struct frame_info *);
254 #endif
255
256 #if !GDB_MULTI_ARCH
257 extern int hppa_frame_chain_valid (CORE_ADDR, struct frame_info *);
258 #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe)
259 #endif
260
261 /* Define other aspects of the stack frame. */
262
263 /* A macro that tells us whether the function invocation represented
264 by FI does not have a frame on the stack associated with it. If it
265 does not, FRAMELESS is set to 1, else 0. */
266 #if !GDB_MULTI_ARCH
267 #define FRAMELESS_FUNCTION_INVOCATION(FI) \
268 (hppa_frameless_function_invocation (FI))
269 extern int hppa_frameless_function_invocation (struct frame_info *);
270 #endif
271
272 #if !GDB_MULTI_ARCH
273 extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame);
274 #define DEPRECATED_FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)
275 #endif
276
277 #if !GDB_MULTI_ARCH
278 extern CORE_ADDR hppa_frame_args_address (struct frame_info *fi);
279 #define FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi)
280 #endif
281
282 #if !GDB_MULTI_ARCH
283 extern CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
284 #define FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi)
285 #endif
286
287 #if !GDB_MULTI_ARCH
288 extern int hppa_frame_num_args (struct frame_info *frame);
289 #define FRAME_NUM_ARGS(fi) hppa_frame_num_args (fi)
290 #endif
291
292 #if !GDB_MULTI_ARCH
293 #define FRAME_ARGS_SKIP 0
294 #endif
295
296 /* Things needed for making the inferior call functions. */
297
298 #if !GDB_MULTI_ARCH
299 #define DEPRECATED_PUSH_DUMMY_FRAME hppa_push_dummy_frame ()
300 extern void hppa_push_dummy_frame (void);
301 #endif
302
303 /* Discard from the stack the innermost frame,
304 restoring all saved registers. */
305 #if !GDB_MULTI_ARCH
306 #define DEPRECATED_POP_FRAME hppa_pop_frame ()
307 extern void hppa_pop_frame (void);
308 #endif
309
310 #if !GDB_MULTI_ARCH
311 #define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 28)
312 #endif
313
314 #if !GDB_MULTI_ARCH
315 #define CALL_DUMMY_START_OFFSET 0
316 #endif
317
318 #if !GDB_MULTI_ARCH
319 #define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
320 (hppa_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
321 extern CORE_ADDR hppa_push_arguments (int, struct value **, CORE_ADDR, int,
322 CORE_ADDR);
323 #endif
324
325 #if !GDB_MULTI_ARCH
326 extern CORE_ADDR hppa_smash_text_address (CORE_ADDR addr);
327 #define SMASH_TEXT_ADDRESS(addr) hppa_smash_text_address (addr)
328 #endif
329
330 #if !GDB_MULTI_ARCH
331 #define BELIEVE_PCC_PROMOTION 1
332 #endif
333
334 #if !GDB_MULTI_ARCH
335 #define TARGET_READ_PC(pid) hppa_target_read_pc (pid)
336 extern CORE_ADDR hppa_target_read_pc (ptid_t);
337 #endif
338
339 #if !GDB_MULTI_ARCH
340 #define TARGET_WRITE_PC(v,pid) hppa_target_write_pc (v,pid)
341 extern void hppa_target_write_pc (CORE_ADDR, ptid_t);
342 #endif
343
344 #if !GDB_MULTI_ARCH
345 #define TARGET_READ_FP() hppa_target_read_fp ()
346 extern CORE_ADDR hppa_target_read_fp (void);
347 #endif
348
349 #include "pa/tm-hppah.h"
350
351 #define HPUX_1100 1
352
353 /* The low two bits of the IA are the privilege level of the instruction. */
354 #define ADDR_BITS_REMOVE(addr) ((CORE_ADDR)addr & (CORE_ADDR)~3)
355
356 /* Say how long (ordinary) registers are. This is used in
357 push_word and a few other places, but REGISTER_RAW_SIZE is
358 the real way to know how big a register is. */
359
360 #undef REGISTER_SIZE
361 #define REGISTER_SIZE 8
362
363 /* Number of bytes of storage in the actual machine representation
364 for register N. On the PA-RISC 2.0, all regs are 8 bytes, including
365 the FP registers (they're accessed as two 4 byte halves). */
366
367 #undef REGISTER_RAW_SIZE
368 #define REGISTER_RAW_SIZE(N) 8
369
370 /* Largest value REGISTER_RAW_SIZE can have. */
371
372 #undef DEPRECATED_MAX_REGISTER_RAW_SIZE
373 #define DEPRECATED_MAX_REGISTER_RAW_SIZE 8
374
375 /* Total amount of space needed to store our copies of the machine's
376 register state, the array `registers'. */
377
378 #undef REGISTER_BYTES
379 #define REGISTER_BYTES (NUM_REGS * 8)
380
381 /* Index within `registers' of the first byte of the space for
382 register N. */
383
384 #undef REGISTER_BYTE
385 #define REGISTER_BYTE(N) ((N) * 8)
386
387 #undef REGISTER_VIRTUAL_TYPE
388 #define REGISTER_VIRTUAL_TYPE(N) \
389 ((N) < FP4_REGNUM ? builtin_type_unsigned_long_long : builtin_type_double)
390
391
392 /* Number of machine registers */
393 #undef NUM_REGS
394 #define NUM_REGS 96
395
396 /* Initializer for an array of names of registers.
397 There should be NUM_REGS strings in this initializer.
398 They are in rows of eight entries */
399 #undef REGISTER_NAMES
400 #define REGISTER_NAMES \
401 {"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", \
402 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
403 "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
404 "r24", "r25", "r26", "dp", "ret0", "ret1", "sp", "r31", \
405 "sar", "pcoqh", "pcsqh", "pcoqt", "pcsqt", "eiem", "iir", "isr", \
406 "ior", "ipsw", "goto", "sr4", "sr0", "sr1", "sr2", "sr3", \
407 "sr5", "sr6", "sr7", "cr0", "cr8", "cr9", "ccr", "cr12", \
408 "cr13", "cr24", "cr25", "cr26", "mpsfu_high","mpsfu_low","mpsfu_ovflo","pad",\
409 "fpsr", "fpe1", "fpe2", "fpe3", "fr4", "fr5", "fr6", "fr7", \
410 "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15", \
411 "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23", \
412 "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31"}
413
414 #undef FP0_REGNUM
415 #undef FP4_REGNUM
416 #define FP0_REGNUM 64 /* floating point reg. 0 (fspr)*/
417 #define FP4_REGNUM 68
418
419 /* Redefine some target bit sizes from the default. */
420
421 /* Number of bits in a long or unsigned long for the target machine. */
422
423 #define TARGET_LONG_BIT 64
424
425 /* Number of bits in a long long or unsigned long long for the
426 target machine. */
427
428 #define TARGET_LONG_LONG_BIT 64
429
430 /* Number of bits in a pointer for the target machine */
431
432 #define TARGET_PTR_BIT 64
433
434 /* Argument Pointer Register */
435 #define AP_REGNUM 29
436
437 #define DP_REGNUM 27
438
439 #define FP5_REGNUM 70
440
441 #define SR5_REGNUM 48
442
443 /* We access locals from SP. This may not work for frames which call
444 alloca; for those, we may need to consult unwind tables.
445 jimb: FIXME. */
446 #undef FRAME_LOCALS_ADDRESS
447 #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
448
449 /* For a number of horrible reasons we may have to adjust the location
450 of variables on the stack. Ugh. jimb: why? */
451 #define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR)
452
453 extern int hpread_adjust_stack_address (CORE_ADDR);
454
455
456 /* jimb: omitted dynamic linking stuff here */
457
458 /* This sequence of words is the instructions
459
460 ; Call stack frame has already been built by gdb. Since we could be calling
461 ; a varargs function, and we do not have the benefit of a stub to put things in
462 ; the right place, we load the first 8 word of arguments into both the general
463 ; and fp registers.
464 call_dummy
465 nop
466 copy %r4,%r29
467 copy %r5,%r22
468 copy %r6,%r27
469 fldd -64(0,%r29),%fr4
470 fldd -56(0,%r29),%fr5
471 fldd -48(0,%r29),%fr6
472 fldd -40(0,%r29),%fr7
473 fldd -32(0,%r29),%fr8
474 fldd -24(0,%r29),%fr9
475 fldd -16(0,%r29),%fr10
476 fldd -8(0,%r29),%fr11
477 copy %r22,%r1
478 ldd -64(%r29), %r26
479 ldd -56(%r29), %r25
480 ldd -48(%r29), %r24
481 ldd -40(%r29), %r23
482 ldd -32(%r29), %r22
483 ldd -24(%r29), %r21
484 ldd -16(%r29), %r20
485 bve,l (%r1),%r2
486 ldd -8(%r29), %r19
487 break 4, 8
488 mtsp %r21, %sr0
489 ble 0(%sr0, %r22)
490 nop
491 */
492
493 /* Call dummys are sized and written out in word sized hunks. So we have
494 to pack the instructions into words. Ugh. */
495 #undef CALL_DUMMY
496 #define CALL_DUMMY {0x08000240349d0000LL, 0x34b6000034db0000LL, \
497 0x53a43f8353a53f93LL, 0x53a63fa353a73fb3LL,\
498 0x53a83fc353a93fd3LL, 0x2fa1100a2fb1100bLL,\
499 0x36c1000053ba3f81LL, 0x53b93f9153b83fa1LL,\
500 0x53b73fb153b63fc1LL, 0x53b53fd10fa110d4LL,\
501 0xe820f0000fb110d3LL, 0x0001000400151820LL,\
502 0xe6c0000008000240LL}
503
504 #define CALL_DUMMY_BREAKPOINT_OFFSET 22 * 4
505
506 /* CALL_DUMMY_LENGTH is computed based on the size of a word on the target
507 machine, not the size of an instruction. Since a word on this target
508 holds two instructions we have to divide the instruction size by two to
509 get the word size of the dummy. */
510 #undef CALL_DUMMY_LENGTH
511 #define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 26 / 2)
512
513 /* The PA64 ABI mandates a 16 byte stack alignment. */
514 #undef STACK_ALIGN
515 #define STACK_ALIGN(arg) ( ((arg)%16) ? (((arg)+15)&-16) : (arg))
516
517 /* The PA64 ABI reserves 64 bytes of stack space for outgoing register
518 parameters. */
519 #undef REG_PARM_STACK_SPACE
520 #define REG_PARM_STACK_SPACE 64
521
522 /* Use the 64-bit calling conventions designed for the PA2.0 in wide mode. */
523 #define PA20W_CALLING_CONVENTIONS
524
525 #undef FUNC_LDIL_OFFSET
526 #undef FUNC_LDO_OFFSET
527 #undef SR4EXPORT_LDIL_OFFSET
528 #undef SR4EXPORT_LDO_OFFSET
529
530 #undef REG_STRUCT_HAS_ADDR
531
532 #undef DEPRECATED_EXTRACT_RETURN_VALUE
533 /* RM: floats are returned in FR4R, doubles in FR4
534 * integral values are in r28, padded on the left
535 * aggregates less that 65 bits are in r28, right padded
536 * aggregates upto 128 bits are in r28 and r29, right padded
537 */
538 #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
539 { \
540 if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
541 memcpy ((VALBUF), \
542 ((char *)(REGBUF)) + REGISTER_BYTE (FP4_REGNUM) + \
543 (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
544 TYPE_LENGTH (TYPE)); \
545 else if (is_integral_type(TYPE)) \
546 memcpy ((VALBUF), \
547 (char *)(REGBUF) + REGISTER_BYTE (28) + \
548 (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
549 TYPE_LENGTH (TYPE)); \
550 else if (TYPE_LENGTH (TYPE) <= 8) \
551 memcpy ((VALBUF), \
552 (char *)(REGBUF) + REGISTER_BYTE (28), \
553 TYPE_LENGTH (TYPE)); \
554 else if (TYPE_LENGTH (TYPE) <= 16) \
555 { \
556 memcpy ((VALBUF), \
557 (char *)(REGBUF) + REGISTER_BYTE (28), \
558 8); \
559 memcpy (((char *) VALBUF + 8), \
560 (char *)(REGBUF) + REGISTER_BYTE (29), \
561 TYPE_LENGTH (TYPE) - 8); \
562 } \
563 }
564
565 /* RM: struct upto 128 bits are returned in registers */
566 #undef USE_STRUCT_CONVENTION
567 #define USE_STRUCT_CONVENTION(gcc_p, value_type)\
568 (TYPE_LENGTH (value_type) > 16)
569
570 /* RM: for return command */
571 #undef DEPRECATED_STORE_RETURN_VALUE
572 #define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
573 { \
574 if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
575 deprecated_write_register_bytes \
576 (REGISTER_BYTE (FP4_REGNUM) + \
577 (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
578 (VALBUF), \
579 TYPE_LENGTH (TYPE)); \
580 else if (is_integral_type(TYPE)) \
581 deprecated_write_register_bytes \
582 (REGISTER_BYTE (28) + \
583 (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
584 (VALBUF), \
585 TYPE_LENGTH (TYPE)); \
586 else if (TYPE_LENGTH (TYPE) <= 8) \
587 deprecated_write_register_bytes \
588 ( REGISTER_BYTE (28), \
589 (VALBUF), \
590 TYPE_LENGTH (TYPE)); \
591 else if (TYPE_LENGTH (TYPE) <= 16) \
592 { \
593 deprecated_write_register_bytes \
594 (REGISTER_BYTE (28), \
595 (VALBUF), \
596 8); \
597 deprecated_write_register_bytes \
598 (REGISTER_BYTE (29), \
599 ((char *) VALBUF + 8), \
600 TYPE_LENGTH (TYPE) - 8); \
601 } \
602 }
603
604 /* RM: these are the PA64 equivalents of the macros in tm-hppah.h --
605 * see comments there. For PA64, the save_state structure is at an
606 * offset of 24 32-bit words from the sigcontext structure. The 64 bit
607 * general registers are at an offset of 640 bytes from the beginning of the
608 * save_state structure, and the floating pointer register are at an offset
609 * of 256 bytes from the beginning of the save_state structure.
610 */
611 #undef FRAME_SAVED_PC_IN_SIGTRAMP
612 #define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \
613 { \
614 *(TMP) = read_memory_integer ((FRAME)->frame + (24 * 4) + 640 + (33 * 8), 8); \
615 }
616
617 #undef FRAME_BASE_BEFORE_SIGTRAMP
618 #define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
619 { \
620 *(TMP) = read_memory_integer ((FRAME)->frame + (24 * 4) + 640 + (30 * 8), 8); \
621 }
622
623 #undef FRAME_FIND_SAVED_REGS_IN_SIGTRAMP
624 #define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \
625 { \
626 int i; \
627 CORE_ADDR TMP1, TMP2; \
628 TMP1 = (FRAME)->frame + (24 * 4) + 640; \
629 TMP2 = (FRAME)->frame + (24 * 4) + 256; \
630 for (i = 0; i < NUM_REGS; i++) \
631 { \
632 if (i == SP_REGNUM) \
633 (FSR)[SP_REGNUM] = read_memory_integer (TMP1 + SP_REGNUM * 8, 8); \
634 else if (i >= FP0_REGNUM) \
635 (FSR)[i] = TMP2 + (i - FP0_REGNUM) * 8; \
636 else \
637 (FSR)[i] = TMP1 + i * 8; \
638 } \
639 }
640
641 /* jimb: omitted purify call support */
This page took 0.045606 seconds and 3 git commands to generate.