Enable support for the AArch64 dot-prod instruction in the Cortex A55 and A75 cpus.
[deliverable/binutils-gdb.git] / gdb / xtensa-linux-nat.c
index c29f0c71e66b3511f21089b27b2b08b11f0e1f9c..278168620c4b84ccb52315b25caa065f95a34756 100644 (file)
@@ -82,6 +82,10 @@ fill_gregset (const struct regcache *regcache,
     regcache_raw_collect (regcache,
                          gdbarch_tdep (gdbarch)->sar_regnum,
                          &regs->sar);
+  if (regnum == gdbarch_tdep (gdbarch)->threadptr_regnum || regnum == -1)
+    regcache_raw_collect (regcache,
+                         gdbarch_tdep (gdbarch)->threadptr_regnum,
+                         &regs->threadptr);
   if (regnum >=gdbarch_tdep (gdbarch)->ar_base
       && regnum < gdbarch_tdep (gdbarch)->ar_base
                    + gdbarch_tdep (gdbarch)->num_aregs)
@@ -94,6 +98,20 @@ fill_gregset (const struct regcache *regcache,
                              gdbarch_tdep (gdbarch)->ar_base + i,
                              &regs->ar[i]);
     }
+  if (regnum >= gdbarch_tdep (gdbarch)->a0_base
+      && regnum < gdbarch_tdep (gdbarch)->a0_base + C0_NREGS)
+    regcache_raw_collect (regcache, regnum,
+                         &regs->ar[(4 * regs->windowbase + regnum
+                                    - gdbarch_tdep (gdbarch)->a0_base)
+                         % gdbarch_tdep (gdbarch)->num_aregs]);
+  else if (regnum == -1)
+    {
+      for (i = 0; i < C0_NREGS; ++i)
+       regcache_raw_collect (regcache,
+                             gdbarch_tdep (gdbarch)->a0_base + i,
+                             &regs->ar[(4 * regs->windowbase + i)
+                             % gdbarch_tdep (gdbarch)->num_aregs]);
+    }
 }
 
 static void
@@ -134,6 +152,10 @@ supply_gregset_reg (struct regcache *regcache,
     regcache_raw_supply (regcache,
                          gdbarch_tdep (gdbarch)->sar_regnum,
                          &regs->sar);
+  if (regnum == gdbarch_tdep (gdbarch)->threadptr_regnum || regnum == -1)
+    regcache_raw_supply (regcache,
+                         gdbarch_tdep (gdbarch)->threadptr_regnum,
+                         &regs->threadptr);
   if (regnum >=gdbarch_tdep (gdbarch)->ar_base
       && regnum < gdbarch_tdep (gdbarch)->ar_base
                    + gdbarch_tdep (gdbarch)->num_aregs)
@@ -146,6 +168,20 @@ supply_gregset_reg (struct regcache *regcache,
                              gdbarch_tdep (gdbarch)->ar_base + i,
                              &regs->ar[i]);
     }
+  if (regnum >= gdbarch_tdep (gdbarch)->a0_base
+      && regnum < gdbarch_tdep (gdbarch)->a0_base + C0_NREGS)
+    regcache_raw_supply (regcache, regnum,
+                        &regs->ar[(4 * regs->windowbase + regnum
+                                   - gdbarch_tdep (gdbarch)->a0_base)
+                        % gdbarch_tdep (gdbarch)->num_aregs]);
+  else if (regnum == -1)
+    {
+      for (i = 0; i < C0_NREGS; ++i)
+       regcache_raw_supply (regcache,
+                            gdbarch_tdep (gdbarch)->a0_base + i,
+                            &regs->ar[(4 * regs->windowbase + i)
+                            % gdbarch_tdep (gdbarch)->num_aregs]);
+    }
 }
 
 void
@@ -174,7 +210,7 @@ supply_fpregset (struct regcache *regcache,
 static void
 fetch_gregs (struct regcache *regcache, int regnum)
 {
-  int tid = ptid_get_lwp (inferior_ptid);
+  int tid = ptid_get_lwp (regcache_get_ptid (regcache));
   gdb_gregset_t regs;
   int areg;
   
@@ -193,7 +229,7 @@ fetch_gregs (struct regcache *regcache, int regnum)
 static void
 store_gregs (struct regcache *regcache, int regnum)
 {
-  int tid = ptid_get_lwp (inferior_ptid);
+  int tid = ptid_get_lwp (regcache_get_ptid (regcache));
   gdb_gregset_t regs;
   int areg;
 
@@ -221,7 +257,7 @@ static int xtreg_high;
 static void
 fetch_xtregs (struct regcache *regcache, int regnum)
 {
-  int tid = ptid_get_lwp (inferior_ptid);
+  int tid = ptid_get_lwp (regcache_get_ptid (regcache));
   const xtensa_regtable_t *ptr;
   char xtregs [XTENSA_ELF_XTREG_SIZE];
 
@@ -237,7 +273,7 @@ fetch_xtregs (struct regcache *regcache, int regnum)
 static void
 store_xtregs (struct regcache *regcache, int regnum)
 {
-  int tid = ptid_get_lwp (inferior_ptid);
+  int tid = ptid_get_lwp (regcache_get_ptid (regcache));
   const xtensa_regtable_t *ptr;
   char xtregs [XTENSA_ELF_XTREG_SIZE];
 
This page took 0.025538 seconds and 4 git commands to generate.