Home | History | Annotate | Line # | Download | only in amd64
linux_signal.h revision 1.4.120.1
      1  1.4.120.1  jdolecek /*	$NetBSD: linux_signal.h,v 1.4.120.1 2017/12/03 11:36:53 jdolecek Exp $ */
      2        1.1      manu 
      3        1.1      manu /*-
      4        1.1      manu  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
      5        1.1      manu  *
      6        1.1      manu  * Redistribution and use in source and binary forms, with or without
      7        1.1      manu  * modification, are permitted provided that the following conditions
      8        1.1      manu  * are met:
      9        1.1      manu  * 1. Redistributions of source code must retain the above copyright
     10        1.1      manu  *    notice, this list of conditions and the following disclaimer.
     11        1.1      manu  * 2. Redistributions in binary form must reproduce the above copyright
     12        1.1      manu  *    notice, this list of conditions and the following disclaimer in the
     13        1.1      manu  *    documentation and/or other materials provided with the distribution.
     14        1.1      manu  * 3. All advertising materials mentioning features or use of this software
     15        1.1      manu  *    must display the following acknowledgement:
     16        1.1      manu  *	This product includes software developed by Emmanuel Dreyfus
     17        1.1      manu  * 4. The name of the author may not be used to endorse or promote
     18        1.1      manu  *    products derived from this software without specific prior written
     19        1.1      manu  *    permission.
     20        1.1      manu  *
     21        1.1      manu  * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS''
     22        1.1      manu  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     23        1.1      manu  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     24        1.1      manu  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
     25        1.1      manu  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26        1.1      manu  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27        1.1      manu  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28        1.1      manu  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29        1.1      manu  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30        1.1      manu  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     31        1.1      manu  * POSSIBILITY OF SUCH DAMAGE.
     32        1.1      manu  */
     33        1.1      manu 
     34        1.1      manu #ifndef _AMD64_LINUX_SIGNAL_H
     35        1.1      manu #define _AMD64_LINUX_SIGNAL_H
     36        1.1      manu 
     37        1.1      manu #define LINUX_SIGHUP		 1
     38        1.1      manu #define LINUX_SIGINT		 2
     39        1.1      manu #define LINUX_SIGQUIT		 3
     40        1.1      manu #define LINUX_SIGILL		 4
     41        1.1      manu #define LINUX_SIGTRAP		 5
     42        1.1      manu #define LINUX_SIGABRT		 6
     43        1.1      manu #define LINUX_SIGIOT		 6
     44        1.1      manu #define LINUX_SIGBUS		 7
     45        1.1      manu #define LINUX_SIGFPE		 8
     46        1.1      manu #define LINUX_SIGKILL		 9
     47        1.1      manu #define LINUX_SIGUSR1		10
     48        1.1      manu #define LINUX_SIGSEGV		11
     49        1.1      manu #define LINUX_SIGUSR2		12
     50        1.1      manu #define LINUX_SIGPIPE		13
     51        1.1      manu #define LINUX_SIGALRM		14
     52        1.1      manu #define LINUX_SIGTERM		15
     53        1.1      manu #define LINUX_SIGSTKFLT		16
     54        1.1      manu #define LINUX_SIGCHLD		17
     55        1.1      manu #define LINUX_SIGCONT		18
     56        1.1      manu #define LINUX_SIGSTOP		19
     57        1.1      manu #define LINUX_SIGTSTP		20
     58        1.1      manu #define LINUX_SIGTTIN		21
     59        1.1      manu #define LINUX_SIGTTOU		22
     60        1.1      manu #define LINUX_SIGURG		23
     61        1.1      manu #define LINUX_SIGXCPU		24
     62        1.1      manu #define LINUX_SIGXFSZ		25
     63        1.1      manu #define LINUX_SIGVTALRM		26
     64        1.1      manu #define LINUX_SIGPROF		27
     65        1.1      manu #define LINUX_SIGWINCH		28
     66        1.1      manu #define LINUX_SIGIO		29
     67        1.1      manu #define LINUX_SIGPWR		30
     68        1.1      manu #define LINUX_SIGSYS		31
     69        1.1      manu #define LINUX_SIGRTMIN		32
     70        1.1      manu #define LINUX_SIGRTMAX		LINUX__NSIG
     71        1.1      manu 
     72        1.1      manu 
     73        1.1      manu #define LINUX_SS_ONSTACK	1
     74        1.1      manu #define LINUX_SS_DISABLE	2
     75        1.1      manu 
     76        1.1      manu #define LINUX_SA_NOCLDSTOP	0x00000001
     77        1.1      manu #define LINUX_SA_NOCLDWAIT	0x00000002
     78        1.1      manu #define LINUX_SA_SIGINFO	0x00000004
     79        1.2      manu #define LINUX_SA_RESTORER	0x04000000
     80        1.1      manu #define LINUX_SA_ONSTACK	0x08000000
     81        1.1      manu #define LINUX_SA_RESTART	0x10000000
     82        1.1      manu #define LINUX_SA_NOMASK		0x40000000
     83        1.1      manu #define LINUX_SA_ONESHOT	0x80000000
     84        1.2      manu #define LINUX_SA_ALLBITS	0xdc000007
     85        1.1      manu 
     86        1.1      manu #define LINUX_SIG_BLOCK		0
     87        1.1      manu #define LINUX_SIG_UNBLOCK	1
     88        1.1      manu #define LINUX_SIG_SETMASK	2
     89        1.1      manu 
     90        1.1      manu #define LINUX__NSIG		64
     91        1.1      manu #define LINUX__NSIG_BPW		64
     92        1.1      manu #define LINUX__NSIG_WORDS	(LINUX__NSIG / LINUX__NSIG_BPW)
     93        1.1      manu 
     94        1.3  christos #define	LINUX_MINSIGSTKSZ	2048
     95        1.3  christos 
     96        1.1      manu typedef unsigned int linux_old_sigset_t;
     97        1.1      manu 
     98        1.1      manu typedef struct {
     99        1.1      manu 	unsigned long sig[LINUX__NSIG_WORDS];
    100        1.1      manu } linux_sigset_t;
    101        1.1      manu 
    102        1.1      manu typedef void (*linux_handler_t)(int);
    103        1.1      manu 
    104        1.1      manu /* struct old_sigaction32 in Linux; uses a 32 bit pointer for handlers */
    105        1.1      manu struct linux_compat_old_sigaction {
    106  1.4.120.1  jdolecek 	linux_handler_t linux_sa_handler;
    107        1.1      manu 	linux_old_sigset_t linux_sa_mask;
    108        1.1      manu 	unsigned int linux_sa_flags;
    109  1.4.120.1  jdolecek 	void (*linux_sa_restorer)(void);
    110        1.1      manu };
    111        1.1      manu 
    112        1.1      manu /* Dummy declaration to avoid errors, unused */
    113        1.1      manu struct linux_old_sigaction {
    114        1.1      manu 	linux_handler_t linux_sa_handler;
    115        1.1      manu 	unsigned long linux_sa_flags;
    116  1.4.120.1  jdolecek 	void (*linux_sa_restorer)(void);
    117        1.1      manu 	linux_sigset_t linux_sa_mask;
    118        1.1      manu };
    119        1.1      manu 
    120        1.1      manu struct linux_sigaction {
    121        1.1      manu 	linux_handler_t linux_sa_handler;
    122        1.1      manu 	unsigned long linux_sa_flags;
    123  1.4.120.1  jdolecek 	void (*linux_sa_restorer)(void);
    124        1.1      manu 	linux_sigset_t linux_sa_mask;
    125        1.1      manu };
    126        1.1      manu 
    127        1.1      manu typedef struct linux_sigaltstack {
    128        1.1      manu 	void *ss_sp;
    129        1.1      manu 	int ss_flags;
    130        1.1      manu 	size_t ss_size;
    131        1.1      manu } linux_stack_t;
    132        1.1      manu 
    133        1.1      manu #endif /* !_AMD64_LINUX_SIGNAL_H */
    134