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
5 #include <asm/sigcontext.h>
9 #include <linux/config.h>
10 #include <linux/personality.h>
11 #include <linux/types.h>
12 #include <linux/compat.h>
16 /* On the Sparc the signal handlers get passed a 'sub-signal' code
17 * for certain signal types, which we document here.
23 #define SUBSIG_STACK 0
24 #define SUBSIG_ILLINST 2
25 #define SUBSIG_PRIVINST 3
26 #define SUBSIG_BADTRAP(t) (0x80 + (t))
36 #define SUBSIG_FPDISABLED 0x400
37 #define SUBSIG_FPERROR 0x404
38 #define SUBSIG_FPINTOVFL 0x001
39 #define SUBSIG_FPSTSIG 0x002
40 #define SUBSIG_IDIVZERO 0x014
41 #define SUBSIG_FPINEXACT 0x0c4
42 #define SUBSIG_FPDIVZERO 0x0c8
43 #define SUBSIG_FPUNFLOW 0x0cc
44 #define SUBSIG_FPOPERROR 0x0d0
45 #define SUBSIG_FPOVFLOW 0x0d4
49 #define SUBSIG_BUSTIMEOUT 1
50 #define SUBSIG_ALIGNMENT 2
51 #define SUBSIG_MISCERROR 5
54 #define SUBSIG_NOMAPPING 3
55 #define SUBSIG_PROTECTION 4
56 #define SUBSIG_SEGERROR 5
65 /* SunOS values which deviate from the Linux/i386 ones */
73 #define SIGPOLL SIGIO /* SysV name for SIGIO */
80 #define SIGPWR SIGLOST
84 /* Most things should be clean enough to redefine this at will, if care
85 is taken to make libc match. */
90 #define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
93 #define SIGRTMAX __NEW_NSIG
95 #if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
96 #define _NSIG __NEW_NSIG
97 #define __new_sigset_t sigset_t
98 #define __new_sigaction sigaction
99 #define __new_sigaction32 sigaction32
100 #define __old_sigset_t old_sigset_t
101 #define __old_sigaction old_sigaction
102 #define __old_sigaction32 old_sigaction32
104 #define _NSIG __OLD_NSIG
106 #define __old_sigset_t sigset_t
107 #define __old_sigaction sigaction
108 #define __old_sigaction32 sigaction32
113 typedef unsigned long __old_sigset_t
; /* at least 32 bits */
116 unsigned long sig
[_NSIG_WORDS
];
119 /* A SunOS sigstack */
121 /* XXX 32-bit pointers pinhead XXX */
127 #define _SV_SSTACK 1u /* This signal handler should use sig-stack */
128 #define _SV_INTR 2u /* Sig return should not restart system call */
129 #define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
130 #define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
133 * sa_flags values: SA_STACK is not currently supported, but will allow the
134 * usage of signal stacks by using the (now obsolete) sa_restorer field in
135 * the sigaction structure as a stack pointer. This is now possible due to
136 * the changes in signal handling. LBT 010493.
137 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
138 * SA_RESTART flag to get restarting signals (which were the default long ago)
139 * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
141 #define SA_NOCLDSTOP _SV_IGNCHILD
142 #define SA_STACK _SV_SSTACK
143 #define SA_ONSTACK _SV_SSTACK
144 #define SA_RESTART _SV_INTR
145 #define SA_ONESHOT _SV_RESET
146 #define SA_INTERRUPT 0x10u
147 #define SA_NOMASK 0x20u
148 #define SA_NOCLDWAIT 0x100u
149 #define SA_SIGINFO 0x200u
152 #define SIG_BLOCK 0x01 /* for blocking signals */
153 #define SIG_UNBLOCK 0x02 /* for unblocking signals */
154 #define SIG_SETMASK 0x04 /* for setting the signal mask */
157 * sigaltstack controls
162 #define MINSIGSTKSZ 4096
163 #define SIGSTKSZ 16384
165 #include <asm-generic/signal.h>
167 struct __new_sigaction
{
168 __sighandler_t sa_handler
;
169 unsigned long sa_flags
;
170 __sigrestore_t sa_restorer
; /* not used by Linux/SPARC yet */
171 __new_sigset_t sa_mask
;
177 struct __new_sigaction32
{
179 unsigned int sa_flags
;
180 unsigned sa_restorer
; /* not used by Linux/SPARC yet */
181 compat_sigset_t sa_mask
;
186 struct __new_sigaction sa
;
187 void __user
*ka_restorer
;
191 struct __old_sigaction
{
192 __sighandler_t sa_handler
;
193 __old_sigset_t sa_mask
;
194 unsigned long sa_flags
;
195 void (*sa_restorer
)(void); /* not used by Linux/SPARC yet */
201 struct __old_sigaction32
{
203 compat_old_sigset_t sa_mask
;
204 unsigned int sa_flags
;
205 unsigned sa_restorer
; /* not used by Linux/SPARC yet */
211 typedef struct sigaltstack
{
220 typedef struct sigaltstack32
{
223 compat_size_t ss_size
;
227 struct signal_deliver_cookie
{
229 unsigned long orig_i0
;
233 extern void ptrace_signal_deliver(struct pt_regs
*regs
, void *cookie
);
235 #endif /* !(__KERNEL__) */
237 #endif /* !(__ASSEMBLY__) */
239 #endif /* !(_ASMSPARC64_SIGNAL_H) */