* config/pa/tm-hppa.h (SOFT_FLOAT): Delete this macro.
[deliverable/binutils-gdb.git] / gdb / config / pa / tm-hppa64.h
index 71654779c37a69abd49872583d38d2cba72be880..48d41d355f49efffd0cb613aaa137533dfb7097b 100644 (file)
@@ -1,6 +1,6 @@
 /* Parameters for execution on any Hewlett-Packard PA-RISC machine.
-   Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1995
-   Free Software Foundation, Inc. 
+   Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1995, 1999, 2000
+   Free Software Foundation, Inc.
 
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
@@ -28,6 +28,324 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    gotten working yet.  */
 #define GDB_TARGET_IS_HPPA_20W
 
+/* FIXME: brobecker 2003-04-21: Although 32bit hppa is partially multiarched,
+   the conversion for hppa64 hasn't been completed yet.  */
+#define GDB_MULTI_ARCH 0
+
+/* FIXME: brobecker 2003-04-21: All the definition from this point until
+   the include of pa/tm-hppah.h are extracted from tm-hppa.h.  They have
+   been temporarily moved here, until hppa64 is multiarched too.  */
+
+#if !GDB_MULTI_ARCH
+extern int hppa_reg_struct_has_addr (int gcc_p, struct type *type);
+#define REG_STRUCT_HAS_ADDR(gcc_p,type) hppa_reg_struct_has_addr (gcc_p,type)
+#endif
+
+/* Offset from address of function to start of its code.
+   Zero on most machines.  */
+
+#if !GDB_MULTI_ARCH
+#define FUNCTION_START_OFFSET 0
+#endif
+
+/* Advance PC across any function entry prologue instructions
+   to reach some "real" code.  */
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_skip_prologue (CORE_ADDR);
+#define SKIP_PROLOGUE(pc) (hppa_skip_prologue (pc))
+#endif
+
+/* If PC is in some function-call trampoline code, return the PC
+   where the function itself actually starts.  If not, return NULL.  */
+
+#if !GDB_MULTI_ARCH
+#define        SKIP_TRAMPOLINE_CODE(pc) hppa_skip_trampoline_code (pc)
+extern CORE_ADDR hppa_skip_trampoline_code (CORE_ADDR);
+#endif
+
+/* Return non-zero if we are in an appropriate trampoline. */
+
+#if !GDB_MULTI_ARCH
+#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
+   hppa_in_solib_call_trampoline (pc, name)
+extern int hppa_in_solib_call_trampoline (CORE_ADDR, char *);
+#endif
+
+#if !GDB_MULTI_ARCH
+#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) \
+  hppa_in_solib_return_trampoline (pc, name)
+extern int hppa_in_solib_return_trampoline (CORE_ADDR, char *);
+#endif
+
+#if !GDB_MULTI_ARCH
+#undef DEPRECATED_SAVED_PC_AFTER_CALL
+#define DEPRECATED_SAVED_PC_AFTER_CALL(frame) hppa_saved_pc_after_call (frame)
+extern CORE_ADDR hppa_saved_pc_after_call (struct frame_info *);
+#endif
+
+#if !GDB_MULTI_ARCH
+extern int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
+#define INNER_THAN(lhs,rhs) hppa_inner_than(lhs,rhs)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_stack_align (CORE_ADDR sp);
+#define STACK_ALIGN(sp) hppa_stack_align (sp)
+#endif
+
+/* Amount PC must be decremented by after a breakpoint.
+   This is often the number of bytes in BREAKPOINT
+   but not always.
+
+   Not on the PA-RISC */
+
+#if !GDB_MULTI_ARCH
+#define DECR_PC_AFTER_BREAK 0
+#endif
+
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
+
+#if !GDB_MULTI_ARCH
+#define REGISTER_SIZE 4
+#endif
+
+/* Number of machine registers */
+
+#if !GDB_MULTI_ARCH
+#define NUM_REGS 128
+#endif
+
+#if !GDB_MULTI_ARCH
+#define FP_REGNUM 3            /* Contains address of executing stack */
+                               /* frame */
+#endif
+#if !GDB_MULTI_ARCH
+#define SP_REGNUM 30           /* Contains address of top of stack */
+#endif
+
+#if !GDB_MULTI_ARCH
+#define FP0_REGNUM 64          /* floating point reg. 0 (fspr) */
+#endif
+
+/* compatibility with the rest of gdb. */
+#if !GDB_MULTI_ARCH
+#define PC_REGNUM PCOQ_HEAD_REGNUM
+#endif
+#if !GDB_MULTI_ARCH
+#define NPC_REGNUM PCOQ_TAIL_REGNUM
+#endif
+
+/* Number of bytes of storage in the actual machine representation
+   for register N.  On the PA-RISC, all regs are 4 bytes, including
+   the FP registers (they're accessed as two 4 byte halves).  */
+
+#if !GDB_MULTI_ARCH
+extern int hppa_register_raw_size (int reg_nr);
+#define REGISTER_RAW_SIZE(N) hppa_register_raw_size (N)
+#endif
+
+/* Total amount of space needed to store our copies of the machine's
+   register state, the array `registers'.  */
+#if !GDB_MULTI_ARCH
+#define REGISTER_BYTES (NUM_REGS * 4)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern int hppa_register_byte (int reg_nr);
+#define REGISTER_BYTE(N) hppa_register_byte (N)
+#endif
+
+/* Number of bytes of storage in the program's representation
+   for register N. */
+
+#if !GDB_MULTI_ARCH
+#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
+#endif
+
+/* Largest value REGISTER_RAW_SIZE can have.  */
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE 4
+#endif
+
+/* Largest value REGISTER_VIRTUAL_SIZE can have.  */
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
+#endif
+
+#if !GDB_MULTI_ARCH
+extern struct type * hppa_register_virtual_type (int reg_nr);
+#define REGISTER_VIRTUAL_TYPE(N) hppa_register_virtual_type (N)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
+#define STORE_STRUCT_RETURN(ADDR, SP) hppa_store_struct_return (ADDR, SP)
+#endif
+
+/* Extract from an array REGBUF containing the (raw) register state
+   a function return value of type TYPE, and copy that, in virtual format,
+   into VALBUF.  */
+
+#if !GDB_MULTI_ARCH
+void hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf);
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+  hppa_extract_return_value (TYPE, REGBUF, VALBUF);
+#endif
+
+ /* elz: decide whether the function returning a value of type type
+    will put it on the stack or in the registers.
+    The pa calling convention says that:
+    register 28 (called ret0 by gdb) contains any ASCII char,
+    and any non_floating point value up to 32-bits.
+    reg 28 and 29 contain non-floating point up tp 64 bits and larger
+    than 32 bits. (higer order word in reg 28).
+    fr4: floating point up to 64 bits
+    sr1: space identifier (32-bit)
+    stack: any lager than 64-bit, with the address in r28
+  */
+#if !GDB_MULTI_ARCH
+extern use_struct_convention_fn hppa_use_struct_convention;
+#define USE_STRUCT_CONVENTION(gcc_p,type) hppa_use_struct_convention (gcc_p,type)
+#endif
+
+/* Write into appropriate registers a function return value
+   of type TYPE, given in virtual format.  */
+
+#if !GDB_MULTI_ARCH
+extern void hppa_store_return_value (struct type *type, char *valbuf);
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
+  hppa_store_return_value (TYPE, VALBUF);
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_extract_struct_value_address (char *regbuf);
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+  hppa_extract_struct_value_address (REGBUF)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern int hppa_cannot_store_register (int regnum);
+#define CANNOT_STORE_REGISTER(regno) hppa_cannot_store_register (regno)
+#endif
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) hppa_init_extra_frame_info (fromleaf, frame)
+extern void hppa_init_extra_frame_info (int, struct frame_info *);
+#endif
+
+/* Describe the pointer in each stack frame to the previous stack frame
+   (its caller).  */
+
+/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces
+   the frame's chain-pointer.  */
+
+/* In the case of the PA-RISC, the frame's nominal address
+   is the address of a 4-byte word containing the calling frame's
+   address (previous FP).  */
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_FRAME_CHAIN(thisframe) hppa_frame_chain (thisframe)
+extern CORE_ADDR hppa_frame_chain (struct frame_info *);
+#endif
+
+#if !GDB_MULTI_ARCH
+extern int hppa_frame_chain_valid (CORE_ADDR, struct frame_info *);
+#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe)
+#endif
+
+/* Define other aspects of the stack frame.  */
+
+/* A macro that tells us whether the function invocation represented
+   by FI does not have a frame on the stack associated with it.  If it
+   does not, FRAMELESS is set to 1, else 0.  */
+#if !GDB_MULTI_ARCH
+#define FRAMELESS_FUNCTION_INVOCATION(FI) \
+  (hppa_frameless_function_invocation (FI))
+extern int hppa_frameless_function_invocation (struct frame_info *);
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame);
+#define DEPRECATED_FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_frame_args_address (struct frame_info *fi);
+#define FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
+#define FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern int hppa_frame_num_args (struct frame_info *frame);
+#define FRAME_NUM_ARGS(fi) hppa_frame_num_args (fi)
+#endif
+
+#if !GDB_MULTI_ARCH
+#define FRAME_ARGS_SKIP 0
+#endif
+
+/* Things needed for making the inferior call functions.  */
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_PUSH_DUMMY_FRAME hppa_push_dummy_frame ()
+extern void hppa_push_dummy_frame (void);
+#endif
+
+/* Discard from the stack the innermost frame, 
+   restoring all saved registers.  */
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_POP_FRAME  hppa_pop_frame ()
+extern void hppa_pop_frame (void);
+#endif
+
+#if !GDB_MULTI_ARCH
+#define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 28)
+#endif
+
+#if !GDB_MULTI_ARCH
+#define CALL_DUMMY_START_OFFSET 0
+#endif
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
+  (hppa_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
+extern CORE_ADDR hppa_push_arguments (int, struct value **, CORE_ADDR, int,
+                                     CORE_ADDR);
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_smash_text_address (CORE_ADDR addr);
+#define SMASH_TEXT_ADDRESS(addr) hppa_smash_text_address (addr)
+#endif
+
+#if !GDB_MULTI_ARCH
+#define BELIEVE_PCC_PROMOTION 1
+#endif
+
+#if !GDB_MULTI_ARCH
+#define TARGET_READ_PC(pid) hppa_target_read_pc (pid)
+extern CORE_ADDR hppa_target_read_pc (ptid_t);
+#endif
+
+#if !GDB_MULTI_ARCH
+#define TARGET_WRITE_PC(v,pid) hppa_target_write_pc (v,pid)
+extern void hppa_target_write_pc (CORE_ADDR, ptid_t);
+#endif
+
+#if !GDB_MULTI_ARCH
+#define TARGET_READ_FP() hppa_target_read_fp ()
+extern CORE_ADDR hppa_target_read_fp (void);
+#endif
+
 #include "pa/tm-hppah.h"
 
 #define HPUX_1100 1
@@ -51,8 +369,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Largest value REGISTER_RAW_SIZE can have.  */
 
-#undef MAX_REGISTER_RAW_SIZE
-#define MAX_REGISTER_RAW_SIZE 8
+#undef DEPRECATED_MAX_REGISTER_RAW_SIZE
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE 8
 
 /* Total amount of space needed to store our copies of the machine's
    register state, the array `registers'.  */
@@ -122,20 +440,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define SR5_REGNUM 48
 
-#undef FRAME_ARGS_ADDRESS
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->ap)
-
 /* We access locals from SP. This may not work for frames which call
    alloca; for those, we may need to consult unwind tables.
    jimb: FIXME.  */
 #undef FRAME_LOCALS_ADDRESS
 #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
 
-#define INIT_FRAME_AP init_frame_ap
-  
-#define EXTRA_FRAME_INFO  \
-  CORE_ADDR ap;
-
 /* For a number of horrible reasons we may have to adjust the location
    of variables on the stack.  Ugh.  jimb: why? */
 #define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR)
@@ -191,7 +501,6 @@ call_dummy
                     0xe820f0000fb110d3LL, 0x0001000400151820LL,\
                     0xe6c0000008000240LL}
 
-#define CALL_DUMMY_BREAKPOINT_OFFSET_P 1
 #define CALL_DUMMY_BREAKPOINT_OFFSET 22 * 4
 
 /* CALL_DUMMY_LENGTH is computed based on the size of a word on the target
@@ -217,24 +526,23 @@ call_dummy
 #undef FUNC_LDO_OFFSET
 #undef SR4EXPORT_LDIL_OFFSET
 #undef SR4EXPORT_LDO_OFFSET
-#undef CALL_DUMMY_LOCATION
 
 #undef REG_STRUCT_HAS_ADDR
 
-#undef EXTRACT_RETURN_VALUE
+#undef DEPRECATED_EXTRACT_RETURN_VALUE
 /* RM: floats are returned in FR4R, doubles in FR4
  *     integral values are in r28, padded on the left 
  *     aggregates less that 65 bits are in r28, right padded 
  *     aggregates upto 128 bits are in r28 and r29, right padded
  */ 
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
   { \
-    if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \
+    if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
       memcpy ((VALBUF), \
              ((char *)(REGBUF)) + REGISTER_BYTE (FP4_REGNUM) + \
               (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
              TYPE_LENGTH (TYPE)); \
-    else if  (is_integral_type(TYPE) || SOFT_FLOAT)   \
+    else if  (is_integral_type(TYPE))   \
        memcpy ((VALBUF), \
                (char *)(REGBUF) + REGISTER_BYTE (28) + \
                (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
@@ -260,33 +568,33 @@ call_dummy
   (TYPE_LENGTH (value_type) > 16)                
 
 /* RM: for return command */
-#undef STORE_RETURN_VALUE
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+#undef DEPRECATED_STORE_RETURN_VALUE
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
   { \
-    if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \
-      write_register_bytes \
+    if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
+      deprecated_write_register_bytes \
              (REGISTER_BYTE (FP4_REGNUM) + \
               (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
               (VALBUF), \
              TYPE_LENGTH (TYPE)); \
-    else if (is_integral_type(TYPE) || SOFT_FLOAT)   \
-       write_register_bytes \
+    else if (is_integral_type(TYPE))   \
+       deprecated_write_register_bytes \
               (REGISTER_BYTE (28) + \
                  (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
                (VALBUF), \
                TYPE_LENGTH (TYPE)); \
     else if (TYPE_LENGTH (TYPE) <= 8)   \
-       write_register_bytes \
+       deprecated_write_register_bytes \
              ( REGISTER_BYTE (28), \
                (VALBUF), \
                TYPE_LENGTH (TYPE)); \
     else if (TYPE_LENGTH (TYPE) <= 16)   \
       { \
-        write_register_bytes \
+        deprecated_write_register_bytes \
                (REGISTER_BYTE (28), \
                 (VALBUF), \
                 8); \
-        write_register_bytes \
+        deprecated_write_register_bytes \
                (REGISTER_BYTE (29), \
                 ((char *) VALBUF + 8), \
                 TYPE_LENGTH (TYPE) - 8); \
@@ -322,11 +630,11 @@ call_dummy
   for (i = 0; i < NUM_REGS; i++) \
     { \
       if (i == SP_REGNUM) \
-        (FSR)->regs[SP_REGNUM] = read_memory_integer (TMP1 + SP_REGNUM * 8, 8); \
+        (FSR)[SP_REGNUM] = read_memory_integer (TMP1 + SP_REGNUM * 8, 8); \
       else if (i >= FP0_REGNUM) \
-        (FSR)->regs[i] = TMP2 + (i - FP0_REGNUM) * 8; \
+        (FSR)[i] = TMP2 + (i - FP0_REGNUM) * 8; \
       else \
-        (FSR)->regs[i] = TMP1 + i * 8; \
+        (FSR)[i] = TMP1 + i * 8; \
     } \
 }
 
This page took 0.029829 seconds and 4 git commands to generate.