xref: /netbsd/sys/compat/linux/arch/m68k/linux_signal.h (revision ce099b40)
1*ce099b40Smartin /* 	$NetBSD: linux_signal.h,v 1.7 2008/04/28 20:23:42 martin Exp $	*/
20176ca73Sitohy 
30176ca73Sitohy /*-
40176ca73Sitohy  * Copyright (c) 1998 The NetBSD Foundation, Inc.
50176ca73Sitohy  * All rights reserved.
60176ca73Sitohy  *
70176ca73Sitohy  * This code is derived from software contributed to The NetBSD Foundation
80176ca73Sitohy  * by Eric Haszlakiewicz.
90176ca73Sitohy  *
100176ca73Sitohy  * Redistribution and use in source and binary forms, with or without
110176ca73Sitohy  * modification, are permitted provided that the following conditions
120176ca73Sitohy  * are met:
130176ca73Sitohy  * 1. Redistributions of source code must retain the above copyright
140176ca73Sitohy  *    notice, this list of conditions and the following disclaimer.
150176ca73Sitohy  * 2. Redistributions in binary form must reproduce the above copyright
160176ca73Sitohy  *    notice, this list of conditions and the following disclaimer in the
170176ca73Sitohy  *    documentation and/or other materials provided with the distribution.
180176ca73Sitohy  *
190176ca73Sitohy  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
200176ca73Sitohy  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
210176ca73Sitohy  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
220176ca73Sitohy  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
230176ca73Sitohy  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
240176ca73Sitohy  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
250176ca73Sitohy  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
260176ca73Sitohy  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
270176ca73Sitohy  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
280176ca73Sitohy  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
290176ca73Sitohy  * POSSIBILITY OF SUCH DAMAGE.
300176ca73Sitohy  */
310176ca73Sitohy 
320176ca73Sitohy /*
330176ca73Sitohy  * Whoever decided how linux would handle
340176ca73Sitohy  * binary compatibility should be shot.
350176ca73Sitohy  */
360176ca73Sitohy 
370176ca73Sitohy #ifndef _M68K_LINUX_SIGNAL_H
380176ca73Sitohy #define _M68K_LINUX_SIGNAL_H
390176ca73Sitohy 
400176ca73Sitohy #define LINUX_SIGHUP	 1
410176ca73Sitohy #define LINUX_SIGINT	 2
420176ca73Sitohy #define LINUX_SIGQUIT	 3
430176ca73Sitohy #define LINUX_SIGILL	 4
440176ca73Sitohy #define LINUX_SIGTRAP	 5
450176ca73Sitohy #define LINUX_SIGABRT	 6
460176ca73Sitohy #define LINUX_SIGBUS	 7
470176ca73Sitohy #define LINUX_SIGFPE	 8
480176ca73Sitohy #define LINUX_SIGKILL	 9
490176ca73Sitohy #define LINUX_SIGUSR1	10
500176ca73Sitohy #define LINUX_SIGSEGV	11
510176ca73Sitohy #define LINUX_SIGUSR2	12
520176ca73Sitohy #define LINUX_SIGPIPE	13
530176ca73Sitohy #define LINUX_SIGALRM	14
540176ca73Sitohy #define LINUX_SIGTERM	15
550176ca73Sitohy #define LINUX_SIGSTKFLT	16
560176ca73Sitohy #define LINUX_SIGCHLD	17
570176ca73Sitohy #define LINUX_SIGCONT	18
580176ca73Sitohy #define LINUX_SIGSTOP	19
590176ca73Sitohy #define LINUX_SIGTSTP	20
600176ca73Sitohy #define LINUX_SIGTTIN	21
610176ca73Sitohy #define LINUX_SIGTTOU	22
620176ca73Sitohy #define LINUX_SIGURG	23
630176ca73Sitohy #define LINUX_SIGXCPU	24
640176ca73Sitohy #define LINUX_SIGXFSZ	25
650176ca73Sitohy #define LINUX_SIGVTALRM	26
660176ca73Sitohy #define LINUX_SIGPROF	27
670176ca73Sitohy #define LINUX_SIGWINCH	28
680176ca73Sitohy #define LINUX_SIGIO	29
690176ca73Sitohy #define LINUX_SIGPWR	30
700176ca73Sitohy #define LINUX_SIGUNUSED	31
71bda4b15eSchristos #define LINUX_SIGSYS	31
720176ca73Sitohy 
730176ca73Sitohy #define LINUX_SIGIOT	LINUX_SIGABRT
740176ca73Sitohy #define LINUX_SIGPOLL	LINUX_SIGIO
750176ca73Sitohy 
76bda4b15eSchristos /* Min/max real-time linux signal */
77bda4b15eSchristos #define LINUX_SIGRTMIN		32
78bda4b15eSchristos #define LINUX_SIGRTMAX		(LINUX__NSIG-1)
79bda4b15eSchristos 
800176ca73Sitohy #define LINUX__NSIG		64
810176ca73Sitohy #define LINUX__NSIG_BPW		32
820176ca73Sitohy #define LINUX__NSIG_WORDS	(LINUX__NSIG / LINUX__NSIG_BPW)
830176ca73Sitohy #define LINUX_NSIG		32
840176ca73Sitohy 
850176ca73Sitohy /* sa_flags */
860176ca73Sitohy #define LINUX_SA_NOCLDSTOP	0x00000001
870176ca73Sitohy #define LINUX_SA_NOCLDWAIT	0x00000002
880176ca73Sitohy #define LINUX_SA_SIGINFO	0x00000004
890176ca73Sitohy #define LINUX_SA_ONSTACK	0x08000000
900176ca73Sitohy #define LINUX_SA_RESTART	0x10000000
910176ca73Sitohy #define LINUX_SA_NODEFER	0x40000000
920176ca73Sitohy #define LINUX_SA_RESETHAND	0x80000000
930176ca73Sitohy 
940176ca73Sitohy #define LINUX_SA_NOMASK		LINUX_SA_NODEFER
950176ca73Sitohy #define LINUX_SA_ONESHOT	LINUX_SA_RESETHAND
960176ca73Sitohy #define LINUX_SA_INTERRUPT	0x20000000	/* Ignore this */
970176ca73Sitohy 
980176ca73Sitohy #define LINUX_SA_ALLBITS	0xf8000007
990176ca73Sitohy 
1000176ca73Sitohy #define LINUX_SIG_BLOCK		0
1010176ca73Sitohy #define LINUX_SIG_UNBLOCK	1
1020176ca73Sitohy #define LINUX_SIG_SETMASK	2
1030176ca73Sitohy 
104d359ae5cSchristos #define	LINUX_MINSIGSTKSZ	2048
105d359ae5cSchristos 
106f2af9174Sdsl typedef void	(*linux_handler_t)(int);
1070176ca73Sitohy 
1080176ca73Sitohy typedef u_long	linux_old_sigset_t;
1090176ca73Sitohy typedef struct {
1100176ca73Sitohy 	u_long sig[LINUX__NSIG_WORDS];
1110176ca73Sitohy } linux_sigset_t;
1120176ca73Sitohy 
1130176ca73Sitohy struct linux_old_sigaction {
114116bcb05Schristos 	linux_handler_t		linux_sa_handler;
115116bcb05Schristos 	linux_old_sigset_t	linux_sa_mask;
116116bcb05Schristos 	u_long			linux_sa_flags;
117f2af9174Sdsl 	void			(*linux_sa_restorer)(void);
1180176ca73Sitohy };
1190176ca73Sitohy 
1200176ca73Sitohy /* Used in rt_* calls */
1210176ca73Sitohy struct linux_sigaction {
122116bcb05Schristos 	linux_handler_t		linux_sa_handler;
123116bcb05Schristos 	u_long			linux_sa_flags;
124f2af9174Sdsl 	void			(*linux_sa_restorer)(void);
125116bcb05Schristos 	linux_sigset_t		linux_sa_mask;
1260176ca73Sitohy };
1270176ca73Sitohy 
1280176ca73Sitohy struct linux_k_sigaction {
1290176ca73Sitohy 	struct linux_sigaction	sa;
130116bcb05Schristos #define k_sa_restorer	sa.linux_sa_restorer
1310176ca73Sitohy };
1320176ca73Sitohy 
1330176ca73Sitohy typedef struct linux_sigaltstack {
1340176ca73Sitohy 	void			*ss_sp;
1350176ca73Sitohy 	int			ss_flags;
1360176ca73Sitohy 	size_t			ss_size;
1370176ca73Sitohy } linux_stack_t;
1380176ca73Sitohy 
1390176ca73Sitohy /* ss_flags */
1400176ca73Sitohy #define LINUX_SS_ONSTACK	1
1410176ca73Sitohy #define LINUX_SS_DISABLE	2
1420176ca73Sitohy 
1430176ca73Sitohy #endif /* !_M68K_LINUX_SIGNAL_H */
144