1 #ifndef _ASMx8664_SIGNAL_H
2 #define _ASMx8664_SIGNAL_H
5 #include <linux/types.h>
6 #include <linux/linkage.h>
7 #include <linux/time.h>
9 /* Avoid too many header ordering problems. */
13 /* Most things should be clean enough to redefine this at will, if care
14 is taken to make libc match. */
18 #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
20 typedef unsigned long old_sigset_t; /* at least 32 bits */
23 unsigned long sig[_NSIG_WORDS];
28 asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset);
32 /* Here we must cater to libcs that poke about in kernel headers. */
35 typedef unsigned long sigset_t;
37 #endif /* __KERNEL__ */
78 /* These should not be considered constants from userland. */
80 #define SIGRTMAX _NSIG
85 * SA_ONSTACK indicates that a registered stack_t will be used.
86 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
87 * SA_RESTART flag to get restarting signals (which were the default long ago)
88 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
89 * SA_RESETHAND clears the handler when the signal is delivered.
90 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
91 * SA_NODEFER prevents the current signal from being masked in the handler.
93 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
94 * Unix names RESETHAND and NODEFER respectively.
96 #define SA_NOCLDSTOP 0x00000001
97 #define SA_NOCLDWAIT 0x00000002
98 #define SA_SIGINFO 0x00000004
99 #define SA_ONSTACK 0x08000000
100 #define SA_RESTART 0x10000000
101 #define SA_NODEFER 0x40000000
102 #define SA_RESETHAND 0x80000000
104 #define SA_NOMASK SA_NODEFER
105 #define SA_ONESHOT SA_RESETHAND
106 #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
108 #define SA_RESTORER 0x04000000
111 * sigaltstack controls
116 #define MINSIGSTKSZ 2048
117 #define SIGSTKSZ 8192
122 * These values of sa_flags are used only by the kernel as part of the
123 * irq handling routines.
125 * SA_INTERRUPT is also used by the irq handling routines.
126 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
128 #define SA_PROBE SA_ONESHOT
129 #define SA_SAMPLE_RANDOM SA_RESTART
130 #define SA_SHIRQ 0x04000000
133 #define SIG_BLOCK 0 /* for blocking signals */
134 #define SIG_UNBLOCK 1 /* for unblocking signals */
135 #define SIG_SETMASK 2 /* for setting the signal mask */
138 /* Type of a signal handler. */
139 typedef void __signalfn_t(int);
140 typedef __signalfn_t __user *__sighandler_t;
142 typedef void __restorefn_t(void);
143 typedef __restorefn_t __user *__sigrestore_t;
145 #define SIG_DFL ((__sighandler_t)0) /* default signal handling */
146 #define SIG_IGN ((__sighandler_t)1) /* ignore signal */
147 #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
150 __sighandler_t sa_handler;
151 unsigned long sa_flags;
152 __sigrestore_t sa_restorer;
153 sigset_t sa_mask; /* mask last for extensibility */
160 typedef struct sigaltstack {
167 #include <asm/sigcontext.h>
169 #undef __HAVE_ARCH_SIG_BITOPS
172 extern __inline__ void sigaddset(sigset_t *set, int _sig)
174 __asm__("btsq %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc");
177 extern __inline__ void sigdelset(sigset_t *set, int _sig)
179 __asm__("btrq %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc");
182 extern __inline__ int __const_sigismember(sigset_t *set, int _sig)
184 unsigned long sig = _sig - 1;
185 return 1 & (set->sig[sig / _NSIG_BPW] >> (sig & ~(_NSIG_BPW-1)));
188 extern __inline__ int __gen_sigismember(sigset_t *set, int _sig)
191 __asm__("btq %2,%1\n\tsbbq %0,%0"
192 : "=r"(ret) : "m"(*set), "Ir"(_sig-1) : "cc");
196 #define sigismember(set,sig) \
197 (__builtin_constant_p(sig) ? \
198 __const_sigismember((set),(sig)) : \
199 __gen_sigismember((set),(sig)))
201 extern __inline__ int sigfindinword(unsigned long word)
203 __asm__("bsfq %1,%0" : "=r"(word) : "rm"(word) : "cc");
209 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
211 #endif /* __KERNEL__ */