| #include <linux/thread_info.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; |
| if (sp >= (base + sizeof(struct thread_info)) && |
| sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) |
| if (hardirq_stack[tp->cpu]) { |
| base = (unsigned long) hardirq_stack[tp->cpu]; |
| sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) |
| base = (unsigned long) softirq_stack[tp->cpu]; |
| sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) |
| /* Does "regs" point to a valid pt_regs trap frame? */ |
| static inline bool kstack_is_trap_frame(struct thread_info *tp, struct pt_regs *regs) |
| unsigned long base = (unsigned long) tp; |
| unsigned long addr = (unsigned long) regs; |
| addr <= (base + THREAD_SIZE - sizeof(*regs))) |
| if (hardirq_stack[tp->cpu]) { |
| base = (unsigned long) hardirq_stack[tp->cpu]; |
| addr <= (base + THREAD_SIZE - sizeof(*regs))) |
| base = (unsigned long) softirq_stack[tp->cpu]; |
| addr <= (base + THREAD_SIZE - sizeof(*regs))) |
| if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) |