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