1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 /* 3 * Based on arch/arm/include/asm/ptrace.h 4 * 5 * Copyright (C) 1996-2003 Russell King 6 * Copyright (C) 2012 ARM Ltd. 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License version 2 as 10 * published by the Free Software Foundation. 11 * 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. 16 * 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/>. 19 */ 20 #ifndef _UAPI__ASM_PTRACE_H 21 #define _UAPI__ASM_PTRACE_H 22 23 #include <linux/types.h> 24 25 #include <asm/hwcap.h> 26 27 28 /* 29 * PSR bits 30 */ 31 #define PSR_MODE_EL0t 0x00000000 32 #define PSR_MODE_EL1t 0x00000004 33 #define PSR_MODE_EL1h 0x00000005 34 #define PSR_MODE_EL2t 0x00000008 35 #define PSR_MODE_EL2h 0x00000009 36 #define PSR_MODE_EL3t 0x0000000c 37 #define PSR_MODE_EL3h 0x0000000d 38 #define PSR_MODE_MASK 0x0000000f 39 40 /* AArch32 CPSR bits */ 41 #define PSR_MODE32_BIT 0x00000010 42 43 /* AArch64 SPSR bits */ 44 #define PSR_F_BIT 0x00000040 45 #define PSR_I_BIT 0x00000080 46 #define PSR_A_BIT 0x00000100 47 #define PSR_D_BIT 0x00000200 48 #define PSR_PAN_BIT 0x00400000 49 #define PSR_UAO_BIT 0x00800000 50 #define PSR_Q_BIT 0x08000000 51 #define PSR_V_BIT 0x10000000 52 #define PSR_C_BIT 0x20000000 53 #define PSR_Z_BIT 0x40000000 54 #define PSR_N_BIT 0x80000000 55 56 /* 57 * Groups of PSR bits 58 */ 59 #define PSR_f 0xff000000 /* Flags */ 60 #define PSR_s 0x00ff0000 /* Status */ 61 #define PSR_x 0x0000ff00 /* Extension */ 62 #define PSR_c 0x000000ff /* Control */ 63 64 65 #ifndef __ASSEMBLY__ 66 67 /* 68 * User structures for general purpose, floating point and debug registers. 69 */ 70 struct user_pt_regs { 71 __u64 regs[31]; 72 __u64 sp; 73 __u64 pc; 74 __u64 pstate; 75 }; 76 77 struct user_fpsimd_state { 78 __uint128_t vregs[32]; 79 __u32 fpsr; 80 __u32 fpcr; 81 __u32 __reserved[2]; 82 }; 83 84 struct user_hwdebug_state { 85 __u32 dbg_info; 86 __u32 pad; 87 struct { 88 __u64 addr; 89 __u32 ctrl; 90 __u32 pad; 91 } dbg_regs[16]; 92 }; 93 94 #endif /* __ASSEMBLY__ */ 95 96 #endif /* _UAPI__ASM_PTRACE_H */ 97