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