xref: /openbmc/linux/arch/riscv/include/uapi/asm/sigcontext.h (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
1d9c52522SMasahiro Yamada /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2e2c0cdfbSPalmer Dabbelt /*
3e2c0cdfbSPalmer Dabbelt  * Copyright (C) 2012 Regents of the University of California
4e2c0cdfbSPalmer Dabbelt  */
5e2c0cdfbSPalmer Dabbelt 
6e2c0cdfbSPalmer Dabbelt #ifndef _UAPI_ASM_RISCV_SIGCONTEXT_H
7e2c0cdfbSPalmer Dabbelt #define _UAPI_ASM_RISCV_SIGCONTEXT_H
8e2c0cdfbSPalmer Dabbelt 
9e2c0cdfbSPalmer Dabbelt #include <asm/ptrace.h>
10e2c0cdfbSPalmer Dabbelt 
118ee0b418SGreentime Hu /* The Magic number for signal context frame header. */
128ee0b418SGreentime Hu #define RISCV_V_MAGIC	0x53465457
138ee0b418SGreentime Hu #define END_MAGIC	0x0
148ee0b418SGreentime Hu 
158ee0b418SGreentime Hu /* The size of END signal context header. */
168ee0b418SGreentime Hu #define END_HDR_SIZE	0x0
178ee0b418SGreentime Hu 
18e50db34eSPalmer Dabbelt #ifndef __ASSEMBLY__
19e50db34eSPalmer Dabbelt 
208ee0b418SGreentime Hu struct __sc_riscv_v_state {
218ee0b418SGreentime Hu 	struct __riscv_v_ext_state v_state;
228ee0b418SGreentime Hu } __attribute__((aligned(16)));
238ee0b418SGreentime Hu 
24e2c0cdfbSPalmer Dabbelt /*
25e2c0cdfbSPalmer Dabbelt  * Signal context structure
26e2c0cdfbSPalmer Dabbelt  *
27e2c0cdfbSPalmer Dabbelt  * This contains the context saved before a signal handler is invoked;
28*471aba2eSGuo Ren  * it is restored by sys_rt_sigreturn.
29e2c0cdfbSPalmer Dabbelt  */
30e2c0cdfbSPalmer Dabbelt struct sigcontext {
31e2c0cdfbSPalmer Dabbelt 	struct user_regs_struct sc_regs;
328ee0b418SGreentime Hu 	union {
33e2c0cdfbSPalmer Dabbelt 		union __riscv_fp_state sc_fpregs;
348ee0b418SGreentime Hu 		struct __riscv_extra_ext_header sc_extdesc;
358ee0b418SGreentime Hu 	};
36e2c0cdfbSPalmer Dabbelt };
37e2c0cdfbSPalmer Dabbelt 
38e50db34eSPalmer Dabbelt #endif /*!__ASSEMBLY__*/
39e50db34eSPalmer Dabbelt 
40e2c0cdfbSPalmer Dabbelt #endif /* _UAPI_ASM_RISCV_SIGCONTEXT_H */
41