Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / asm-sparc / signal.h
blobd8211cb6e6b4e24e5010bcc5409c971cc455c504
1 /* $Id: signal.h,v 1.35 1999/09/06 08:22:04 jj Exp $ */
2 #ifndef _ASMSPARC_SIGNAL_H
3 #define _ASMSPARC_SIGNAL_H
5 #include <asm/sigcontext.h>
6 #include <linux/compiler.h>
8 #ifdef __KERNEL__
9 #ifndef __ASSEMBLY__
10 #include <linux/personality.h>
11 #include <linux/types.h>
12 #endif
13 #endif
15 /* On the Sparc the signal handlers get passed a 'sub-signal' code
16 * for certain signal types, which we document here.
18 #define SIGHUP 1
19 #define SIGINT 2
20 #define SIGQUIT 3
21 #define SIGILL 4
22 #define SUBSIG_STACK 0
23 #define SUBSIG_ILLINST 2
24 #define SUBSIG_PRIVINST 3
25 #define SUBSIG_BADTRAP(t) (0x80 + (t))
27 #define SIGTRAP 5
28 #define SIGABRT 6
29 #define SIGIOT 6
31 #define SIGEMT 7
32 #define SUBSIG_TAG 10
34 #define SIGFPE 8
35 #define SUBSIG_FPDISABLED 0x400
36 #define SUBSIG_FPERROR 0x404
37 #define SUBSIG_FPINTOVFL 0x001
38 #define SUBSIG_FPSTSIG 0x002
39 #define SUBSIG_IDIVZERO 0x014
40 #define SUBSIG_FPINEXACT 0x0c4
41 #define SUBSIG_FPDIVZERO 0x0c8
42 #define SUBSIG_FPUNFLOW 0x0cc
43 #define SUBSIG_FPOPERROR 0x0d0
44 #define SUBSIG_FPOVFLOW 0x0d4
46 #define SIGKILL 9
47 #define SIGBUS 10
48 #define SUBSIG_BUSTIMEOUT 1
49 #define SUBSIG_ALIGNMENT 2
50 #define SUBSIG_MISCERROR 5
52 #define SIGSEGV 11
53 #define SUBSIG_NOMAPPING 3
54 #define SUBSIG_PROTECTION 4
55 #define SUBSIG_SEGERROR 5
57 #define SIGSYS 12
59 #define SIGPIPE 13
60 #define SIGALRM 14
61 #define SIGTERM 15
62 #define SIGURG 16
64 /* SunOS values which deviate from the Linux/i386 ones */
65 #define SIGSTOP 17
66 #define SIGTSTP 18
67 #define SIGCONT 19
68 #define SIGCHLD 20
69 #define SIGTTIN 21
70 #define SIGTTOU 22
71 #define SIGIO 23
72 #define SIGPOLL SIGIO /* SysV name for SIGIO */
73 #define SIGXCPU 24
74 #define SIGXFSZ 25
75 #define SIGVTALRM 26
76 #define SIGPROF 27
77 #define SIGWINCH 28
78 #define SIGLOST 29
79 #define SIGPWR SIGLOST
80 #define SIGUSR1 30
81 #define SIGUSR2 31
83 /* Most things should be clean enough to redefine this at will, if care
84 * is taken to make libc match.
87 #define __OLD_NSIG 32
88 #define __NEW_NSIG 64
89 #define _NSIG_BPW 32
90 #define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
92 #define SIGRTMIN 32
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 __old_sigset_t old_sigset_t
100 #define __old_sigaction old_sigaction
101 #else
102 #define _NSIG __OLD_NSIG
103 #define __old_sigset_t sigset_t
104 #define __old_sigaction sigaction
105 #endif
107 #ifndef __ASSEMBLY__
109 typedef unsigned long __old_sigset_t;
111 typedef struct {
112 unsigned long sig[_NSIG_WORDS];
113 } __new_sigset_t;
116 #ifdef __KERNEL__
117 /* A SunOS sigstack */
118 struct sigstack {
119 char *the_stack;
120 int cur_status;
122 #endif
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 */
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.
135 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
136 * SA_RESTART flag to get restarting signals (which were the default long ago)
137 * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
139 #define SA_NOCLDSTOP _SV_IGNCHILD
140 #define SA_STACK _SV_SSTACK
141 #define SA_ONSTACK _SV_SSTACK
142 #define SA_RESTART _SV_INTR
143 #define SA_ONESHOT _SV_RESET
144 #define SA_INTERRUPT 0x10u
145 #define SA_NOMASK 0x20u
146 #define SA_SHIRQ 0x40u
147 #define SA_NOCLDWAIT 0x100u
148 #define SA_SIGINFO 0x200u
150 #define SIG_BLOCK 0x01 /* for blocking signals */
151 #define SIG_UNBLOCK 0x02 /* for unblocking signals */
152 #define SIG_SETMASK 0x04 /* for setting the signal mask */
155 * sigaltstack controls
157 #define SS_ONSTACK 1
158 #define SS_DISABLE 2
160 #define MINSIGSTKSZ 4096
161 #define SIGSTKSZ 16384
163 #ifdef __KERNEL__
165 * These values of sa_flags are used only by the kernel as part of the
166 * irq handling routines.
168 * SA_INTERRUPT is also used by the irq handling routines.
170 * DJHR
171 * SA_STATIC_ALLOC is used for the SPARC system to indicate that this
172 * interrupt handler's irq structure should be statically allocated
173 * by the request_irq routine.
174 * The alternative is that arch/sparc/kernel/irq.c has carnal knowledge
175 * of interrupt usage and that sucks. Also without a flag like this
176 * it may be possible for the free_irq routine to attempt to free
177 * statically allocated data.. which is NOT GOOD.
180 #define SA_PROBE SA_ONESHOT
181 #define SA_SAMPLE_RANDOM SA_RESTART
182 #define SA_STATIC_ALLOC 0x80
183 #endif
185 /* Type of a signal handler. */
186 #ifdef __KERNEL__
187 typedef void (*__sighandler_t)(int, int, struct sigcontext *, char *);
188 #else
189 typedef void (*__sighandler_t)(int);
190 #endif
192 #define SIG_DFL ((__sighandler_t)0) /* default signal handling */
193 #define SIG_IGN ((__sighandler_t)1) /* ignore signal */
194 #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
196 #ifdef __KERNEL__
197 struct __new_sigaction {
198 __sighandler_t sa_handler;
199 unsigned long sa_flags;
200 void (*sa_restorer)(void); /* Not used by Linux/SPARC */
201 __new_sigset_t sa_mask;
204 struct k_sigaction {
205 struct __new_sigaction sa;
206 void __user *ka_restorer;
209 struct __old_sigaction {
210 __sighandler_t sa_handler;
211 __old_sigset_t sa_mask;
212 unsigned long sa_flags;
213 void (*sa_restorer) (void); /* not used by Linux/SPARC */
216 typedef struct sigaltstack {
217 void __user *ss_sp;
218 int ss_flags;
219 size_t ss_size;
220 } stack_t;
222 struct sparc_deliver_cookie {
223 int restart_syscall;
224 unsigned long orig_i0;
227 struct pt_regs;
228 extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
230 #endif /* !(__KERNEL__) */
232 #endif /* !(__ASSEMBLY__) */
234 #endif /* !(_ASMSPARC_SIGNAL_H) */