David Howells | 4262a72 | 2012-10-11 11:05:13 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Based on arch/arm/include/asm/ptrace.h |
| 3 | * |
| 4 | * Copyright (C) 1996-2003 Russell King |
| 5 | * Copyright (C) 2012 ARM Ltd. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | #ifndef _UAPI__ASM_PTRACE_H |
| 20 | #define _UAPI__ASM_PTRACE_H |
| 21 | |
| 22 | #include <linux/types.h> |
| 23 | |
| 24 | #include <asm/hwcap.h> |
| 25 | |
| 26 | |
| 27 | /* |
| 28 | * PSR bits |
| 29 | */ |
| 30 | #define PSR_MODE_EL0t 0x00000000 |
| 31 | #define PSR_MODE_EL1t 0x00000004 |
| 32 | #define PSR_MODE_EL1h 0x00000005 |
| 33 | #define PSR_MODE_EL2t 0x00000008 |
| 34 | #define PSR_MODE_EL2h 0x00000009 |
| 35 | #define PSR_MODE_EL3t 0x0000000c |
| 36 | #define PSR_MODE_EL3h 0x0000000d |
| 37 | #define PSR_MODE_MASK 0x0000000f |
| 38 | |
| 39 | /* AArch32 CPSR bits */ |
| 40 | #define PSR_MODE32_BIT 0x00000010 |
| 41 | |
| 42 | /* AArch64 SPSR bits */ |
| 43 | #define PSR_F_BIT 0x00000040 |
| 44 | #define PSR_I_BIT 0x00000080 |
| 45 | #define PSR_A_BIT 0x00000100 |
| 46 | #define PSR_D_BIT 0x00000200 |
| 47 | #define PSR_Q_BIT 0x08000000 |
| 48 | #define PSR_V_BIT 0x10000000 |
| 49 | #define PSR_C_BIT 0x20000000 |
| 50 | #define PSR_Z_BIT 0x40000000 |
| 51 | #define PSR_N_BIT 0x80000000 |
| 52 | |
| 53 | /* |
| 54 | * Groups of PSR bits |
| 55 | */ |
| 56 | #define PSR_f 0xff000000 /* Flags */ |
| 57 | #define PSR_s 0x00ff0000 /* Status */ |
| 58 | #define PSR_x 0x0000ff00 /* Extension */ |
| 59 | #define PSR_c 0x000000ff /* Control */ |
| 60 | |
| 61 | |
| 62 | #ifndef __ASSEMBLY__ |
| 63 | |
| 64 | /* |
| 65 | * User structures for general purpose, floating point and debug registers. |
| 66 | */ |
| 67 | struct user_pt_regs { |
| 68 | __u64 regs[31]; |
| 69 | __u64 sp; |
| 70 | __u64 pc; |
| 71 | __u64 pstate; |
| 72 | }; |
| 73 | |
| 74 | struct user_fpsimd_state { |
| 75 | __uint128_t vregs[32]; |
| 76 | __u32 fpsr; |
| 77 | __u32 fpcr; |
| 78 | }; |
| 79 | |
| 80 | struct user_hwdebug_state { |
| 81 | __u32 dbg_info; |
Will Deacon | 7797d17 | 2012-10-11 12:10:57 +0100 | [diff] [blame] | 82 | __u32 pad; |
David Howells | 4262a72 | 2012-10-11 11:05:13 +0100 | [diff] [blame] | 83 | struct { |
| 84 | __u64 addr; |
| 85 | __u32 ctrl; |
Will Deacon | 7797d17 | 2012-10-11 12:10:57 +0100 | [diff] [blame] | 86 | __u32 pad; |
David Howells | 4262a72 | 2012-10-11 11:05:13 +0100 | [diff] [blame] | 87 | } dbg_regs[16]; |
| 88 | }; |
| 89 | |
David Howells | 4262a72 | 2012-10-11 11:05:13 +0100 | [diff] [blame] | 90 | #endif /* __ASSEMBLY__ */ |
| 91 | |
| 92 | #endif /* _UAPI__ASM_PTRACE_H */ |