1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI__ASM_PTRACE_H
20 #define _UAPI__ASM_PTRACE_H
21 #include <linux/types.h>
22 #include <asm/hwcap.h>
23 #include <asm/sve_context.h>
24 #define PSR_MODE_EL0t 0x00000000
25 #define PSR_MODE_EL1t 0x00000004
26 #define PSR_MODE_EL1h 0x00000005
27 #define PSR_MODE_EL2t 0x00000008
28 #define PSR_MODE_EL2h 0x00000009
29 #define PSR_MODE_EL3t 0x0000000c
30 #define PSR_MODE_EL3h 0x0000000d
31 #define PSR_MODE_MASK 0x0000000f
32 #define PSR_MODE32_BIT 0x00000010
33 #define PSR_F_BIT 0x00000040
34 #define PSR_I_BIT 0x00000080
35 #define PSR_A_BIT 0x00000100
36 #define PSR_D_BIT 0x00000200
37 #define PSR_BTYPE_MASK 0x00000c00
38 #define PSR_SSBS_BIT 0x00001000
39 #define PSR_PAN_BIT 0x00400000
40 #define PSR_UAO_BIT 0x00800000
41 #define PSR_DIT_BIT 0x01000000
42 #define PSR_TCO_BIT 0x02000000
43 #define PSR_V_BIT 0x10000000
44 #define PSR_C_BIT 0x20000000
45 #define PSR_Z_BIT 0x40000000
46 #define PSR_N_BIT 0x80000000
47 #define PSR_BTYPE_SHIFT 10
48 #define PSR_f 0xff000000
49 #define PSR_s 0x00ff0000
50 #define PSR_x 0x0000ff00
51 #define PSR_c 0x000000ff
52 #define PSR_BTYPE_NONE (0b00 << PSR_BTYPE_SHIFT)
53 #define PSR_BTYPE_JC (0b01 << PSR_BTYPE_SHIFT)
54 #define PSR_BTYPE_C (0b10 << PSR_BTYPE_SHIFT)
55 #define PSR_BTYPE_J (0b11 << PSR_BTYPE_SHIFT)
56 #define PTRACE_SYSEMU 31
57 #define PTRACE_SYSEMU_SINGLESTEP 32
58 #define PTRACE_PEEKMTETAGS 33
59 #define PTRACE_POKEMTETAGS 34
60 #ifndef __ASSEMBLY__
61 struct user_pt_regs {
62   __u64 regs[31];
63   __u64 sp;
64   __u64 pc;
65   __u64 pstate;
66 };
67 struct user_fpsimd_state {
68   __uint128_t vregs[32];
69   __u32 fpsr;
70   __u32 fpcr;
71   __u32 __reserved[2];
72 };
73 struct user_hwdebug_state {
74   __u32 dbg_info;
75   __u32 pad;
76   struct {
77     __u64 addr;
78     __u32 ctrl;
79     __u32 pad;
80   } dbg_regs[16];
81 };
82 struct user_sve_header {
83   __u32 size;
84   __u32 max_size;
85   __u16 vl;
86   __u16 max_vl;
87   __u16 flags;
88   __u16 __reserved;
89 };
90 #define SVE_PT_REGS_MASK (1 << 0)
91 #define SVE_PT_REGS_FPSIMD 0
92 #define SVE_PT_REGS_SVE SVE_PT_REGS_MASK
93 #define SVE_PT_VL_INHERIT ((1 << 17) >> 16)
94 #define SVE_PT_VL_ONEXEC ((1 << 18) >> 16)
95 #define SVE_PT_REGS_OFFSET ((sizeof(struct user_sve_header) + (__SVE_VQ_BYTES - 1)) / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
96 #define SVE_PT_FPSIMD_OFFSET SVE_PT_REGS_OFFSET
97 #define SVE_PT_FPSIMD_SIZE(vq,flags) (sizeof(struct user_fpsimd_state))
98 #define SVE_PT_SVE_ZREG_SIZE(vq) __SVE_ZREG_SIZE(vq)
99 #define SVE_PT_SVE_PREG_SIZE(vq) __SVE_PREG_SIZE(vq)
100 #define SVE_PT_SVE_FFR_SIZE(vq) __SVE_FFR_SIZE(vq)
101 #define SVE_PT_SVE_FPSR_SIZE sizeof(__u32)
102 #define SVE_PT_SVE_FPCR_SIZE sizeof(__u32)
103 #define SVE_PT_SVE_OFFSET SVE_PT_REGS_OFFSET
104 #define SVE_PT_SVE_ZREGS_OFFSET (SVE_PT_REGS_OFFSET + __SVE_ZREGS_OFFSET)
105 #define SVE_PT_SVE_ZREG_OFFSET(vq,n) (SVE_PT_REGS_OFFSET + __SVE_ZREG_OFFSET(vq, n))
106 #define SVE_PT_SVE_ZREGS_SIZE(vq) (SVE_PT_SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS) - SVE_PT_SVE_ZREGS_OFFSET)
107 #define SVE_PT_SVE_PREGS_OFFSET(vq) (SVE_PT_REGS_OFFSET + __SVE_PREGS_OFFSET(vq))
108 #define SVE_PT_SVE_PREG_OFFSET(vq,n) (SVE_PT_REGS_OFFSET + __SVE_PREG_OFFSET(vq, n))
109 #define SVE_PT_SVE_PREGS_SIZE(vq) (SVE_PT_SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - SVE_PT_SVE_PREGS_OFFSET(vq))
110 #define SVE_PT_SVE_FFR_OFFSET(vq) (SVE_PT_REGS_OFFSET + __SVE_FFR_OFFSET(vq))
111 #define SVE_PT_SVE_FPSR_OFFSET(vq) ((SVE_PT_SVE_FFR_OFFSET(vq) + SVE_PT_SVE_FFR_SIZE(vq) + (__SVE_VQ_BYTES - 1)) / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
112 #define SVE_PT_SVE_FPCR_OFFSET(vq) (SVE_PT_SVE_FPSR_OFFSET(vq) + SVE_PT_SVE_FPSR_SIZE)
113 #define SVE_PT_SVE_SIZE(vq,flags) ((SVE_PT_SVE_FPCR_OFFSET(vq) + SVE_PT_SVE_FPCR_SIZE - SVE_PT_SVE_OFFSET + (__SVE_VQ_BYTES - 1)) / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
114 #define SVE_PT_SIZE(vq,flags) (((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE ? SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) : SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags))
115 struct user_pac_mask {
116   __u64 data_mask;
117   __u64 insn_mask;
118 };
119 struct user_pac_address_keys {
120   __uint128_t apiakey;
121   __uint128_t apibkey;
122   __uint128_t apdakey;
123   __uint128_t apdbkey;
124 };
125 struct user_pac_generic_keys {
126   __uint128_t apgakey;
127 };
128 #endif
129 #endif
130