Home | History | Annotate | Line # | Download | only in mips
linux_signal.h revision 1.6
      1 /* $NetBSD: linux_signal.h,v 1.6 2002/02/19 14:11:49 rafal Exp $ */
      2 
      3 /*-
      4  * Copyright (c) 1995, 1998, 2001 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Frank van der Linden, Eric Haszlakiewicz and Emmanuel Dreyfus.
      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 #ifndef _MIPS_LINUX_SIGNAL_H
     40 #define _MIPS_LINUX_SIGNAL_H
     41 
     42 /*
     43  * From Linux's include/asm-mips/ptrace.h
     44  */
     45 struct linux_pt_regs {
     46 	unsigned long lpad0[6];
     47 	unsigned long lregs[32];
     48 	unsigned long llo;
     49 	unsigned long lhi;
     50 	unsigned long lcp0_epc;
     51 	unsigned long lcp0_badvaddr;
     52 	unsigned long lcp0_status;
     53 	unsigned long lcp0_cause;
     54 };
     55 
     56 /*
     57  * Everything is from Linux's include/asm-mips/signal.h
     58  */
     59 #define LINUX_SIGHUP	 	1
     60 #define LINUX_SIGINT		2
     61 #define LINUX_SIGQUIT		3
     62 #define LINUX_SIGILL		4
     63 #define LINUX_SIGTRAP		5
     64 #define LINUX_SIGABRT		6
     65 #define LINUX_SIGIOT		6
     66 #define LINUX_SIGEMT		7
     67 #define LINUX_SIGFPE		8
     68 #define LINUX_SIGKILL		9
     69 #define LINUX_SIGBUS		10
     70 #define LINUX_SIGSEGV		11
     71 #define LINUX_SIGSYS		12
     72 #define LINUX_SIGPIPE		13
     73 #define LINUX_SIGALRM		14
     74 #define LINUX_SIGTERM		15
     75 #define LINUX_SIGUSR1		16
     76 #define LINUX_SIGUSR2		17
     77 #define LINUX_SIGCHLD		18
     78 #define LINUX_SIGCLD		18
     79 #define LINUX_SIGPWR		19
     80 #define LINUX_SIGWINCH		20
     81 #define LINUX_SIGURG		21
     82 #define LINUX_SIGIO		22
     83 #define LINUX_SIGPOLL		22
     84 #define LINUX_SIGSTOP		23
     85 #define LINUX_SIGTSTP		24
     86 #define LINUX_SIGCONT		25
     87 #define LINUX_SIGTTIN		26
     88 #define LINUX_SIGTTOU		27
     89 #define LINUX_SIGVTALRM		28
     90 #define LINUX_SIGPROF		29
     91 #define LINUX_SIGXCPU		30
     92 #define LINUX_SIGXFSZ		31
     93 
     94 #define LINUX_SIGRTMIN		32
     95 
     96 #define LINUX__NSIG		128
     97 #if defined(ELFSIZE) && (ELFSIZE == 64)
     98 #define LINUX__NSIG_BPW		64
     99 #else
    100 #define LINUX__NSIG_BPW		32
    101 #endif
    102 #define LINUX__NSIG_WORDS (LINUX__NSIG / LINUX__NSIG_BPW)
    103 
    104 #define LINUX_SIG_BLOCK		1
    105 #define LINUX_SIG_UNBLOCK	2
    106 #define LINUX_SIG_SETMASK	3
    107 
    108 /* sa_flags */
    109 #define LINUX_SA_NOCLDSTOP	0x00000001
    110 #define LINUX_SA_SIGINFO	0x00000008
    111 #define LINUX_SA_NOCLDWAIT	0x00010000
    112 #define LINUX_SA_RESTORER	0x04000000
    113 #define LINUX_SA_ONSTACK	0x08000000
    114 #define LINUX_SA_RESTART	0x10000000
    115 #define LINUX_SA_INTERRUPT	0x20000000
    116 #define LINUX_SA_NODEFER	0x40000000
    117 #define LINUX_SA_RESETHAND	0x80000000
    118 #define LINUX_SA_NOMASK		LINUX_SA_NODEFER
    119 #define LINUX_SA_ONESHOT	LINUX_SA_RESETHAND
    120 #define LINUX_SA_ALLBITS	0xfc010009 /* XXX from i386, not in mips. */
    121 
    122 typedef void (*linux___sighandler_t) __P((int));
    123 
    124 typedef unsigned long linux_old_sigset_t;
    125 typedef struct {
    126 	unsigned long sig[LINUX__NSIG_WORDS];
    127 } linux_sigset_t;
    128 
    129 /* Used in rt_* calls. No old_sigaction is defined for MIPS */
    130 struct linux_sigaction {
    131 	unsigned int		sa_flags;
    132 	linux___sighandler_t	sa_handler;
    133 	linux_sigset_t		sa_mask;
    134 	void			(*sa_restorer) __P((void));
    135 	int			sa_resv[1];
    136 };
    137 
    138 struct linux_k_sigaction {
    139 	struct linux_sigaction sa;
    140 };
    141 
    142 struct linux_old_sigaction {
    143 	unsigned int		sa_flags;
    144 	linux___sighandler_t	sa_handler;
    145 	linux_old_sigset_t	sa_mask;
    146 	void			(*sa_restorer) __P((void));
    147 	int			sa_resv[1];
    148 };
    149 
    150 #define	LINUX_SS_ONSTACK	1
    151 #define	LINUX_SS_DISABLE	2
    152 
    153 #define	LINUX_MINSIGSTKSZ	2048
    154 #define	LINUX_SIGSTKSZ		8192
    155 
    156 struct linux_sigaltstack {
    157 	void *ss_sp;
    158 	size_t ss_size;
    159 	int ss_flags;
    160 };
    161 typedef struct linux_sigaltstack linux_stack_t; /* XXX really needed ? */
    162 
    163 #endif /* !_MIPS_LINUX_SIGNAL_H */
    164