patch-2.1.106 linux/include/linux/sched.h

Next file: linux/include/linux/signal.h
Previous file: linux/include/linux/rtnetlink.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.105/linux/include/linux/sched.h linux/include/linux/sched.h
@@ -284,6 +284,8 @@
 	struct signal_struct *sig;
 	sigset_t signal, blocked;
 	struct signal_queue *sigqueue, **sigqueue_tail;
+	unsigned long sas_ss_sp;
+	size_t sas_ss_size;
 /* SMP state */
 	int has_cpu;
 	int processor;
@@ -365,6 +367,7 @@
 /* files */	&init_files, \
 /* mm */	&init_mm, \
 /* signals */	&init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, \
+		0, 0, \
 /* SMP */	0,0,0,0, \
 /* locks */	INIT_LOCKS \
 }
@@ -480,6 +483,7 @@
 extern int kill_proc(pid_t, int, int);
 extern int do_sigaction(int sig, const struct k_sigaction *act,
 			struct k_sigaction *oact);
+extern int do_sigaltstack(const stack_t *ss, stack_t *oss, unsigned long sp);
 
 extern inline int signal_pending(struct task_struct *p)
 {
@@ -517,6 +521,19 @@
 	t->sigpending = (ready != 0);
 }
 
+/* True if we are on the alternate signal stack.  */
+
+static inline int on_sig_stack(unsigned long sp)
+{
+	return (sp >= current->sas_ss_sp
+		&& sp < current->sas_ss_sp + current->sas_ss_size);
+}
+
+static inline int sas_ss_flags(unsigned long sp)
+{
+	return (current->sas_ss_size == 0 ? SS_DISABLE
+		: on_sig_stack(sp) ? SS_ONSTACK : 0);
+}
 
 extern int request_irq(unsigned int irq,
 		       void (*handler)(int, void *, struct pt_regs *),

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov