diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-24 19:16:20 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-24 19:16:20 -0700 |
commit | 976fb3f7b92e91aeccb87de60128a1e65edd676f (patch) | |
tree | f5959ad474b401e4ed65a53faf2594b93dc885f1 /include | |
parent | 9d854607f9005c593dca9672b708f28e6ef96fe4 (diff) | |
parent | 119a0a3c13ef5ffe78dc0c1a55c5da9e377b2976 (diff) | |
download | linux-976fb3f7b92e91aeccb87de60128a1e65edd676f.tar.bz2 |
Merge branch 'parisc-4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc updates from Helge Deller:
"This patchset adds stack usage debug info for parisc and metag (on
both the stack grows upwards), switches to the new generic realative
extable search and sort routines, drops the long time ago removed
syscalls alloc_hugepages and free_hugepages and wires up the new
preadv2 and pwritev2 syscalls"
* 'parisc-4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc: Wire up preadv2 and pwritev2 syscalls
parisc: Use generic extable search and sort routines
parisc: Panic immediately when panic_on_oops
parisc,metag: Implement CONFIG_DEBUG_STACK_USAGE option
parisc: Drop alloc_hugepages and free_hugepages syscalls
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sched.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 34495d2d2d7b..589c4780b077 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2870,10 +2870,18 @@ static inline unsigned long stack_not_used(struct task_struct *p) unsigned long *n = end_of_stack(p); do { /* Skip over canary */ +# ifdef CONFIG_STACK_GROWSUP + n--; +# else n++; +# endif } while (!*n); +# ifdef CONFIG_STACK_GROWSUP + return (unsigned long)end_of_stack(p) - (unsigned long)n; +# else return (unsigned long)n - (unsigned long)end_of_stack(p); +# endif } #endif extern void set_task_stack_end_magic(struct task_struct *tsk); |