a8d414e0551d5c6ed85fa4f591b2f5192221da69
[external/binutils.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-05-22: All the definition from this point until
39    the include of pa/tm-hppah.h are extracted from tm-hppa.h and tm-hppah.h.
40    They have been temporarily moved here, until hppa64 is multiarched too.  */
41
42 #if !GDB_MULTI_ARCH
43 extern int hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name);
44 #define PC_IN_SIGTRAMP(pc, name) hppa_hpux_pc_in_sigtramp (pc, name)
45 #endif
46
47 #if !GDB_MULTI_ARCH
48 extern int hppa_reg_struct_has_addr (int gcc_p, struct type *type);
49 #define REG_STRUCT_HAS_ADDR(gcc_p,type) hppa_reg_struct_has_addr (gcc_p,type)
50 #endif
51
52 /* Offset from address of function to start of its code.
53    Zero on most machines.  */
54
55 #if !GDB_MULTI_ARCH
56 #define FUNCTION_START_OFFSET 0
57 #endif
58
59 /* Advance PC across any function entry prologue instructions
60    to reach some "real" code.  */
61
62 #if !GDB_MULTI_ARCH
63 extern CORE_ADDR hppa_skip_prologue (CORE_ADDR);
64 #define SKIP_PROLOGUE(pc) (hppa_skip_prologue (pc))
65 #endif
66
67 /* If PC is in some function-call trampoline code, return the PC
68    where the function itself actually starts.  If not, return NULL.  */
69
70 #if !GDB_MULTI_ARCH
71 #define SKIP_TRAMPOLINE_CODE(pc) hppa_skip_trampoline_code (pc)
72 extern CORE_ADDR hppa_skip_trampoline_code (CORE_ADDR);
73 #endif
74
75 /* Return non-zero if we are in an appropriate trampoline. */
76
77 #if !GDB_MULTI_ARCH
78 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
79    hppa_in_solib_call_trampoline (pc, name)
80 extern int hppa_in_solib_call_trampoline (CORE_ADDR, char *);
81 #endif
82
83 #if !GDB_MULTI_ARCH
84 #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) \
85   hppa_in_solib_return_trampoline (pc, name)
86 extern int hppa_in_solib_return_trampoline (CORE_ADDR, char *);
87 #endif
88
89 #if !GDB_MULTI_ARCH
90 #undef  DEPRECATED_SAVED_PC_AFTER_CALL
91 #define DEPRECATED_SAVED_PC_AFTER_CALL(frame) hppa_saved_pc_after_call (frame)
92 extern CORE_ADDR hppa_saved_pc_after_call (struct frame_info *);
93 #endif
94
95 #if !GDB_MULTI_ARCH
96 extern int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
97 #define INNER_THAN(lhs,rhs) hppa_inner_than(lhs,rhs)
98 #endif
99
100 #if !GDB_MULTI_ARCH
101 extern CORE_ADDR hppa_stack_align (CORE_ADDR sp);
102 #define STACK_ALIGN(sp) hppa_stack_align (sp)
103 #endif
104
105 /* Amount PC must be decremented by after a breakpoint.  This is often
106    the number of bytes returned by BREAKPOINT_FROM_PC but not always.
107
108    Not on the PA-RISC */
109
110 #if !GDB_MULTI_ARCH
111 #define DECR_PC_AFTER_BREAK 0
112 #endif
113
114 /* Say how long (ordinary) registers are.  This is a piece of bogosity
115    used in push_word and a few other places; REGISTER_RAW_SIZE is the
116    real way to know how big a register is.  */
117
118 #if !GDB_MULTI_ARCH
119 #define DEPRECATED_REGISTER_SIZE 4
120 #endif
121
122 /* Number of machine registers */
123
124 #if !GDB_MULTI_ARCH
125 #define NUM_REGS 128
126 #endif
127
128 #if !GDB_MULTI_ARCH
129 #define DEPRECATED_FP_REGNUM 3          /* Contains address of executing stack */
130                                 /* frame */
131 #endif
132 #if !GDB_MULTI_ARCH
133 #define SP_REGNUM 30            /* Contains address of top of stack */
134 #endif
135
136 #if !GDB_MULTI_ARCH
137 #define FP0_REGNUM 64           /* floating point reg. 0 (fspr) */
138 #endif
139
140 /* compatibility with the rest of gdb. */
141 #if !GDB_MULTI_ARCH
142 #define PC_REGNUM PCOQ_HEAD_REGNUM
143 #endif
144 #if !GDB_MULTI_ARCH
145 #define NPC_REGNUM PCOQ_TAIL_REGNUM
146 #endif
147
148 /* Number of bytes of storage in the actual machine representation
149    for register N.  On the PA-RISC, all regs are 4 bytes, including
150    the FP registers (they're accessed as two 4 byte halves).  */
151
152 #if !GDB_MULTI_ARCH
153 extern int hppa_register_raw_size (int reg_nr);
154 #define REGISTER_RAW_SIZE(N) hppa_register_raw_size (N)
155 #endif
156
157 /* Total amount of space needed to store our copies of the machine's
158    register state, the array `registers'.  */
159 #if !GDB_MULTI_ARCH
160 #define DEPRECATED_REGISTER_BYTES (NUM_REGS * 4)
161 #endif
162
163 #if !GDB_MULTI_ARCH
164 extern int hppa_register_byte (int reg_nr);
165 #define REGISTER_BYTE(N) hppa_register_byte (N)
166 #endif
167
168 /* Number of bytes of storage in the program's representation
169    for register N. */
170
171 #if !GDB_MULTI_ARCH
172 #define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
173 #endif
174
175 /* Largest value REGISTER_RAW_SIZE can have.  */
176
177 #if !GDB_MULTI_ARCH
178 #define DEPRECATED_MAX_REGISTER_RAW_SIZE 4
179 #endif
180
181 /* Largest value REGISTER_VIRTUAL_SIZE can have.  */
182
183 #if !GDB_MULTI_ARCH
184 #define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
185 #endif
186
187 #if !GDB_MULTI_ARCH
188 extern struct type * hppa_register_virtual_type (int reg_nr);
189 #define REGISTER_VIRTUAL_TYPE(N) hppa_register_virtual_type (N)
190 #endif
191
192 #if !GDB_MULTI_ARCH
193 extern void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
194 #define STORE_STRUCT_RETURN(ADDR, SP) hppa_store_struct_return (ADDR, SP)
195 #endif
196
197 /* Extract from an array REGBUF containing the (raw) register state
198    a function return value of type TYPE, and copy that, in virtual format,
199    into VALBUF.  */
200
201 #if !GDB_MULTI_ARCH
202 void hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf);
203 #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
204   hppa_extract_return_value (TYPE, REGBUF, VALBUF);
205 #endif
206
207  /* elz: decide whether the function returning a value of type type
208     will put it on the stack or in the registers.
209     The pa calling convention says that:
210     register 28 (called ret0 by gdb) contains any ASCII char,
211     and any non_floating point value up to 32-bits.
212     reg 28 and 29 contain non-floating point up tp 64 bits and larger
213     than 32 bits. (higer order word in reg 28).
214     fr4: floating point up to 64 bits
215     sr1: space identifier (32-bit)
216     stack: any lager than 64-bit, with the address in r28
217   */
218 #if !GDB_MULTI_ARCH
219 extern use_struct_convention_fn hppa_use_struct_convention;
220 #define USE_STRUCT_CONVENTION(gcc_p,type) hppa_use_struct_convention (gcc_p,type)
221 #endif
222
223 /* Write into appropriate registers a function return value
224    of type TYPE, given in virtual format.  */
225
226 #if !GDB_MULTI_ARCH
227 extern void hppa_store_return_value (struct type *type, char *valbuf);
228 #define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
229   hppa_store_return_value (TYPE, VALBUF);
230 #endif
231
232 #if !GDB_MULTI_ARCH
233 extern CORE_ADDR hppa_extract_struct_value_address (char *regbuf);
234 #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
235   hppa_extract_struct_value_address (REGBUF)
236 #endif
237
238 #if !GDB_MULTI_ARCH
239 extern int hppa_cannot_store_register (int regnum);
240 #define CANNOT_STORE_REGISTER(regno) hppa_cannot_store_register (regno)
241 #endif
242
243 #if !GDB_MULTI_ARCH
244 #define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) hppa_init_extra_frame_info (fromleaf, frame)
245 extern void hppa_init_extra_frame_info (int, struct frame_info *);
246 #endif
247
248 /* Describe the pointer in each stack frame to the previous stack frame
249    (its caller).  */
250
251 /* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces
252    the frame's chain-pointer.  */
253
254 /* In the case of the PA-RISC, the frame's nominal address
255    is the address of a 4-byte word containing the calling frame's
256    address (previous FP).  */
257
258 #if !GDB_MULTI_ARCH
259 #define DEPRECATED_FRAME_CHAIN(thisframe) hppa_frame_chain (thisframe)
260 extern CORE_ADDR hppa_frame_chain (struct frame_info *);
261 #endif
262
263 #if !GDB_MULTI_ARCH
264 extern int hppa_frame_chain_valid (CORE_ADDR, struct frame_info *);
265 #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe)
266 #endif
267
268 /* Define other aspects of the stack frame.  */
269
270 /* A macro that tells us whether the function invocation represented
271    by FI does not have a frame on the stack associated with it.  If it
272    does not, FRAMELESS is set to 1, else 0.  */
273 #if !GDB_MULTI_ARCH
274 #define FRAMELESS_FUNCTION_INVOCATION(FI) \
275   (hppa_frameless_function_invocation (FI))
276 extern int hppa_frameless_function_invocation (struct frame_info *);
277 #endif
278
279 #if !GDB_MULTI_ARCH
280 extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame);
281 #define DEPRECATED_FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)
282 #endif
283
284 #if !GDB_MULTI_ARCH
285 extern CORE_ADDR hppa_frame_args_address (struct frame_info *fi);
286 #define FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi)
287 #endif
288
289 #if !GDB_MULTI_ARCH
290 extern CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
291 #define FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (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 */