From: Al Viro Date: Tue, 6 Nov 2012 18:28:21 +0000 (-0500) Subject: new helper: sigsp() X-Git-Tag: v3.9-rc1~98^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a1b98d3096f1d780045f9be812335ad77aed93d;p=platform%2Fupstream%2Fkernel-adaptation-pc.git new helper: sigsp() Normal logics for altstack handling in sigframe allocation Signed-off-by: Al Viro --- diff --git a/include/linux/sched.h b/include/linux/sched.h index 6fc8f45..8f98329 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 */