| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* $Id: signal.h,v 1.9 1999/09/06 08:22:11 jj Exp $ */ | 
|  | 2 | #ifndef _ASMSPARC64_SIGNAL_H | 
|  | 3 | #define _ASMSPARC64_SIGNAL_H | 
|  | 4 |  | 
|  | 5 | #include <asm/sigcontext.h> | 
|  | 6 |  | 
|  | 7 | #ifdef __KERNEL__ | 
|  | 8 | #ifndef __ASSEMBLY__ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #include <linux/personality.h> | 
|  | 10 | #include <linux/types.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #endif | 
|  | 12 | #endif | 
|  | 13 |  | 
|  | 14 | /* On the Sparc the signal handlers get passed a 'sub-signal' code | 
|  | 15 | * for certain signal types, which we document here. | 
|  | 16 | */ | 
|  | 17 | #define SIGHUP		 1 | 
|  | 18 | #define SIGINT		 2 | 
|  | 19 | #define SIGQUIT		 3 | 
|  | 20 | #define SIGILL		 4 | 
|  | 21 | #define    SUBSIG_STACK       0 | 
|  | 22 | #define    SUBSIG_ILLINST     2 | 
|  | 23 | #define    SUBSIG_PRIVINST    3 | 
|  | 24 | #define    SUBSIG_BADTRAP(t)  (0x80 + (t)) | 
|  | 25 |  | 
|  | 26 | #define SIGTRAP		 5 | 
|  | 27 | #define SIGABRT		 6 | 
|  | 28 | #define SIGIOT		 6 | 
|  | 29 |  | 
|  | 30 | #define SIGEMT           7 | 
|  | 31 | #define    SUBSIG_TAG    10 | 
|  | 32 |  | 
|  | 33 | #define SIGFPE		 8 | 
|  | 34 | #define    SUBSIG_FPDISABLED     0x400 | 
|  | 35 | #define    SUBSIG_FPERROR        0x404 | 
|  | 36 | #define    SUBSIG_FPINTOVFL      0x001 | 
|  | 37 | #define    SUBSIG_FPSTSIG        0x002 | 
|  | 38 | #define    SUBSIG_IDIVZERO       0x014 | 
|  | 39 | #define    SUBSIG_FPINEXACT      0x0c4 | 
|  | 40 | #define    SUBSIG_FPDIVZERO      0x0c8 | 
|  | 41 | #define    SUBSIG_FPUNFLOW       0x0cc | 
|  | 42 | #define    SUBSIG_FPOPERROR      0x0d0 | 
|  | 43 | #define    SUBSIG_FPOVFLOW       0x0d4 | 
|  | 44 |  | 
|  | 45 | #define SIGKILL		 9 | 
|  | 46 | #define SIGBUS          10 | 
|  | 47 | #define    SUBSIG_BUSTIMEOUT    1 | 
|  | 48 | #define    SUBSIG_ALIGNMENT     2 | 
|  | 49 | #define    SUBSIG_MISCERROR     5 | 
|  | 50 |  | 
|  | 51 | #define SIGSEGV		11 | 
|  | 52 | #define    SUBSIG_NOMAPPING     3 | 
|  | 53 | #define    SUBSIG_PROTECTION    4 | 
|  | 54 | #define    SUBSIG_SEGERROR      5 | 
|  | 55 |  | 
|  | 56 | #define SIGSYS		12 | 
|  | 57 |  | 
|  | 58 | #define SIGPIPE		13 | 
|  | 59 | #define SIGALRM		14 | 
|  | 60 | #define SIGTERM		15 | 
|  | 61 | #define SIGURG          16 | 
|  | 62 |  | 
|  | 63 | /* SunOS values which deviate from the Linux/i386 ones */ | 
|  | 64 | #define SIGSTOP		17 | 
|  | 65 | #define SIGTSTP		18 | 
|  | 66 | #define SIGCONT		19 | 
|  | 67 | #define SIGCHLD		20 | 
|  | 68 | #define SIGTTIN		21 | 
|  | 69 | #define SIGTTOU		22 | 
|  | 70 | #define SIGIO		23 | 
|  | 71 | #define SIGPOLL		SIGIO   /* SysV name for SIGIO */ | 
|  | 72 | #define SIGXCPU		24 | 
|  | 73 | #define SIGXFSZ		25 | 
|  | 74 | #define SIGVTALRM	26 | 
|  | 75 | #define SIGPROF		27 | 
|  | 76 | #define SIGWINCH	28 | 
|  | 77 | #define SIGLOST		29 | 
|  | 78 | #define SIGPWR		SIGLOST | 
|  | 79 | #define SIGUSR1		30 | 
|  | 80 | #define SIGUSR2		31 | 
|  | 81 |  | 
|  | 82 | /* Most things should be clean enough to redefine this at will, if care | 
|  | 83 | is taken to make libc match.  */ | 
|  | 84 |  | 
|  | 85 | #define __OLD_NSIG	32 | 
|  | 86 | #define __NEW_NSIG      64 | 
|  | 87 | #define _NSIG_BPW     	64 | 
|  | 88 | #define _NSIG_WORDS   	(__NEW_NSIG / _NSIG_BPW) | 
|  | 89 |  | 
|  | 90 | #define SIGRTMIN       32 | 
|  | 91 | #define SIGRTMAX       __NEW_NSIG | 
|  | 92 |  | 
|  | 93 | #if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__) | 
|  | 94 | #define _NSIG			__NEW_NSIG | 
|  | 95 | #define __new_sigset_t		sigset_t | 
|  | 96 | #define __new_sigaction		sigaction | 
|  | 97 | #define __new_sigaction32	sigaction32 | 
|  | 98 | #define __old_sigset_t		old_sigset_t | 
|  | 99 | #define __old_sigaction		old_sigaction | 
|  | 100 | #define __old_sigaction32	old_sigaction32 | 
|  | 101 | #else | 
|  | 102 | #define _NSIG			__OLD_NSIG | 
|  | 103 | #define NSIG			_NSIG | 
|  | 104 | #define __old_sigset_t		sigset_t | 
|  | 105 | #define __old_sigaction		sigaction | 
|  | 106 | #define __old_sigaction32	sigaction32 | 
|  | 107 | #endif | 
|  | 108 |  | 
|  | 109 | #ifndef __ASSEMBLY__ | 
|  | 110 |  | 
|  | 111 | typedef unsigned long __old_sigset_t;            /* at least 32 bits */ | 
|  | 112 |  | 
|  | 113 | typedef struct { | 
|  | 114 | unsigned long sig[_NSIG_WORDS]; | 
|  | 115 | } __new_sigset_t; | 
|  | 116 |  | 
|  | 117 | /* A SunOS sigstack */ | 
|  | 118 | struct sigstack { | 
|  | 119 | /* XXX 32-bit pointers pinhead XXX */ | 
|  | 120 | char *the_stack; | 
|  | 121 | int   cur_status; | 
|  | 122 | }; | 
|  | 123 |  | 
|  | 124 | /* Sigvec flags */ | 
|  | 125 | #define _SV_SSTACK    1u    /* This signal handler should use sig-stack */ | 
|  | 126 | #define _SV_INTR      2u    /* Sig return should not restart system call */ | 
|  | 127 | #define _SV_RESET     4u    /* Set handler to SIG_DFL upon taken signal */ | 
|  | 128 | #define _SV_IGNCHILD  8u    /* Do not send SIGCHLD */ | 
|  | 129 |  | 
|  | 130 | /* | 
|  | 131 | * sa_flags values: SA_STACK is not currently supported, but will allow the | 
|  | 132 | * usage of signal stacks by using the (now obsolete) sa_restorer field in | 
|  | 133 | * the sigaction structure as a stack pointer. This is now possible due to | 
|  | 134 | * the changes in signal handling. LBT 010493. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | */ | 
|  | 137 | #define SA_NOCLDSTOP	_SV_IGNCHILD | 
|  | 138 | #define SA_STACK	_SV_SSTACK | 
|  | 139 | #define SA_ONSTACK	_SV_SSTACK | 
|  | 140 | #define SA_RESTART	_SV_INTR | 
|  | 141 | #define SA_ONESHOT	_SV_RESET | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | #define SA_NOMASK	0x20u | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | #define SA_NOCLDWAIT    0x100u | 
|  | 144 | #define SA_SIGINFO      0x200u | 
|  | 145 |  | 
|  | 146 |  | 
|  | 147 | #define SIG_BLOCK          0x01	/* for blocking signals */ | 
|  | 148 | #define SIG_UNBLOCK        0x02	/* for unblocking signals */ | 
|  | 149 | #define SIG_SETMASK        0x04	/* for setting the signal mask */ | 
|  | 150 |  | 
|  | 151 | /* | 
|  | 152 | * sigaltstack controls | 
|  | 153 | */ | 
|  | 154 | #define SS_ONSTACK	1 | 
|  | 155 | #define SS_DISABLE	2 | 
|  | 156 |  | 
|  | 157 | #define MINSIGSTKSZ	4096 | 
|  | 158 | #define SIGSTKSZ	16384 | 
|  | 159 |  | 
| Al Viro | b1ecb4c | 2005-05-04 05:40:12 +0100 | [diff] [blame] | 160 | #include <asm-generic/signal.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 |  | 
|  | 162 | struct __new_sigaction { | 
|  | 163 | __sighandler_t		sa_handler; | 
|  | 164 | unsigned long		sa_flags; | 
|  | 165 | __sigrestore_t 		sa_restorer;  /* not used by Linux/SPARC yet */ | 
|  | 166 | __new_sigset_t		sa_mask; | 
|  | 167 | }; | 
|  | 168 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | struct __old_sigaction { | 
|  | 170 | __sighandler_t  	sa_handler; | 
|  | 171 | __old_sigset_t  	sa_mask; | 
|  | 172 | unsigned long   	sa_flags; | 
|  | 173 | void 			(*sa_restorer)(void);     /* not used by Linux/SPARC yet */ | 
|  | 174 | }; | 
|  | 175 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | typedef struct sigaltstack { | 
|  | 177 | void			__user *ss_sp; | 
|  | 178 | int			ss_flags; | 
|  | 179 | size_t			ss_size; | 
|  | 180 | } stack_t; | 
|  | 181 |  | 
|  | 182 | #ifdef __KERNEL__ | 
|  | 183 |  | 
| David S. Miller | 14cc6ab | 2006-10-02 14:17:57 -0700 | [diff] [blame] | 184 | struct k_sigaction { | 
|  | 185 | struct __new_sigaction 	sa; | 
|  | 186 | void __user		*ka_restorer; | 
|  | 187 | }; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 |  | 
|  | 189 | struct signal_deliver_cookie { | 
|  | 190 | int restart_syscall; | 
|  | 191 | unsigned long orig_i0; | 
|  | 192 | }; | 
|  | 193 |  | 
|  | 194 | struct pt_regs; | 
|  | 195 | extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie); | 
|  | 196 |  | 
|  | 197 | #endif /* !(__KERNEL__) */ | 
|  | 198 |  | 
|  | 199 | #endif /* !(__ASSEMBLY__) */ | 
|  | 200 |  | 
|  | 201 | #endif /* !(_ASMSPARC64_SIGNAL_H) */ |