signal.h revision 1da177e4c3f41524e886b7f1b8a0c1fc7321cac
11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef _ASM_M32R_SIGNAL_H 21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define _ASM_M32R_SIGNAL_H 31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* $Id$ */ 51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* orig : i386 2.4.18 */ 71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/types.h> 91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/linkage.h> 101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/time.h> 111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/compiler.h> 121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Avoid too many header ordering problems. */ 141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct siginfo; 151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifdef __KERNEL__ 171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Most things should be clean enough to redefine this at will, if care 181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds is taken to make libc match. */ 191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define _NSIG 64 211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define _NSIG_BPW 32 221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define _NSIG_WORDS (_NSIG / _NSIG_BPW) 231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef unsigned long old_sigset_t; /* at least 32 bits */ 251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef struct { 271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned long sig[_NSIG_WORDS]; 281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} sigset_t; 291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#else 311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Here we must cater to libcs that poke about in kernel headers. */ 321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define NSIG 32 341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef unsigned long sigset_t; 351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* __KERNEL__ */ 371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGHUP 1 391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGINT 2 401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGQUIT 3 411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGILL 4 421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGTRAP 5 431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGABRT 6 441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGIOT 6 451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGBUS 7 461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGFPE 8 471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGKILL 9 481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGUSR1 10 491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGSEGV 11 501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGUSR2 12 511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGPIPE 13 521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGALRM 14 531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGTERM 15 541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGSTKFLT 16 551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGCHLD 17 561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGCONT 18 571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGSTOP 19 581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGTSTP 20 591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGTTIN 21 601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGTTOU 22 611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGURG 23 621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGXCPU 24 631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGXFSZ 25 641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGVTALRM 26 651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGPROF 27 661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGWINCH 28 671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGIO 29 681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGPOLL SIGIO 691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGLOST 29 711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/ 721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGPWR 30 731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGSYS 31 741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGUNUSED 31 751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* These should not be considered constants from userland. */ 771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGRTMIN 32 781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGRTMAX _NSIG 791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_FLAGS values: 821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_ONSTACK indicates that a registered stack_t will be used. 841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the 851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_RESTART flag to get restarting signals (which were the default long ago) 861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. 871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_RESETHAND clears the handler when the signal is delivered. 881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. 891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_NODEFER prevents the current signal from being masked in the handler. 901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single 921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Unix names RESETHAND and NODEFER respectively. 931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_NOCLDSTOP 0x00000001u 951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_NOCLDWAIT 0x00000002u 961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_SIGINFO 0x00000004u 971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_ONSTACK 0x08000000u 981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_RESTART 0x10000000u 991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_NODEFER 0x40000000u 1001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_RESETHAND 0x80000000u 1011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_NOMASK SA_NODEFER 1031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_ONESHOT SA_RESETHAND 1041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ 1051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_RESTORER 0x04000000 1071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * sigaltstack controls 1101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 1111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SS_ONSTACK 1 1121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SS_DISABLE 2 1131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define MINSIGSTKSZ 2048 1151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIGSTKSZ 8192 1161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifdef __KERNEL__ 1181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 1201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * These values of sa_flags are used only by the kernel as part of the 1211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * irq handling routines. 1221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 1231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_INTERRUPT is also used by the irq handling routines. 1241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * SA_SHIRQ is for shared interrupt support on PCI and EISA. 1251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 1261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_PROBE SA_ONESHOT 1271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_SAMPLE_RANDOM SA_RESTART 1281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SA_SHIRQ 0x04000000 1291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif 1301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIG_BLOCK 0 /* for blocking signals */ 1321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIG_UNBLOCK 1 /* for unblocking signals */ 1331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIG_SETMASK 2 /* for setting the signal mask */ 1341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Type of a signal handler. */ 1361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef void __signalfn_t(int); 1371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef __signalfn_t __user *__sighandler_t; 1381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef void __restorefn_t(void); 1401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef __restorefn_t __user *__sigrestore_t; 1411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIG_DFL ((__sighandler_t)0) /* default signal handling */ 1431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIG_IGN ((__sighandler_t)1) /* ignore signal */ 1441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */ 1451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifdef __KERNEL__ 1471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct old_sigaction { 1481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds __sighandler_t sa_handler; 1491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds old_sigset_t sa_mask; 1501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned long sa_flags; 1511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds __sigrestore_t sa_restorer; 1521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct sigaction { 1551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds __sighandler_t sa_handler; 1561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned long sa_flags; 1571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds __sigrestore_t sa_restorer; 1581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds sigset_t sa_mask; /* mask last for extensibility */ 1591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct k_sigaction { 1621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct sigaction sa; 1631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#else 1651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Here we must cater to libcs that poke about in kernel headers. */ 1661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct sigaction { 1681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds union { 1691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds __sighandler_t _sa_handler; 1701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds void (*_sa_sigaction)(int, struct siginfo *, void *); 1711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds } _u; 1721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds sigset_t sa_mask; 1731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned long sa_flags; 1741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds void (*sa_restorer)(void); 1751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define sa_handler _u._sa_handler 1781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define sa_sigaction _u._sa_sigaction 1791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* __KERNEL__ */ 1811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef struct sigaltstack { 1831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds void __user *ss_sp; 1841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds int ss_flags; 1851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds size_t ss_size; 1861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} stack_t; 1871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifdef __KERNEL__ 1891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <asm/sigcontext.h> 1901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#undef __HAVE_ARCH_SIG_BITOPS 1921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct pt_regs; 1941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsextern int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset)); 1951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define ptrace_signal_deliver(regs, cookie) do { } while (0) 1971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* __KERNEL__ */ 1991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 2001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* _ASM_M32R_SIGNAL_H */ 201