1/* 2 * BK Id: SCCS/s.signal.h 1.5 05/17/01 18:14:25 cort 3 */ 4#ifndef _ASMPPC_SIGNAL_H 5#define _ASMPPC_SIGNAL_H 6 7#ifdef __KERNEL__ 8#include <linux/types.h> 9#endif /* __KERNEL__ */ 10 11/* Avoid too many header ordering problems. */ 12struct siginfo; 13 14/* Most things should be clean enough to redefine this at will, if care 15 is taken to make libc match. */ 16 17#define _NSIG 64 18#define _NSIG_BPW 32 19#define _NSIG_WORDS (_NSIG / _NSIG_BPW) 20 21typedef unsigned long old_sigset_t; /* at least 32 bits */ 22 23typedef struct { 24 unsigned long sig[_NSIG_WORDS]; 25} sigset_t; 26 27#define SIGHUP 1 28#define SIGINT 2 29#define SIGQUIT 3 30#define SIGILL 4 31#define SIGTRAP 5 32#define SIGABRT 6 33#define SIGIOT 6 34#define SIGBUS 7 35#define SIGFPE 8 36#define SIGKILL 9 37#define SIGUSR1 10 38#define SIGSEGV 11 39#define SIGUSR2 12 40#define SIGPIPE 13 41#define SIGALRM 14 42#define SIGTERM 15 43#define SIGSTKFLT 16 44#define SIGCHLD 17 45#define SIGCONT 18 46#define SIGSTOP 19 47#define SIGTSTP 20 48#define SIGTTIN 21 49#define SIGTTOU 22 50#define SIGURG 23 51#define SIGXCPU 24 52#define SIGXFSZ 25 53#define SIGVTALRM 26 54#define SIGPROF 27 55#define SIGWINCH 28 56#define SIGIO 29 57#define SIGPOLL SIGIO 58/* 59#define SIGLOST 29 60*/ 61#define SIGPWR 30 62#define SIGSYS 31 63#define SIGUNUSED 31 64 65/* These should not be considered constants from userland. */ 66#define SIGRTMIN 32 67#define SIGRTMAX (_NSIG-1) 68 69/* 70 * SA_FLAGS values: 71 * 72 * SA_ONSTACK is not currently supported, but will allow sigaltstack(2). 73 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the 74 * SA_RESTART flag to get restarting signals (which were the default long ago) 75 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. 76 * SA_RESETHAND clears the handler when the signal is delivered. 77 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. 78 * SA_NODEFER prevents the current signal from being masked in the handler. 79 * 80 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single 81 * Unix names RESETHAND and NODEFER respectively. 82 */ 83#define SA_NOCLDSTOP 0x00000001 84#define SA_NOCLDWAIT 0x00000002 /* not supported yet */ 85#define SA_SIGINFO 0x00000004 86#define SA_ONSTACK 0x08000000 87#define SA_RESTART 0x10000000 88#define SA_NODEFER 0x40000000 89#define SA_RESETHAND 0x80000000 90 91#define SA_NOMASK SA_NODEFER 92#define SA_ONESHOT SA_RESETHAND 93#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ 94 95#define SA_RESTORER 0x04000000 96 97/* 98 * sigaltstack controls 99 */ 100#define SS_ONSTACK 1 101#define SS_DISABLE 2 102 103#define MINSIGSTKSZ 2048 104#define SIGSTKSZ 8192 105#ifdef __KERNEL__ 106 107/* 108 * These values of sa_flags are used only by the kernel as part of the 109 * irq handling routines. 110 * 111 * SA_INTERRUPT is also used by the irq handling routines. 112 * SA_SHIRQ is for shared interrupt support on PCI and EISA. 113 */ 114#define SA_PROBE SA_ONESHOT 115#define SA_SAMPLE_RANDOM SA_RESTART 116#define SA_SHIRQ 0x04000000 117#endif 118 119#define SIG_BLOCK 0 /* for blocking signals */ 120#define SIG_UNBLOCK 1 /* for unblocking signals */ 121#define SIG_SETMASK 2 /* for setting the signal mask */ 122 123/* Type of a signal handler. */ 124typedef void (*__sighandler_t)(int); 125 126#define SIG_DFL ((__sighandler_t)0) /* default signal handling */ 127#define SIG_IGN ((__sighandler_t)1) /* ignore signal */ 128#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */ 129 130struct old_sigaction { 131 __sighandler_t sa_handler; 132 old_sigset_t sa_mask; 133 unsigned long sa_flags; 134 void (*sa_restorer)(void); 135}; 136 137struct sigaction { 138 __sighandler_t sa_handler; 139 unsigned long sa_flags; 140 void (*sa_restorer)(void); 141 sigset_t sa_mask; /* mask last for extensibility */ 142}; 143 144struct k_sigaction { 145 struct sigaction sa; 146}; 147 148typedef struct sigaltstack { 149 void *ss_sp; 150 int ss_flags; 151 size_t ss_size; 152} stack_t; 153 154#ifdef __KERNEL__ 155#include <asm/sigcontext.h> 156 157#endif 158 159#endif 160