summaryrefslogtreecommitdiff
path: root/sys/compat/linux/arch/mips/linux_signal.h
blob: 3325cb03d7a5ea8fa6a377fdb06c6b6f244bc9ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/* $NetBSD: linux_signal.h,v 1.14 2015/11/14 13:29:35 christos Exp $ */

/*-
 * Copyright (c) 1995, 1998, 2001 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Frank van der Linden, Eric Haszlakiewicz and Emmanuel Dreyfus.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _MIPS_LINUX_SIGNAL_H
#define _MIPS_LINUX_SIGNAL_H

/*
 * From Linux's include/asm-mips/ptrace.h
 */
struct linux_pt_regs {
	unsigned long lpad0[6];
	unsigned long lregs[32];
	unsigned long llo;
	unsigned long lhi;
	unsigned long lcp0_epc;
	unsigned long lcp0_badvaddr;
	unsigned long lcp0_status;
	unsigned long lcp0_cause;
};

/*
 * Everything is from Linux's include/asm-mips/signal.h
 */
#define LINUX_SIGHUP	 	1
#define LINUX_SIGINT		2
#define LINUX_SIGQUIT		3
#define LINUX_SIGILL		4
#define LINUX_SIGTRAP		5
#define LINUX_SIGABRT		6
#define LINUX_SIGIOT		6
#define LINUX_SIGEMT		7
#define LINUX_SIGFPE		8
#define LINUX_SIGKILL		9
#define LINUX_SIGBUS		10
#define LINUX_SIGSEGV		11
#define LINUX_SIGSYS		12
#define LINUX_SIGPIPE		13
#define LINUX_SIGALRM		14
#define LINUX_SIGTERM		15
#define LINUX_SIGUSR1		16
#define LINUX_SIGUSR2		17
#define LINUX_SIGCHLD		18
#define LINUX_SIGCLD		18
#define LINUX_SIGPWR		19
#define LINUX_SIGWINCH		20
#define LINUX_SIGURG		21
#define LINUX_SIGIO		22
#define LINUX_SIGPOLL		22
#define LINUX_SIGSTOP		23
#define LINUX_SIGTSTP		24
#define LINUX_SIGCONT		25
#define LINUX_SIGTTIN		26
#define LINUX_SIGTTOU		27
#define LINUX_SIGVTALRM		28
#define LINUX_SIGPROF		29
#define LINUX_SIGXCPU		30
#define LINUX_SIGXFSZ		31

/* Min/max real-time linux signal */
#define LINUX_SIGRTMIN		32
#define LINUX_SIGRTMAX		(LINUX__NSIG - 1)

#define LINUX__NSIG		128
#if defined(ELFSIZE) && (ELFSIZE == 64)
#define LINUX__NSIG_BPW		64
#else
#define LINUX__NSIG_BPW		32
#endif
#define LINUX__NSIG_WORDS (LINUX__NSIG / LINUX__NSIG_BPW)

#define LINUX_SIG_BLOCK		1
#define LINUX_SIG_UNBLOCK	2
#define LINUX_SIG_SETMASK	3

/* sa_flags */
#define LINUX_SA_NOCLDSTOP	0x00000001
#define LINUX_SA_SIGINFO	0x00000008
#define LINUX_SA_NOCLDWAIT	0x00010000
#define LINUX_SA_ONSTACK	0x08000000
#define LINUX_SA_RESTART	0x10000000
#define LINUX_SA_NODEFER	0x40000000
#define LINUX_SA_RESETHAND	0x80000000
#define LINUX_SA_NOMASK		LINUX_SA_NODEFER
#define LINUX_SA_ONESHOT	LINUX_SA_RESETHAND
#define LINUX_SA_ALLBITS	0xd8010009
/* XXX LINUX_SA_RESTORER has been deprecated; not used any version of glibc */

#define	LINUX_MINSIGSTKSZ	2048

typedef void (*linux___sighandler_t)(int);

typedef unsigned long linux_old_sigset_t;
typedef struct {
	unsigned long sig[LINUX__NSIG_WORDS];
} linux_sigset_t;

/* Used in rt_* calls. No old_sigaction is defined for MIPS */
struct linux_sigaction {
	unsigned int		linux_sa_flags;
	linux___sighandler_t	linux_sa_handler;
	linux_sigset_t		linux_sa_mask;
	void			(*linux_sa_restorer)(void);
	int			linux_sa_resv[1];
};

struct linux_k_sigaction {
	struct linux_sigaction sa;
};

struct linux_old_sigaction {
	unsigned int		linux_sa_flags;
	linux___sighandler_t	linux_sa_handler;
	linux_old_sigset_t	linux_sa_mask;
	void			(*linux_sa_restorer)(void);
	int			linux_sa_resv[1];
};

#define	LINUX_SS_ONSTACK	1
#define	LINUX_SS_DISABLE	2

#define	LINUX_MINSIGSTKSZ	2048
#define	LINUX_SIGSTKSZ		8192

struct linux_sigaltstack {
	void *ss_sp;
	size_t ss_size;
	int ss_flags;
};
typedef struct linux_sigaltstack linux_stack_t; /* XXX really needed ? */

#endif /* !_MIPS_LINUX_SIGNAL_H */