diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-06 13:28:21 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-03 15:09:26 -0500 |
| commit | 5a1b98d3096f1d780045f9be812335ad77aed93d (patch) | |
| tree | 8a7dd49d3ed891d3d2f6cd47f972fee36ecaf325 | |
| parent | 2ce5da17570771330f44ac993b77749debf7954b (diff) | |
new helper: sigsp()
Normal logics for altstack handling in sigframe allocation
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| -rw-r--r-- | include/linux/sched.h | 11 |
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) | |||
| 2305 | : on_sig_stack(sp) ? SS_ONSTACK : 0); | 2305 | : on_sig_stack(sp) ? SS_ONSTACK : 0); |
| 2306 | } | 2306 | } |
| 2307 | 2307 | ||
| 2308 | static inline unsigned long sigsp(unsigned long sp, struct ksignal *ksig) | ||
| 2309 | { | ||
| 2310 | if (unlikely((ksig->ka.sa.sa_flags & SA_ONSTACK)) && ! sas_ss_flags(sp)) | ||
| 2311 | #ifdef CONFIG_STACK_GROWSUP | ||
| 2312 | return current->sas_ss_sp; | ||
| 2313 | #else | ||
| 2314 | return current->sas_ss_sp + current->sas_ss_size; | ||
| 2315 | #endif | ||
| 2316 | return sp; | ||
| 2317 | } | ||
| 2318 | |||
| 2308 | /* | 2319 | /* |
| 2309 | * Routines for handling mm_structs | 2320 | * Routines for handling mm_structs |
| 2310 | */ | 2321 | */ |
