]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/features/aarch64-tls.c
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / features / aarch64-tls.c
1 /* Copyright (C) 2022-2023 Free Software Foundation, Inc.
2
3 This file is part of GDB.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18 #include "gdbsupport/tdesc.h"
19
20 /* This function is NOT auto generated from xml.
21
22 Create the aarch64 description containing the TLS registers. TPIDR is
23 always available, but TPIDR2 is only available on some systems.
24
25 COUNT is the number of registers in this set. The minimum is 1. */
26
27 static int
28 create_feature_aarch64_tls (struct target_desc *result, long regnum, int count)
29 {
30 /* TPIDR is always present. */
31 gdb_assert (count >= 1);
32
33 struct tdesc_feature *feature;
34
35 feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.tls");
36 tdesc_create_reg (feature, "tpidr", regnum++, 1, NULL, 64, "data_ptr");
37
38 /* Add TPIDR2. */
39 if (count > 1)
40 tdesc_create_reg (feature, "tpidr2", regnum++, 1, NULL, 64, "data_ptr");
41
42 return regnum;
43 }