1 /* $Id: signal.h,v 1.21 1996/04/25 06:13:28 davem Exp $ */ 2 #ifndef_ASMSPARC_SIGNAL_H 3 #define_ASMSPARC_SIGNAL_H 4
5 #include <asm/sigcontext.h>
6
7 /* On the Sparc the signal handlers get passed a 'sub-signal' code 8 * for certain signal types, which we document here. 9 */ 10 #define_NSIG 32
11 #defineNSIG_NSIG 12
13 #defineSIGHUP 1
14 #defineSIGINT 2
15 #defineSIGQUIT 3
16 #defineSIGILL 4
17 #define SUBSIG_STACK 0
18 #defineSUBSIG_ILLINST 2
19 #defineSUBSIG_PRIVINST 3
20 #defineSUBSIG_BADTRAP(t) (0x80 + (t))
21
22 #defineSIGTRAP 5
23 #defineSIGABRT 6
24 #defineSIGIOT 6
25
26 #defineSIGEMT 7
27 #defineSUBSIG_TAG 10
28
29 #defineSIGFPE 8
30 #define SUBSIG_FPDISABLED 0x400
31 #defineSUBSIG_FPERROR 0x404
32 #define SUBSIG_FPINTOVFL 0x001
33 #define SUBSIG_FPSTSIG 0x002
34 #define SUBSIG_IDIVZERO 0x014
35 #define SUBSIG_FPINEXACT 0x0c4
36 #define SUBSIG_FPDIVZERO 0x0c8
37 #define SUBSIG_FPUNFLOW 0x0cc
38 #define SUBSIG_FPOPERROR 0x0d0
39 #define SUBSIG_FPOVFLOW 0x0d4
40
41 #defineSIGKILL 9
42 #defineSIGBUS 10
43 #define SUBSIG_BUSTIMEOUT 1
44 #define SUBSIG_ALIGNMENT 2
45 #define SUBSIG_MISCERROR 5
46
47 #defineSIGSEGV 11
48 #defineSUBSIG_NOMAPPING 3
49 #define SUBSIG_PROTECTION 4
50 #define SUBSIG_SEGERROR 5
51
52 #defineSIGSYS 12
53 #defineSIGPIPE 13
54 #defineSIGALRM 14
55 #define SIGTERM 15
56 #defineSIGURG 16
57
58 /* SunOS values which deviate from the Linux/i386 ones */ 59 #defineSIGSTOP 17
60 #defineSIGTSTP 18
61 #defineSIGCONT 19
62 #defineSIGCHLD 20
63 #defineSIGTTIN 21
64 #defineSIGTTOU 22
65 #defineSIGIO 23
66 #define SIGPOLL SIGIO/* SysV name for SIGIO */ 67 #defineSIGXCPU 24
68 #define SIGXFSZ 25
69 #defineSIGVTALRM 26
70 #defineSIGPROF 27
71 #defineSIGWINCH 28
72 #define SIGLOST 29
73 #define SIGUSR1 30
74 #define SIGUSR2 31
75
76 #ifndef__ASSEMBLY__ 77
78 typedefunsignedlongsigset_t;
79
80 #ifdef__KERNEL__ 81 #include <asm/sigcontext.h>
82 #endif 83
84 /* A SunOS sigstack */ 85 structsigstack{ 86 char *the_stack;
87 intcur_status;
88 };
89
90 /* Sigvec flags */ 91 #defineSV_SSTACK 1 /* This signal handler should use sig-stack */ 92 #defineSV_INTR 2 /* Sig return should not restart system call */ 93 #defineSV_RESET 4 /* Set handler to SIG_DFL upon taken signal */ 94 #defineSV_IGNCHILD 8 /* Do not send SIGCHLD */ 95
96 /* 97 * sa_flags values: SA_STACK is not currently supported, but will allow the 98 * usage of signal stacks by using the (now obsolete) sa_restorer field in 99 * the sigaction structure as a stack pointer. This is now possible due to 100 * the changes in signal handling. LBT 010493. 101 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the 102 * SA_RESTART flag to get restarting signals (which were the default long ago) 103 * SA_SHIRQ flag is for shared interrupt support on PCI and EISA. 104 */ 105 #defineSA_NOCLDSTOPSV_IGNCHILD 106 #defineSA_STACKSV_SSTACK 107 #defineSA_RESTARTSV_INTR 108 #defineSA_ONESHOTSV_RESET 109 #defineSA_INTERRUPT 0x10
110 #defineSA_NOMASK 0x20
111 #defineSA_SHIRQ 0x40
112
113 #defineSIG_BLOCK 0x01 /* for blocking signals */ 114 #defineSIG_UNBLOCK 0x02 /* for unblocking signals */ 115 #defineSIG_SETMASK 0x04 /* for setting the signal mask */ 116
117 #ifdef__KERNEL__ 118 /* 119 * These values of sa_flags are used only by the kernel as part of the 120 * irq handling routines. 121 * 122 * SA_INTERRUPT is also used by the irq handling routines. 123 * 124 * DJHR 125 * SA_STATIC_ALLOC is used for the SPARC system to indicate that this 126 * interrupt handler's irq structure should be statically allocated 127 * by the request_irq routine. 128 * The alternative is that arch/sparc/kernel/irq.c has carnal knowledge 129 * of interrupt usage and that sucks. Also without a flag like this 130 * it may be possible for the free_irq routine to attempt to free 131 * statically allocated data.. which is NOT GOOD. 132 * 133 */ 134 #defineSA_PROBESA_ONESHOT 135 #defineSA_SAMPLE_RANDOMSA_RESTART 136 #defineSA_STATIC_ALLOC 0x80
137 #endif 138
139 /* Type of a signal handler. */ 140 #ifdef__KERNEL__ 141 typedefvoid (*__sighandler_t)(int, int, structsigcontext_struct *, char *);
142 #else 143 typedefvoid (*__sighandler_t)(int);
144 #endif 145
146 #defineSIG_DFL ((__sighandler_t)0) /* default signal handling */ 147 #defineSIG_IGN ((__sighandler_t)1) /* ignore signal */ 148 #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */ 149
150 structsigaction{ 151 __sighandler_tsa_handler;
152 sigset_tsa_mask;
153 unsignedlongsa_flags;
154 };
155
156 #endif/* !(__ASSEMBLY__) */ 157
158 #endif/* !(_ASMSPARC_SIGNAL_H) */