]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/ppc-linux-nat.c
Switch the license of all .c files to GPLv3.
[thirdparty/binutils-gdb.git] / gdb / ppc-linux-nat.c
index b5c5afb393a4d3a8eaba10510687b7d3e495ba95..60cffc39d65cd0e1b30bbd7808f5d665f70bc733 100644 (file)
@@ -7,7 +7,7 @@
 
    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 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -188,7 +186,7 @@ ppc_register_u_addr (int regno)
     u_addr = (PT_FPR0 * wordsize) + ((regno - tdep->ppc_fp0_regnum) * 8);
 
   /* UISA special purpose registers: 1 slot each */
-  if (regno == PC_REGNUM)
+  if (regno == gdbarch_pc_regnum (current_gdbarch))
     u_addr = PT_NIP * wordsize;
   if (regno == tdep->ppc_lr_regnum)
     u_addr = PT_LNK * wordsize;
@@ -381,7 +379,7 @@ fetch_register (struct regcache *regcache, int tid, int regno)
        {
           char message[128];
          sprintf (message, "reading register %s (#%d)", 
-                  REGISTER_NAME (regno), regno);
+                  gdbarch_register_name (current_gdbarch, regno), regno);
          perror_with_name (message);
        }
     }
@@ -463,7 +461,7 @@ fetch_ppc_registers (struct regcache *regcache, int tid)
   if (tdep->ppc_fp0_regnum >= 0)
     for (i = 0; i < ppc_num_fprs; i++)
       fetch_register (regcache, tid, tdep->ppc_fp0_regnum + i);
-  fetch_register (regcache, tid, PC_REGNUM);
+  fetch_register (regcache, tid, gdbarch_pc_regnum (current_gdbarch));
   if (tdep->ppc_ps_regnum != -1)
     fetch_register (regcache, tid, tdep->ppc_ps_regnum);
   if (tdep->ppc_cr_regnum != -1)
@@ -654,12 +652,12 @@ store_register (const struct regcache *regcache, int tid, int regno)
   memset (buf, 0, sizeof buf);
   bytes_to_transfer = align_up (register_size (current_gdbarch, regno),
                                 sizeof (long));
-  if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
+  if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE)
     {
       /* Little-endian values always sit at the left end of the buffer.  */
       regcache_raw_collect (regcache, regno, buf);
     }
-  else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+  else if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
     {
       /* Big-endian values sit at the right end of the buffer.  */
       size_t padding = (bytes_to_transfer
@@ -685,7 +683,7 @@ store_register (const struct regcache *regcache, int tid, int regno)
        {
           char message[128];
          sprintf (message, "writing register %s (#%d)", 
-                  REGISTER_NAME (regno), regno);
+                  gdbarch_register_name (current_gdbarch, regno), regno);
          perror_with_name (message);
        }
     }
@@ -747,7 +745,7 @@ store_ppc_registers (const struct regcache *regcache, int tid)
   if (tdep->ppc_fp0_regnum >= 0)
     for (i = 0; i < ppc_num_fprs; i++)
       store_register (regcache, tid, tdep->ppc_fp0_regnum + i);
-  store_register (regcache, tid, PC_REGNUM);
+  store_register (regcache, tid, gdbarch_pc_regnum (current_gdbarch));
   if (tdep->ppc_ps_regnum != -1)
     store_register (regcache, tid, tdep->ppc_ps_regnum);
   if (tdep->ppc_cr_regnum != -1)
@@ -946,8 +944,9 @@ fill_gregset (const struct regcache *regcache,
                        (regp + PT_R0 + regi));
     }
 
-  if ((regno == -1) || regno == PC_REGNUM)
-    right_fill_reg (regcache, PC_REGNUM, regp + PT_NIP);
+  if ((regno == -1) || regno == gdbarch_pc_regnum (current_gdbarch))
+    right_fill_reg (regcache, gdbarch_pc_regnum (current_gdbarch),
+                   regp + PT_NIP);
   if ((regno == -1) || regno == tdep->ppc_lr_regnum)
     right_fill_reg (regcache, tdep->ppc_lr_regnum, regp + PT_LNK);
   if ((regno == -1) || regno == tdep->ppc_cr_regnum)