1 /* Common target dependent for AArch64 systems.
3 Copyright (C) 2018 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 #include <sys/utsname.h>
22 #include "common-defs.h"
23 #include "elf/external.h"
24 #include "elf/common.h"
25 #include "aarch64-sve-linux-ptrace.h"
26 #include "arch/aarch64.h"
28 /* See nat/aarch64-sve-linux-ptrace.h. */
31 aarch64_sve_get_vq (int tid
)
34 struct user_sve_header header
;
36 iovec
.iov_len
= sizeof (header
);
37 iovec
.iov_base
= &header
;
39 /* Ptrace gives the vector length in bytes. Convert it to VQ, the number of
40 128bit chunks in a Z register. We use VQ because 128bits is the minimum
41 a Z register can increase in size. */
43 if (ptrace (PTRACE_GETREGSET
, tid
, NT_ARM_SVE
, &iovec
) < 0)
45 /* SVE is not supported. */
49 long vq
= sve_vq_from_vl (header
.vl
);
51 if (!sve_vl_valid (header
.vl
))
53 warning (_("Invalid SVE state from kernel; SVE disabled."));
This page took 0.031969 seconds and 4 git commands to generate.