aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/linux-aarch64-low.cc
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-05-18 13:32:04 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2022-05-18 13:32:04 -0700
commit0ee6b1c511c0e2a6793568692d2e5418cd6bc10d (patch)
tree9bdc905affb28e3214b29ff650ef51650c020d06 /gdbserver/linux-aarch64-low.cc
parent04dfe7aa52171d110db813bce67c0eea5f4b18cd (diff)
downloadfsf-binutils-gdb-0ee6b1c511c0e2a6793568692d2e5418cd6bc10d.zip
fsf-binutils-gdb-0ee6b1c511c0e2a6793568692d2e5418cd6bc10d.tar.gz
fsf-binutils-gdb-0ee6b1c511c0e2a6793568692d2e5418cd6bc10d.tar.bz2
Use aarch64_features to describe register features in target descriptions.
Replace the sve bool member of aarch64_features with a vq member that holds the vector quotient. It is zero if SVE is not present. Add std::hash<> specialization and operator== so that aarch64_features can be used as a key with std::unordered_map<>. Change the various functions that create or lookup aarch64 target descriptions to accept a const aarch64_features object rather than a growing number of arguments. Replace the multi-dimension tdesc_aarch64_list arrays used to cache target descriptions with unordered_maps indexed by aarch64_feature.
Diffstat (limited to 'gdbserver/linux-aarch64-low.cc')
-rw-r--r--gdbserver/linux-aarch64-low.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc
index ba0a810..db50869 100644
--- a/gdbserver/linux-aarch64-low.cc
+++ b/gdbserver/linux-aarch64-low.cc
@@ -779,11 +779,11 @@ aarch64_adjust_register_sets (const struct aarch64_features &features)
break;
case NT_FPREGSET:
/* This is unavailable when SVE is present. */
- if (!features.sve)
+ if (features.vq == 0)
regset->size = sizeof (struct user_fpsimd_state);
break;
case NT_ARM_SVE:
- if (features.sve)
+ if (features.vq > 0)
regset->size = SVE_PT_SIZE (AARCH64_MAX_SVE_VQ, SVE_PT_REGS_SVE);
break;
case NT_ARM_PAC_MASK:
@@ -824,17 +824,14 @@ aarch64_target::low_arch_setup ()
{
struct aarch64_features features;
- uint64_t vq = aarch64_sve_get_vq (tid);
- features.sve = (vq > 0);
+ features.vq = aarch64_sve_get_vq (tid);
/* A-profile PAC is 64-bit only. */
features.pauth = linux_get_hwcap (8) & AARCH64_HWCAP_PACA;
/* A-profile MTE is 64-bit only. */
features.mte = linux_get_hwcap2 (8) & HWCAP2_MTE;
features.tls = true;
- current_process ()->tdesc
- = aarch64_linux_read_description (vq, features.pauth, features.mte,
- features.tls);
+ current_process ()->tdesc = aarch64_linux_read_description (features);
/* Adjust the register sets we should use for this particular set of
features. */