Import 2.3.18pre1
[davej-history.git] / include / asm-sparc64 / signal.h
blob463ef3fdd459bca8ee04d6e0a77ee90fb726cd26
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>
7 #ifdef __KERNEL__
8 #ifndef __ASSEMBLY__
9 #include <linux/personality.h>
10 #include <linux/types.h>
11 #endif
12 #endif
14 /* On the Sparc the signal handlers get passed a 'sub-signal' code
15 * for certain signal types, which we document here.
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))
26 #define SIGTRAP 5
27 #define SIGABRT 6
28 #define SIGIOT 6
30 #define SIGEMT 7
31 #define SUBSIG_TAG 10
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
45 #define SIGKILL 9
46 #define SIGBUS 10
47 #define SUBSIG_BUSTIMEOUT 1
48 #define SUBSIG_ALIGNMENT 2
49 #define SUBSIG_MISCERROR 5
51 #define SIGSEGV 11
52 #define SUBSIG_NOMAPPING 3
53 #define SUBSIG_PROTECTION 4
54 #define SUBSIG_SEGERROR 5
56 #define SIGSYS 12
58 #define SIGPIPE 13
59 #define SIGALRM 14
60 #define SIGTERM 15
61 #define SIGURG 16
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
82 /* Most things should be clean enough to redefine this at will, if care
83 is taken to make libc match. */
85 #define __OLD_NSIG 32
86 #define __NEW_NSIG 64
87 #define _NSIG_BPW 64
88 #define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
90 #define _NSIG_BPW32 32
91 #define _NSIG_WORDS32 (__NEW_NSIG / _NSIG_BPW32)
93 #define SIGRTMIN 32
94 #define SIGRTMAX (__NEW_NSIG - 1)
96 #if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
97 #define _NSIG __NEW_NSIG
98 #define __new_sigset_t sigset_t
99 #define __new_sigset_t32 sigset_t32
100 #define __new_sigaction sigaction
101 #define __new_sigaction32 sigaction32
102 #define __old_sigset_t old_sigset_t
103 #define __old_sigset_t32 old_sigset_t32
104 #define __old_sigaction old_sigaction
105 #define __old_sigaction32 old_sigaction32
106 #else
107 #define _NSIG __OLD_NSIG
108 #define NSIG _NSIG
109 #define __old_sigset_t sigset_t
110 #define __old_sigset_t32 sigset_t32
111 #define __old_sigaction sigaction
112 #define __old_sigaction32 sigaction32
113 #endif
115 #ifndef __ASSEMBLY__
117 typedef unsigned long __old_sigset_t; /* at least 32 bits */
118 typedef unsigned int __old_sigset_t32;
120 typedef struct {
121 unsigned long sig[_NSIG_WORDS];
122 } __new_sigset_t;
124 typedef struct {
125 unsigned int sig[_NSIG_WORDS32];
126 } __new_sigset_t32;
128 /* A SunOS sigstack */
129 struct sigstack {
130 /* XXX 32-bit pointers pinhead XXX */
131 char *the_stack;
132 int cur_status;
135 /* Sigvec flags */
136 #define SV_SSTACK 1 /* This signal handler should use sig-stack */
137 #define SV_INTR 2 /* Sig return should not restart system call */
138 #define SV_RESET 4 /* Set handler to SIG_DFL upon taken signal */
139 #define SV_IGNCHILD 8 /* Do not send SIGCHLD */
142 * sa_flags values: SA_STACK is not currently supported, but will allow the
143 * usage of signal stacks by using the (now obsolete) sa_restorer field in
144 * the sigaction structure as a stack pointer. This is now possible due to
145 * the changes in signal handling. LBT 010493.
146 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
147 * SA_RESTART flag to get restarting signals (which were the default long ago)
148 * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
150 #define SA_NOCLDSTOP SV_IGNCHILD
151 #define SA_STACK SV_SSTACK
152 #define SA_ONSTACK SV_SSTACK
153 #define SA_RESTART SV_INTR
154 #define SA_ONESHOT SV_RESET
155 #define SA_INTERRUPT 0x10
156 #define SA_NOMASK 0x20
157 #define SA_SHIRQ 0x40
158 #define SA_NOCLDWAIT 0x100 /* not supported yet */
159 #define SA_SIGINFO 0x200
162 #define SIG_BLOCK 0x01 /* for blocking signals */
163 #define SIG_UNBLOCK 0x02 /* for unblocking signals */
164 #define SIG_SETMASK 0x04 /* for setting the signal mask */
167 * sigaltstack controls
169 #define SS_ONSTACK 1
170 #define SS_DISABLE 2
172 #define MINSIGSTKSZ 4096
173 #define SIGSTKSZ 16384
175 #ifdef __KERNEL__
177 * These values of sa_flags are used only by the kernel as part of the
178 * irq handling routines.
180 * SA_INTERRUPT is also used by the irq handling routines.
182 * DJHR
183 * SA_STATIC_ALLOC is used for the SPARC system to indicate that this
184 * interrupt handler's irq structure should be statically allocated
185 * by the request_irq routine.
186 * The alternative is that arch/sparc/kernel/irq.c has carnal knowledge
187 * of interrupt usage and that sucks. Also without a flag like this
188 * it may be possible for the free_irq routine to attempt to free
189 * statically allocated data.. which is NOT GOOD.
192 #define SA_PROBE SA_ONESHOT
193 #define SA_SAMPLE_RANDOM SA_RESTART
194 #define SA_STATIC_ALLOC 0x80
195 #endif
197 /* Type of a signal handler. */
198 #ifdef __KERNEL__
199 typedef void (*__sighandler_t)(int, struct sigcontext *);
200 #else
201 typedef void (*__sighandler_t)(int);
202 #endif
204 #define SIG_DFL ((__sighandler_t)0) /* default signal handling */
205 #define SIG_IGN ((__sighandler_t)1) /* ignore signal */
206 #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
208 struct __new_sigaction {
209 __sighandler_t sa_handler;
210 unsigned long sa_flags;
211 void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
212 __new_sigset_t sa_mask;
215 struct __new_sigaction32 {
216 unsigned sa_handler;
217 unsigned int sa_flags;
218 unsigned sa_restorer; /* not used by Linux/SPARC yet */
219 __new_sigset_t32 sa_mask;
222 #ifdef __KERNEL__
223 struct k_sigaction {
224 struct __new_sigaction sa;
225 void *ka_restorer;
227 #endif
229 struct __old_sigaction {
230 __sighandler_t sa_handler;
231 __old_sigset_t sa_mask;
232 unsigned long sa_flags;
233 void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
236 struct __old_sigaction32 {
237 unsigned sa_handler;
238 __old_sigset_t32 sa_mask;
239 unsigned int sa_flags;
240 unsigned sa_restorer; /* not used by Linux/SPARC yet */
243 typedef struct sigaltstack {
244 void *ss_sp;
245 int ss_flags;
246 size_t ss_size;
247 } stack_t;
249 #ifdef __KERNEL__
250 typedef struct sigaltstack32 {
251 u32 ss_sp;
252 int ss_flags;
253 __kernel_size_t32 ss_size;
254 } stack_t32;
255 #endif
257 #endif /* !(__ASSEMBLY__) */
259 #endif /* !(_ASMSPARC64_SIGNAL_H) */