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