Moved the position of the #### lines so that the makefile fragments
[deliverable/binutils-gdb.git] / gdb / tm-29k.h
index 459462216eb39fbff9e49b5f2a700cda25fb0b22..8e970d0fffa58556fbf883309b7fd644ec214a23 100644 (file)
@@ -4,19 +4,19 @@
 
 This file is part of GDB.
 
-GDB is free software; you can redistribute it and/or modify
+This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
-GDB is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GDB; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* Parameters for an EB29K (a board which plugs into a PC and is
    accessed through EBMON software running on the PC, which we
@@ -32,15 +32,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* Floating point uses IEEE representations.  */
 #define IEEE_FLOAT
 
-/* We can either use a.out, encapsulated, or can use COFF */
-#ifndef COFF_ENCAPSULATE
-#define COFF_FORMAT
-/* This just has to do with what coff header files are in use.  */
-#define COFF_CHECK_X_ZEROES
-#endif
-
 /* Recognize our magic number.  */
-#define BADMAG(x) ((x)->f_magic != 0572)
+#define BADMAG(x) ((x).f_magic != 0572)
 
 /* Define this if the C compiler puts an underscore at the front
    of external names before giving them to the linker.  */
@@ -114,6 +107,10 @@ CORE_ADDR skip_prologue ();
 
 #define REGISTER_TYPE long
 
+/* Allow the register declarations here to be overridden for remote
+   kernel debugging.  */
+#if !defined (REGISTER_NAMES)
+
 /* Number of machine registers */
 
 #define NUM_REGS 205
@@ -153,17 +150,20 @@ CORE_ADDR skip_prologue ();
   "pc0", "pc1", "pc2", "mmu", "lru", "fpe", "int", "fps", "exo", "gr1",  \
   "alu", "ipc", "ipa", "ipb" }
 
-/* Special register #x.  */
+/* Convert Processor Special register #x to REGISTER_NAMES register # */
 #define SR_REGNUM(x) \
   ((x) < 15  ? VAB_REGNUM + (x)                                         \
-   : (x) >= 128 && (x) < 131 ? IPC_REGNUM + (x)                         \
+   : (x) >= 128 && (x) < 131 ? IPC_REGNUM + (x) - 128           \
    : (x) == 131 ? Q_REGNUM                                      \
    : (x) == 132 ? ALU_REGNUM                                    \
-   : (x) >= 133 && (x) < 136 ? BP_REGNUM + (x)                  \
-   : (x) >= 160 && (x) < 163 ? FPE_REGNUM + (x)                         \
+   : (x) >= 133 && (x) < 136 ? BP_REGNUM + (x) - 133            \
+   : (x) >= 160 && (x) < 163 ? FPE_REGNUM + (x) - 160           \
    : (x) == 164 ? EXO_REGNUM                                     \
    : (error ("Internal error in SR_REGNUM"), 0))
 #define GR96_REGNUM 0
+/* Define the return register separately, so it can be overridden for
+   kernel procedure calling conventions. */
+#define        RETURN_REGNUM   GR96_REGNUM
 #define GR1_REGNUM 200
 /* This needs to be the memory stack pointer, not the register stack pointer,
    to make call_function work right.  */
@@ -182,23 +182,37 @@ CORE_ADDR skip_prologue ();
 /* Register Stack Pointer.  */
 #define RSP_REGNUM GR1_REGNUM
 #define LR0_REGNUM 32
-#define PC_REGNUM 192 /* pc1 */
-#define NPC_REGNUM 191 /* pc0 */
-#define PC2_REGNUM 193
 #define BP_REGNUM 177
 #define FC_REGNUM 178
 #define CR_REGNUM 179
 #define Q_REGNUM 180
 #define VAB_REGNUM 181
-#define LRU_REGNUM 195
-#define FPE_REGNUM 196
-#define INT_REGNUM 197
-#define FPS_REGNUM 198
-#define EXO_REGNUM 199
-#define PS_REGNUM 201
-#define ALU_REGNUM 201
-#define IPC_REGNUM 202
-#define IPB_REGNUM 204
+#define OPS_REGNUM (VAB_REGNUM + 1)
+#define CPS_REGNUM (VAB_REGNUM + 2)
+#define CFG_REGNUM (VAB_REGNUM + 3)
+#define CHA_REGNUM (VAB_REGNUM + 4)
+#define CHD_REGNUM (VAB_REGNUM + 5)
+#define CHC_REGNUM (VAB_REGNUM + 6)
+#define RBP_REGNUM (VAB_REGNUM + 7)
+#define TMC_REGNUM (VAB_REGNUM + 8)
+#define TMR_REGNUM (VAB_REGNUM + 9)
+#define NPC_REGNUM (VAB_REGNUM + 10)  /* pc0 */
+#define PC_REGNUM  (VAB_REGNUM + 11)  /* pc1 */
+#define PC2_REGNUM (VAB_REGNUM + 12)
+#define MMU_REGNUM (VAB_REGNUM + 13)
+#define LRU_REGNUM (VAB_REGNUM + 14)
+#define FPE_REGNUM (VAB_REGNUM + 15)
+#define INT_REGNUM (VAB_REGNUM + 16)
+#define FPS_REGNUM (VAB_REGNUM + 17)
+#define EXO_REGNUM (VAB_REGNUM + 18)
+/* gr1 is defined above as 200 = VAB_REGNUM + 19 */
+#define ALU_REGNUM (VAB_REGNUM + 20)
+#define PS_REGNUM  ALU_REGNUM
+#define IPC_REGNUM (VAB_REGNUM + 21)
+#define IPA_REGNUM (VAB_REGNUM + 22)
+#define IPB_REGNUM (VAB_REGNUM + 23)
+
+#endif /* !defined(REGISTER_NAMES) */
 
 /* Total amount of space needed to store our copies of the machine's
    register state, the array `registers'.  */
@@ -281,7 +295,7 @@ CORE_ADDR skip_prologue ();
        read_memory (*((int *)(REGBUF) + LRP_REGNUM), (VALBUF) + 16 * 4,   \
                     TYPE_LENGTH (TYPE) - 16 * 4);                         \
       }                                                                           \
-    bcopy (((int *)(REGBUF))+GR96_REGNUM, (VALBUF), reg_length);          \
+    bcopy (((int *)(REGBUF))+RETURN_REGNUM, (VALBUF), reg_length);        \
   }
 
 /* Write into appropriate registers a function return value
@@ -297,7 +311,7 @@ CORE_ADDR skip_prologue ();
                      (char *)(VALBUF) + 16 * 4,                          \
                      TYPE_LENGTH (TYPE) - 16 * 4);                       \
       }                                                                          \
-    write_register_bytes (REGISTER_BYTE (GR96_REGNUM), (char *)(VALBUF),  \
+    write_register_bytes (REGISTER_BYTE (RETURN_REGNUM), (char *)(VALBUF),  \
                          TYPE_LENGTH (TYPE));                            \
   }
 \f
@@ -330,10 +344,10 @@ CORE_ADDR skip_prologue ();
    macros, it doesn't really matter exactly how we
    do it.  However, note that FRAME_FP is used in two ways in GDB:
    (1) as a "magic cookie" which uniquely identifies frames (even over
-   calls to the inferior), (2) (in PC_IN_CALL_DUMMY [!CANNOT_EXECUTE_STACK])
+   calls to the inferior), (2) (in PC_IN_CALL_DUMMY [ON_STACK])
    as the value of SP_REGNUM before the dummy frame was pushed.  These
-   two meanings would be incompatible for the 29k if we didn't define
-   CANNOT_EXECUTE_STACK (but we do, so don't worry about it).
+   two meanings would be incompatible for the 29k if we defined
+   CALL_DUMMY_LOCATION == ON_STACK (but we don't, so don't worry about it).
    Also note that "lr1" below, while called a frame pointer
    in the user's guide, has only one function:  To determine whether
    registers need to be filled in the function epilogue.
@@ -413,7 +427,7 @@ long read_register_stack_integer ();
 /* Because INIT_FRAME_PC gets passed fromleaf, that's where we init
    not only ->pc and ->frame, but all the extra stuff, when called from
    get_prev_frame_info, that is.  */
-#define INIT_EXTRA_FRAME_INFO(fci) \
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
   init_extra_frame_info(fci);
 void init_extra_frame_info ();
 #define INIT_FRAME_PC(fromleaf, fci) \
@@ -423,12 +437,8 @@ void init_frame_pc ();
 /* FRAME_CHAIN takes a FRAME
    and produces the frame's chain-pointer.
 
-   FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address
-   and produces the nominal address of the caller frame.
-
    However, if FRAME_CHAIN_VALID returns zero,
-   it means the given frame is the outermost one and has no caller.
-   In that case, FRAME_CHAIN_COMBINE is not used.  */
+   it means the given frame is the outermost one and has no caller.  */
 
 /* On the 29k, the nominal address of a frame is the address on the
    register stack of the return address (the one next to the incoming
@@ -446,13 +456,10 @@ void init_frame_pc ();
 /* Not sure how to figure out where the bottom frame is.  There is
    no frame for start.  In my tests so far the
    pc has been outside the text segment, though, so check for that.
+   FIXME!!!
    However, allow a pc in a call dummy.  */
 #define FRAME_CHAIN_VALID(chain, thisframe) \
-  (outside_startup_file (FRAME_SAVED_PC (thisframe))   \
-   && FRAME_SAVED_PC (thisframe) >= text_start         \
-   && FRAME_SAVED_PC (thisframe) < text_end + CALL_DUMMY_LENGTH)
-
-#define FRAME_CHAIN_COMBINE(chain, thisframe) (0)
+  (outside_startup_file (FRAME_SAVED_PC (thisframe)))
 
 /* Define other aspects of the stack frame.  */
 
@@ -555,12 +562,12 @@ extern CORE_ADDR frame_locals_address ();
 
 /* Number of special registers (sr128-) to save.  */
 #define DUMMY_SAVE_SR128 8
-/* Number of general (gr96-) registers to save.  */
-#define DUMMY_SAVE_GR96 29
+/* Number of general (gr96- or gr64-) registers to save.  */
+#define DUMMY_SAVE_GREGS 29
 
 #define DUMMY_FRAME_RSIZE \
 (4 /* mfp_dummy */                                        \
- + DUMMY_SAVE_GR96 * 4                             \
+ + DUMMY_SAVE_GREGS * 4                             \
  + DUMMY_SAVE_SR128 * 4                                   \
  + DUMMY_ARG                                      \
  )
@@ -632,12 +639,18 @@ extern void pop_frame ();
     STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16);\
   }
 
-/* At least our 29k board has separate data & instruction memories and can't
-   execute the data memory.  Also, there should be space after text_end;
+/* 29k architecture has separate data & instruction memories -- wired to
+   different pins on the chip -- and can't execute the data memory.
+   Also, there should be space after text_end;
    we won't get a SIGSEGV or scribble on data space.  */
 
 #define CALL_DUMMY_LOCATION AFTER_TEXT_END
 
+/* Because of this, we need (as a kludge) to know the addresses of the
+   text section.  */
+
+#define        NEED_TEXT_START_END
+
 /* How to translate register numbers in the .stab's into gdb's internal register
    numbers.  We don't translate them, but we warn if an invalid register
    number is seen.  Note that FIXME, we use the value "sym" as an implicit
This page took 0.026526 seconds and 4 git commands to generate.