/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _KSTACK_H #define _KSTACK_H #include <linux/thread_info.h> #include <linux/sched.h> #include <asm/ptrace.h> #include <asm/irq.h> /* SP must be STACK_BIAS adjusted already. */
static inline bool kstack_valid(struct thread_info *tp, unsigned long sp) { unsigned long base = (unsigned long) tp; /* Stack pointer must be 16-byte aligned. */ if (sp & (16UL - 1)) return false; if (sp >= (base + sizeof(struct thread_info)) && sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) return true; if (hardirq_stack[tp->cpu]) { base = (unsigned long) hardirq_stack[tp->cpu]; if (sp >= base && sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) return true; base = (unsigned long) softirq_stack[tp->cpu]; if (sp >= base && sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) return true; } return false; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 157 | 100.00% | 3 | 100.00% |
Total | 157 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 167 | 100.00% | 2 | 100.00% |
Total | 167 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 438 | 99.77% | 4 | 80.00% |
Greg Kroah-Hartman | 1 | 0.23% | 1 | 20.00% |
Total | 439 | 100.00% | 5 | 100.00% |