Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __SPARC_SIGCONTEXT_H
0003 #define __SPARC_SIGCONTEXT_H
0004 
0005 #include <asm/ptrace.h>
0006 #include <uapi/asm/sigcontext.h>
0007 
0008 #ifndef __ASSEMBLY__
0009 
0010 #define __SUNOS_MAXWIN   31
0011 
0012 /* This is what SunOS does, so shall I unless we use new 32bit signals or rt signals. */
0013 struct sigcontext32 {
0014     int sigc_onstack;      /* state to restore */
0015     int sigc_mask;         /* sigmask to restore */
0016     int sigc_sp;           /* stack pointer */
0017     int sigc_pc;           /* program counter */
0018     int sigc_npc;          /* next program counter */
0019     int sigc_psr;          /* for condition codes etc */
0020     int sigc_g1;           /* User uses these two registers */
0021     int sigc_o0;           /* within the trampoline code. */
0022 
0023     /* Now comes information regarding the users window set
0024      * at the time of the signal.
0025      */
0026     int sigc_oswins;       /* outstanding windows */
0027 
0028     /* stack ptrs for each regwin buf */
0029     unsigned int sigc_spbuf[__SUNOS_MAXWIN];
0030 
0031     /* Windows to restore after signal */
0032     struct reg_window32 sigc_wbuf[__SUNOS_MAXWIN];
0033 };
0034 
0035 
0036 /* This is what we use for 32bit new non-rt signals. */
0037 
0038 typedef struct {
0039     struct {
0040         unsigned int psr;
0041         unsigned int pc;
0042         unsigned int npc;
0043         unsigned int y;
0044         unsigned int u_regs[16]; /* globals and ins */
0045     }           si_regs;
0046     int         si_mask;
0047 } __siginfo32_t;
0048 
0049 #define __SIGC_MAXWIN   7
0050 
0051 typedef struct {
0052     unsigned long locals[8];
0053     unsigned long ins[8];
0054 } __siginfo_reg_window;
0055 
0056 typedef struct {
0057     int         wsaved;
0058     __siginfo_reg_window    reg_window[__SIGC_MAXWIN];
0059     unsigned long       rwbuf_stkptrs[__SIGC_MAXWIN];
0060 } __siginfo_rwin_t;
0061 
0062 #ifdef CONFIG_SPARC64
0063 typedef struct {
0064     unsigned   int si_float_regs [64];
0065     unsigned   long si_fsr;
0066     unsigned   long si_gsr;
0067     unsigned   long si_fprs;
0068 } __siginfo_fpu_t;
0069 
0070 /* This is what SunOS doesn't, so we have to write this alone
0071    and do it properly. */
0072 struct sigcontext {
0073     /* The size of this array has to match SI_MAX_SIZE from siginfo.h */
0074     char            sigc_info[128];
0075     struct {
0076         unsigned long   u_regs[16]; /* globals and ins */
0077         unsigned long   tstate;
0078         unsigned long   tpc;
0079         unsigned long   tnpc;
0080         unsigned int    y;
0081         unsigned int    fprs;
0082     }           sigc_regs;
0083     __siginfo_fpu_t *   sigc_fpu_save;
0084     struct {
0085         void    *   ss_sp;
0086         int     ss_flags;
0087         unsigned long   ss_size;
0088     }           sigc_stack;
0089     unsigned long       sigc_mask;
0090     __siginfo_rwin_t *  sigc_rwin_save;
0091 };
0092 
0093 #else
0094 
0095 typedef struct {
0096     unsigned long si_float_regs [32];
0097     unsigned long si_fsr;
0098     unsigned long si_fpqdepth;
0099     struct {
0100         unsigned long *insn_addr;
0101         unsigned long insn;
0102     } si_fpqueue [16];
0103 } __siginfo_fpu_t;
0104 #endif /* (CONFIG_SPARC64) */
0105 
0106 
0107 #endif /* !(__ASSEMBLY__) */
0108 
0109 #endif /* !(__SPARC_SIGCONTEXT_H) */