Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _UAPI__SPARC_SIGNAL_H
0003 #define _UAPI__SPARC_SIGNAL_H
0004 
0005 #include <asm/sigcontext.h>
0006 #include <linux/compiler.h>
0007 
0008 
0009 /* On the Sparc the signal handlers get passed a 'sub-signal' code
0010  * for certain signal types, which we document here.
0011  */
0012 #define SIGHUP       1
0013 #define SIGINT       2
0014 #define SIGQUIT      3
0015 #define SIGILL       4
0016 #define    SUBSIG_STACK       0
0017 #define    SUBSIG_ILLINST     2
0018 #define    SUBSIG_PRIVINST    3
0019 #define    SUBSIG_BADTRAP(t)  (0x80 + (t))
0020 
0021 #define SIGTRAP      5
0022 #define SIGABRT      6
0023 #define SIGIOT       6
0024 
0025 #define SIGEMT           7
0026 #define    SUBSIG_TAG    10
0027 
0028 #define SIGFPE       8
0029 #define    SUBSIG_FPDISABLED     0x400
0030 #define    SUBSIG_FPERROR        0x404
0031 #define    SUBSIG_FPINTOVFL      0x001
0032 #define    SUBSIG_FPSTSIG        0x002
0033 #define    SUBSIG_IDIVZERO       0x014
0034 #define    SUBSIG_FPINEXACT      0x0c4
0035 #define    SUBSIG_FPDIVZERO      0x0c8
0036 #define    SUBSIG_FPUNFLOW       0x0cc
0037 #define    SUBSIG_FPOPERROR      0x0d0
0038 #define    SUBSIG_FPOVFLOW       0x0d4
0039 
0040 #define SIGKILL      9
0041 #define SIGBUS          10
0042 #define    SUBSIG_BUSTIMEOUT    1
0043 #define    SUBSIG_ALIGNMENT     2
0044 #define    SUBSIG_MISCERROR     5
0045 
0046 #define SIGSEGV     11
0047 #define    SUBSIG_NOMAPPING     3
0048 #define    SUBSIG_PROTECTION    4
0049 #define    SUBSIG_SEGERROR      5
0050 
0051 #define SIGSYS      12
0052 
0053 #define SIGPIPE     13
0054 #define SIGALRM     14
0055 #define SIGTERM     15
0056 #define SIGURG          16
0057 
0058 /* SunOS values which deviate from the Linux/i386 ones */
0059 #define SIGSTOP     17
0060 #define SIGTSTP     18
0061 #define SIGCONT     19
0062 #define SIGCHLD     20
0063 #define SIGTTIN     21
0064 #define SIGTTOU     22
0065 #define SIGIO       23
0066 #define SIGPOLL     SIGIO   /* SysV name for SIGIO */
0067 #define SIGXCPU     24
0068 #define SIGXFSZ     25
0069 #define SIGVTALRM   26
0070 #define SIGPROF     27
0071 #define SIGWINCH    28
0072 #define SIGLOST     29
0073 #define SIGPWR      SIGLOST
0074 #define SIGUSR1     30
0075 #define SIGUSR2     31
0076 
0077 /* Most things should be clean enough to redefine this at will, if care
0078    is taken to make libc match.  */
0079 
0080 #define __OLD_NSIG  32
0081 #define __NEW_NSIG      64
0082 #ifdef __arch64__
0083 #define _NSIG_BPW       64
0084 #else
0085 #define _NSIG_BPW       32
0086 #endif
0087 #define _NSIG_WORDS     (__NEW_NSIG / _NSIG_BPW)
0088 
0089 #define SIGRTMIN       32
0090 #define SIGRTMAX       __NEW_NSIG
0091 
0092 #if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
0093 #define _NSIG           __NEW_NSIG
0094 #define __new_sigset_t      sigset_t
0095 #define __new_sigaction     sigaction
0096 #define __new_sigaction32   sigaction32
0097 #define __old_sigset_t      old_sigset_t
0098 #define __old_sigaction     old_sigaction
0099 #define __old_sigaction32   old_sigaction32
0100 #else
0101 #define _NSIG           __OLD_NSIG
0102 #define NSIG            _NSIG
0103 #define __old_sigset_t      sigset_t
0104 #define __old_sigaction     sigaction
0105 #define __old_sigaction32   sigaction32
0106 #endif
0107 
0108 #ifndef __ASSEMBLY__
0109 
0110 typedef unsigned long __old_sigset_t;            /* at least 32 bits */
0111 
0112 typedef struct {
0113        unsigned long sig[_NSIG_WORDS];
0114 } __new_sigset_t;
0115 
0116 /* A SunOS sigstack */
0117 struct sigstack {
0118     /* XXX 32-bit pointers pinhead XXX */
0119     char *the_stack;
0120     int   cur_status;
0121 };
0122 
0123 /* Sigvec flags */
0124 #define _SV_SSTACK    1u    /* This signal handler should use sig-stack */
0125 #define _SV_INTR      2u    /* Sig return should not restart system call */
0126 #define _SV_RESET     4u    /* Set handler to SIG_DFL upon taken signal */
0127 #define _SV_IGNCHILD  8u    /* Do not send SIGCHLD */
0128 
0129 /*
0130  * sa_flags values: SA_STACK is not currently supported, but will allow the
0131  * usage of signal stacks by using the (now obsolete) sa_restorer field in
0132  * the sigaction structure as a stack pointer. This is now possible due to
0133  * the changes in signal handling. LBT 010493.
0134  * SA_RESTART flag to get restarting signals (which were the default long ago)
0135  */
0136 #define SA_NOCLDSTOP    _SV_IGNCHILD
0137 #define SA_STACK    _SV_SSTACK
0138 #define SA_ONSTACK  _SV_SSTACK
0139 #define SA_RESTART  _SV_INTR
0140 #define SA_RESETHAND    _SV_RESET
0141 #define SA_NODEFER  0x20u
0142 #define SA_NOCLDWAIT    0x100u
0143 #define SA_SIGINFO      0x200u
0144 
0145 #define SIG_BLOCK          0x01 /* for blocking signals */
0146 #define SIG_UNBLOCK        0x02 /* for unblocking signals */
0147 #define SIG_SETMASK        0x04 /* for setting the signal mask */
0148 
0149 #define MINSIGSTKSZ 4096
0150 #define SIGSTKSZ    16384
0151 
0152 
0153 #include <asm-generic/signal-defs.h>
0154 #include <asm/posix_types.h>
0155 
0156 #ifndef __KERNEL__
0157 struct __new_sigaction {
0158     __sighandler_t      sa_handler;
0159     unsigned long       sa_flags;
0160     __sigrestore_t      sa_restorer;  /* not used by Linux/SPARC yet */
0161     __new_sigset_t      sa_mask;
0162 };
0163 
0164 struct __old_sigaction {
0165     __sighandler_t      sa_handler;
0166     __old_sigset_t      sa_mask;
0167     unsigned long       sa_flags;
0168     void            (*sa_restorer)(void);  /* not used by Linux/SPARC yet */
0169 };
0170 #endif
0171 
0172 typedef struct sigaltstack {
0173     void            __user *ss_sp;
0174     int         ss_flags;
0175     __kernel_size_t     ss_size;
0176 } stack_t;
0177 
0178 
0179 #endif /* !(__ASSEMBLY__) */
0180 
0181 #endif /* _UAPI__SPARC_SIGNAL_H */