1 /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
3 * Copyright (C) 2012 Regents of the University of California
6 #ifndef _UAPI_ASM_RISCV_PTRACE_H
7 #define _UAPI_ASM_RISCV_PTRACE_H
11 #include <linux/types.h>
14 * User-mode register state for core dumps, ptrace, sigcontext
16 * This decouples struct pt_regs from the userspace ABI.
17 * struct user_regs_struct must form a prefix of struct pt_regs.
19 struct user_regs_struct {
54 struct __riscv_f_ext_state {
59 struct __riscv_d_ext_state {
64 struct __riscv_q_ext_state {
65 __u64 f[64] __attribute__((aligned(16)));
68 * Reserved for expansion of sigcontext structure. Currently zeroed
69 * upon signal, and must be zero upon sigreturn.
74 struct __riscv_ctx_hdr {
79 struct __riscv_extra_ext_header {
80 __u32 __padding[129] __attribute__((aligned(16)));
82 * Reserved for expansion of sigcontext structure. Currently zeroed
83 * upon signal, and must be zero upon sigreturn.
86 struct __riscv_ctx_hdr hdr;
89 union __riscv_fp_state {
90 struct __riscv_f_ext_state f;
91 struct __riscv_d_ext_state d;
92 struct __riscv_q_ext_state q;
95 struct __riscv_v_ext_state {
103 * In signal handler, datap will be set a correct user stack offset
104 * and vector registers will be copied to the address of datap
107 * In ptrace syscall, datap will be set to zero and the vector
108 * registers will be copied to the address right after this
114 * According to spec: The number of bits in a single vector register,
115 * VLEN >= ELEN, which must be a power of 2, and must be no greater than
116 * 2^16 = 65536bits = 8192bytes
118 #define RISCV_MAX_VLENB (8192)
120 #endif /* __ASSEMBLY__ */
122 #endif /* _UAPI_ASM_RISCV_PTRACE_H */