summaryrefslogtreecommitdiff
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-11-06 13:28:21 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-03 15:09:26 -0500
commit5a1b98d3096f1d780045f9be812335ad77aed93d (patch)
tree8a7dd49d3ed891d3d2f6cd47f972fee36ecaf325 /include/linux/sched.h
parent2ce5da17570771330f44ac993b77749debf7954b (diff)
downloadlwn-5a1b98d3096f1d780045f9be812335ad77aed93d.tar.gz
lwn-5a1b98d3096f1d780045f9be812335ad77aed93d.zip
new helper: sigsp()
Normal logics for altstack handling in sigframe allocation Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6fc8f45de4e9..8f983293b403 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2305,6 +2305,17 @@ static inline int sas_ss_flags(unsigned long sp)
: on_sig_stack(sp) ? SS_ONSTACK : 0);
}
+static inline unsigned long sigsp(unsigned long sp, struct ksignal *ksig)
+{
+ if (unlikely((ksig->ka.sa.sa_flags & SA_ONSTACK)) && ! sas_ss_flags(sp))
+#ifdef CONFIG_STACK_GROWSUP
+ return current->sas_ss_sp;
+#else
+ return current->sas_ss_sp + current->sas_ss_size;
+#endif
+ return sp;
+}
+
/*
* Routines for handling mm_structs
*/