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