1/* $NetBSD: linux_signal.h,v 1.5 2015/11/14 13:29:35 christos Exp $ */
2
3/*-
4 * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Emmanuel Dreyfus
17 * 4. The name of the author may not be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#ifndef _AMD64_LINUX_SIGNAL_H
35#define _AMD64_LINUX_SIGNAL_H
36
37#define LINUX_SIGHUP 1
38#define LINUX_SIGINT 2
39#define LINUX_SIGQUIT 3
40#define LINUX_SIGILL 4
41#define LINUX_SIGTRAP 5
42#define LINUX_SIGABRT 6
43#define LINUX_SIGIOT 6
44#define LINUX_SIGBUS 7
45#define LINUX_SIGFPE 8
46#define LINUX_SIGKILL 9
47#define LINUX_SIGUSR1 10
48#define LINUX_SIGSEGV 11
49#define LINUX_SIGUSR2 12
50#define LINUX_SIGPIPE 13
51#define LINUX_SIGALRM 14
52#define LINUX_SIGTERM 15
53#define LINUX_SIGSTKFLT 16
54#define LINUX_SIGCHLD 17
55#define LINUX_SIGCONT 18
56#define LINUX_SIGSTOP 19
57#define LINUX_SIGTSTP 20
58#define LINUX_SIGTTIN 21
59#define LINUX_SIGTTOU 22
60#define LINUX_SIGURG 23
61#define LINUX_SIGXCPU 24
62#define LINUX_SIGXFSZ 25
63#define LINUX_SIGVTALRM 26
64#define LINUX_SIGPROF 27
65#define LINUX_SIGWINCH 28
66#define LINUX_SIGIO 29
67#define LINUX_SIGPWR 30
68#define LINUX_SIGSYS 31
69#define LINUX_SIGRTMIN 32
70#define LINUX_SIGRTMAX LINUX__NSIG
71
72
73#define LINUX_SS_ONSTACK 1
74#define LINUX_SS_DISABLE 2
75
76#define LINUX_SA_NOCLDSTOP 0x00000001
77#define LINUX_SA_NOCLDWAIT 0x00000002
78#define LINUX_SA_SIGINFO 0x00000004
79#define LINUX_SA_RESTORER 0x04000000
80#define LINUX_SA_ONSTACK 0x08000000
81#define LINUX_SA_RESTART 0x10000000
82#define LINUX_SA_NOMASK 0x40000000
83#define LINUX_SA_ONESHOT 0x80000000
84#define LINUX_SA_ALLBITS 0xdc000007
85
86#define LINUX_SIG_BLOCK 0
87#define LINUX_SIG_UNBLOCK 1
88#define LINUX_SIG_SETMASK 2
89
90#define LINUX__NSIG 64
91#define LINUX__NSIG_BPW 64
92#define LINUX__NSIG_WORDS (LINUX__NSIG / LINUX__NSIG_BPW)
93
94#define LINUX_MINSIGSTKSZ 2048
95
96typedef unsigned int linux_old_sigset_t;
97
98typedef struct {
99 unsigned long sig[LINUX__NSIG_WORDS];
100} linux_sigset_t;
101
102typedef void (*linux_handler_t)(int);
103
104/* struct old_sigaction32 in Linux; uses a 32 bit pointer for handlers */
105struct linux_compat_old_sigaction {
106 linux_handler_t linux_sa_handler;
107 linux_old_sigset_t linux_sa_mask;
108 unsigned int linux_sa_flags;
109 void (*linux_sa_restorer)(void);
110};
111
112/* Dummy declaration to avoid errors, unused */
113struct linux_old_sigaction {
114 linux_handler_t linux_sa_handler;
115 unsigned long linux_sa_flags;
116 void (*linux_sa_restorer)(void);
117 linux_sigset_t linux_sa_mask;
118};
119
120struct linux_sigaction {
121 linux_handler_t linux_sa_handler;
122 unsigned long linux_sa_flags;
123 void (*linux_sa_restorer)(void);
124 linux_sigset_t linux_sa_mask;
125};
126
127typedef struct linux_sigaltstack {
128 void *ss_sp;
129 int ss_flags;
130 size_t ss_size;
131} linux_stack_t;
132
133#endif /* !_AMD64_LINUX_SIGNAL_H */
134