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