diff options
author | Luis Machado <luis.machado@arm.com> | 2023-04-04 17:20:46 +0100 |
---|---|---|
committer | Luis Machado <luis.machado@arm.com> | 2023-10-04 16:23:40 +0100 |
commit | 42019af621005a274d1a658f4c752a98fe5bab8e (patch) | |
tree | e1ffbb608ef942726edb6a813fde7c2b5f4ac384 /gdb/features | |
parent | 6762e153a9e4e450b1a9904f9c96ec9f9b4cbc31 (diff) | |
download | binutils-42019af621005a274d1a658f4c752a98fe5bab8e.zip binutils-42019af621005a274d1a658f4c752a98fe5bab8e.tar.gz binutils-42019af621005a274d1a658f4c752a98fe5bab8e.tar.bz2 |
sme2: Enable SME2 for AArch64 gdb on Linux
SME2 defines a new 512-bit register named ZT0, and it is only available
if SME is also supported. The ZT0 state is valid only if the SVCR ZA bit
is enabled. Otherwise its contents are empty (0).
The target description is dynamic and gets generated at runtime based on the
availability of the feature.
Validated under Fast Models.
Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Diffstat (limited to 'gdb/features')
-rw-r--r-- | gdb/features/aarch64-sme2.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gdb/features/aarch64-sme2.c b/gdb/features/aarch64-sme2.c new file mode 100644 index 0000000..a14b98f --- /dev/null +++ b/gdb/features/aarch64-sme2.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2023 Free Software Foundation, Inc. + + This file is part of GDB. + + 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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, see <http://www.gnu.org/licenses/>. */ + +#include "gdbsupport/tdesc.h" + +/* This function is NOT auto generated from xml. Create the AArch64 SME2 + feature into RESULT. + + The ZT0 register is only available when the SME ZA register is + available. */ + +static int +create_feature_aarch64_sme2 (struct target_desc *result, long regnum) +{ + struct tdesc_feature *feature; + tdesc_type *element_type; + + feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.sme2"); + + /* Byte type. */ + element_type = tdesc_named_type (feature, "uint8"); + + /* Vector of 64 bytes. */ + element_type = tdesc_create_vector (feature, "sme2_bv", element_type, 64); + + /* The following is the ZT0 register, with 512 bits (64 bytes). */ + tdesc_create_reg (feature, "zt0", regnum++, 1, nullptr, 512, "sme2_bv"); + return regnum; +} |