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 #ifndef AARCH64_SVE_LINUX_PTRACE_H
21 #define AARCH64_SVE_LINUX_PTRACE_H
23 /* Where indicated, this file contains defines and macros lifted directly from
24 the Linux kernel headers, with no modification.
25 Refer to Linux kernel documentation for details. */
27 #include <asm/sigcontext.h>
28 #include <sys/utsname.h>
29 #include <sys/ptrace.h>
30 #include <asm/ptrace.h>
32 /* Read VQ for the given tid using ptrace. If SVE is not supported then zero
33 is returned (on a system that supports SVE, then VQ cannot be zero). */
35 extern unsigned long aarch64_sve_get_vq (int tid
);
37 /* Structures and defines taken from sigcontext.h. */
39 #ifndef SVE_SIG_ZREGS_SIZE
41 #define SVE_VQ_BYTES 16 /* number of bytes per quadword */
44 #define SVE_VQ_MAX 512
46 #define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
47 #define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
49 #define SVE_NUM_ZREGS 32
50 #define SVE_NUM_PREGS 16
52 #define sve_vl_valid(vl) \
53 ((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
55 #endif /* SVE_SIG_ZREGS_SIZE. */
58 /* Structures and defines taken from ptrace.h. */
60 #ifndef SVE_PT_SVE_ZREG_SIZE
62 struct user_sve_header
{
63 __u32 size
; /* total meaningful regset content in bytes */
64 __u32 max_size
; /* maxmium possible size for this thread */
65 __u16 vl
; /* current vector length */
66 __u16 max_vl
; /* maximum possible vector length */
71 #endif /* SVE_PT_SVE_ZREG_SIZE. */
73 #endif /* aarch64-sve-linux-ptrace.h */
This page took 0.040757 seconds and 4 git commands to generate.