Skip to content

Commit

Permalink
new helper: sigsp()
Browse files Browse the repository at this point in the history
Normal logics for altstack handling in sigframe allocation

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Feb 3, 2013
1 parent 2ce5da1 commit 5a1b98d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 5a1b98d

Please sign in to comment.