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