Update release making notes.
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-aarch64-tdesc.c
index f0761797e9c332971fe00c871d2371da4b0e119a..897fbb43bd28ddf44c69d4162dda43c2589b060f 100644 (file)
@@ -1,6 +1,6 @@
 /* GNU/Linux/aarch64 specific target description, for the remote server
    for GDB.
-   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "server.h"
+
+#include "linux-aarch64-tdesc.h"
+
 #include "tdesc.h"
 #include "arch/aarch64.h"
 #include "linux-aarch32-low.h"
+#include <inttypes.h>
+
+/* All possible aarch64 target descriptors.  */
+struct target_desc *tdesc_aarch64_list[AARCH64_MAX_SVE_VQ + 1][2/*pauth*/];
 
 /* Create the aarch64 target description.  */
 
 const target_desc *
-aarch64_linux_read_description ()
+aarch64_linux_read_description (uint64_t vq, bool pauth_p)
 {
-  static target_desc *aarch64_tdesc = NULL;
-  target_desc **tdesc = &aarch64_tdesc;
+  if (vq > AARCH64_MAX_SVE_VQ)
+    error (_("VQ is %" PRIu64 ", maximum supported value is %d"), vq,
+          AARCH64_MAX_SVE_VQ);
 
-  if (*tdesc == NULL)
+  struct target_desc *tdesc = tdesc_aarch64_list[vq][pauth_p];
+
+  if (tdesc == NULL)
     {
-      /* SVE not yet supported.  */
-      *tdesc = aarch64_create_target_description (0);
+      tdesc = aarch64_create_target_description (vq, pauth_p);
 
       static const char *expedite_regs_aarch64[] = { "x29", "sp", "pc", NULL };
-      init_target_desc (*tdesc, expedite_regs_aarch64);
+      static const char *expedite_regs_aarch64_sve[] = { "x29", "sp", "pc",
+                                                        "vg", NULL };
+
+      if (vq == 0)
+       init_target_desc (tdesc, expedite_regs_aarch64);
+      else
+       init_target_desc (tdesc, expedite_regs_aarch64_sve);
+
+      tdesc_aarch64_list[vq][pauth_p] = tdesc;
     }
 
-  return *tdesc;
+  return tdesc;
 }
This page took 0.02419 seconds and 4 git commands to generate.