Home | History | Annotate | Line # | Download | only in alpha
linux_signal.h revision 1.1
      1 /* 	$NetBSD: linux_signal.h,v 1.1 1998/09/30 21:36:28 erh Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 1998 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Eric Haszlakiewicz.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *	This product includes software developed by the NetBSD
     21  *	Foundation, Inc. and its contributors.
     22  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  *    contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  * POSSIBILITY OF SUCH DAMAGE.
     37  */
     38 
     39 /*
     40  * Whoever decided how linux would handle
     41  * binary compatibility should be shot.
     42  */
     43 
     44 #ifndef _ALPHA_LINUX_SIGNAL_H
     45 #define _ALPHA_LINUX_SIGNAL_H
     46 
     47 #define LINUX_SIGHUP	 1
     48 #define LINUX_SIGINT	 2
     49 #define LINUX_SIGQUIT	 3
     50 #define LINUX_SIGILL	 4
     51 #define LINUX_SIGTRAP	 5
     52 #define LINUX_SIGABRT	 6
     53 #define LINUX_SIGEMT	 7
     54 #define LINUX_SIGFPE	 8
     55 #define LINUX_SIGKILL	 9
     56 #define LINUX_SIGBUS	10
     57 #define LINUX_SIGSEGV	11
     58 #define LINUX_SIGSYS	12
     59 #define LINUX_SIGPIPE	13
     60 #define LINUX_SIGALRM	14
     61 #define LINUX_SIGTERM	15
     62 #define LINUX_SIGURG	16
     63 #define LINUX_SIGSTOP	17
     64 #define LINUX_SIGTSTP	18
     65 #define LINUX_SIGCONT	19
     66 #define LINUX_SIGCHLD	20
     67 #define LINUX_SIGTTIN	21
     68 #define LINUX_SIGTTOU	22
     69 #define LINUX_SIGIO	23
     70 #define LINUX_SIGXCPU	24
     71 #define LINUX_SIGXFSZ	25
     72 #define LINUX_SIGVTALRM	26
     73 #define LINUX_SIGPROF	27
     74 #define LINUX_SIGWINCH	28
     75 #define LINUX_SIGINFO	29
     76 #define LINUX_SIGUSR1	30
     77 #define LINUX_SIGUSR2	31
     78 
     79 #define LINUX_SIGIOT	LINUX_SIGABRT
     80 #define LINUX_SIGPWR	LINUX_SIGINFO
     81 #define LINUX_SIGPOLL	LINUX_SIGIO
     82 
     83 #define LINUX__NSIG		64
     84 #define LINUX__NSIG_BPW		64
     85 #define LINUX__NSIG_WORDS	(LINUX__NSIG / LINUX__NSIG_BPW)
     86 #define LINUX_NSIG		32
     87 
     88 /* Min/max real-time linux signal */
     89 #define LINUX_SIGRTMIN		32
     90 #define LINUX_SIGRTMAX		(_NSIG-1)
     91 
     92 /* sa_flags */
     93 #define LINUX_SA_ONSTACK	0x00000001
     94 #define LINUX_SA_RESTART	0x00000002
     95 #define LINUX_SA_NOCLDSTOP	0x00000004
     96 #define LINUX_SA_NODEFER	0x00000008
     97 #define LINUX_SA_RESETHAND	0x00000010
     98 #define LINUX_SA_NOCLDWAIT	0x00000020
     99 #define LINUX_SA_SIGINFO	0x00000040
    100 
    101 #define LINUX_SA_NOMASK		LINUX_SA_NODEFER
    102 #define LINUX_SA_ONESHOT	LINUX_SA_RESETHAND
    103 #define LINUX_SA_INTERRUPT	0x20000000	/* Ignore this */
    104 
    105 #define LINUX_SA_ALLBITS	0x2000007f
    106 
    107 #define LINUX_SIG_BLOCK		1
    108 #define LINUX_SIG_UNBLOCK	2
    109 #define LINUX_SIG_SETMASK	3
    110 
    111 typedef void	(*linux_handler_t) __P((int));
    112 
    113 typedef u_long	linux_old_sigset_t;
    114 typedef struct {
    115 	u_long sig[LINUX__NSIG_WORDS];
    116 } linux_sigset_t;
    117 
    118 /* aka osf_sigaction in Linux sources.  Note absence of sa_restorer */
    119 struct linux_old_sigaction {
    120 	linux_handler_t		sa_handler;
    121 	linux_old_sigset_t	sa_mask;
    122 	int			sa_flags;
    123 };
    124 
    125 /* Used in rt_* calls */
    126 struct linux_sigaction {
    127 	linux_handler_t		sa_handler;
    128 	u_long			sa_flags;
    129 	linux_sigset_t		sa_mask;
    130 };
    131 
    132 struct linux_k_sigaction {
    133 	struct linux_sigaction sa;
    134 	void		(*k_sa_restorer) __P((void));
    135 };
    136 
    137 typedef struct linux_sigaltstack {
    138 	void *ss_sp;
    139 	int ss_flags;
    140 	size_t ss_size;
    141 } linux_stack_t;
    142 
    143 #endif /* !_ALPHA_LINUX_SIGNAL_H */
    144