+2018-06-11 Alan Hayward <alan.hayward@arm.com>
+
+ * linux-aarch64-ipa.c (get_ipa_tdesc): Add null VQ param.
+ (initialize_low_tracepoint): Likewise
+ * linux-aarch64-low.c (aarch64_arch_setup): Get VQ.
+ * linux-aarch64-tdesc-selftest.c (aarch64_tdesc_test): Add null VQ
+ param.
+ * linux-aarch64-tdesc.c (aarch64_linux_read_description): Add VQ
+ checks.
+ * linux-aarch64-tdesc.h (aarch64_linux_read_description): Add VQ.
+
2018-06-11 Alan Hayward <alan.hayward@arm.com>
* server.h (PBUFSIZ): Increase size
/* Return target_desc to use for IPA, given the tdesc index passed by
gdbserver. Index is ignored, since we have only one tdesc
- at the moment. */
+ at the moment. SVE not yet supported. */
const struct target_desc *
get_ipa_tdesc (int idx)
{
- return aarch64_linux_read_description ();
+ return aarch64_linux_read_description (0);
}
/* Allocate buffer for the jump pads. The branch instruction has a reach
void
initialize_low_tracepoint (void)
{
- aarch64_linux_read_description ();
+ /* SVE not yet supported. */
+ aarch64_linux_read_description (0);
}
#include "gdb_proc_service.h"
#include "arch/aarch64.h"
#include "linux-aarch64-tdesc.h"
+#include "nat/aarch64-sve-linux-ptrace.h"
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
is_elf64 = linux_pid_exe_is_elf_64_file (tid, &machine);
if (is_elf64)
- current_process ()->tdesc = aarch64_linux_read_description ();
+ {
+ uint64_t vq = aarch64_sve_get_vq (tid);
+ current_process ()->tdesc = aarch64_linux_read_description (vq);
+ }
else
current_process ()->tdesc = tdesc_arm_with_neon;
static void
aarch64_tdesc_test ()
{
- const target_desc *tdesc = aarch64_linux_read_description ();
+ const target_desc *tdesc = aarch64_linux_read_description (0);
SELF_CHECK (*tdesc == *tdesc_aarch64);
}
}
#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];
/* Create the aarch64 target description. */
const target_desc *
-aarch64_linux_read_description ()
+aarch64_linux_read_description (uint64_t vq)
{
- 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);
+
+ struct target_desc *tdesc = tdesc_aarch64_list[vq];
- if (*tdesc == NULL)
+ if (tdesc == NULL)
{
- /* SVE not yet supported. */
- *tdesc = aarch64_create_target_description (0);
+ tdesc = aarch64_create_target_description (vq);
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] = tdesc;
}
- return *tdesc;
+ return tdesc;
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-const target_desc * aarch64_linux_read_description ();
+const target_desc * aarch64_linux_read_description (uint64_t vq);
#if GDB_SELF_TEST
void initialize_low_tdesc ();