xref: /openbmc/linux/arch/riscv/include/uapi/asm/ptrace.h (revision e3d786a3)
1 /*
2  * Copyright (C) 2012 Regents of the University of California
3  *
4  *   This program is free software; you can redistribute it and/or
5  *   modify it under the terms of the GNU General Public License
6  *   as published by the Free Software Foundation, version 2.
7  *
8  *   This program is distributed in the hope that it will be useful,
9  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
10  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  *   GNU General Public License for more details.
12  */
13 
14 #ifndef _UAPI_ASM_RISCV_PTRACE_H
15 #define _UAPI_ASM_RISCV_PTRACE_H
16 
17 #ifndef __ASSEMBLY__
18 
19 #include <linux/types.h>
20 
21 /*
22  * User-mode register state for core dumps, ptrace, sigcontext
23  *
24  * This decouples struct pt_regs from the userspace ABI.
25  * struct user_regs_struct must form a prefix of struct pt_regs.
26  */
27 struct user_regs_struct {
28 	unsigned long pc;
29 	unsigned long ra;
30 	unsigned long sp;
31 	unsigned long gp;
32 	unsigned long tp;
33 	unsigned long t0;
34 	unsigned long t1;
35 	unsigned long t2;
36 	unsigned long s0;
37 	unsigned long s1;
38 	unsigned long a0;
39 	unsigned long a1;
40 	unsigned long a2;
41 	unsigned long a3;
42 	unsigned long a4;
43 	unsigned long a5;
44 	unsigned long a6;
45 	unsigned long a7;
46 	unsigned long s2;
47 	unsigned long s3;
48 	unsigned long s4;
49 	unsigned long s5;
50 	unsigned long s6;
51 	unsigned long s7;
52 	unsigned long s8;
53 	unsigned long s9;
54 	unsigned long s10;
55 	unsigned long s11;
56 	unsigned long t3;
57 	unsigned long t4;
58 	unsigned long t5;
59 	unsigned long t6;
60 };
61 
62 struct __riscv_f_ext_state {
63 	__u32 f[32];
64 	__u32 fcsr;
65 };
66 
67 struct __riscv_d_ext_state {
68 	__u64 f[32];
69 	__u32 fcsr;
70 };
71 
72 struct __riscv_q_ext_state {
73 	__u64 f[64] __attribute__((aligned(16)));
74 	__u32 fcsr;
75 	/*
76 	 * Reserved for expansion of sigcontext structure.  Currently zeroed
77 	 * upon signal, and must be zero upon sigreturn.
78 	 */
79 	__u32 reserved[3];
80 };
81 
82 union __riscv_fp_state {
83 	struct __riscv_f_ext_state f;
84 	struct __riscv_d_ext_state d;
85 	struct __riscv_q_ext_state q;
86 };
87 
88 #endif /* __ASSEMBLY__ */
89 
90 #endif /* _UAPI_ASM_RISCV_PTRACE_H */
91