projects/linux·blob master · refs

20 lines · 500 B

1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_ALPHA_STACKTRACE_H
3#define _ASM_ALPHA_STACKTRACE_H
4
5#include <linux/compiler_attributes.h>
6#include <linux/types.h>
7
8#include <asm/current.h>
9#include <asm/processor.h>
10#include <asm/thread_info.h>
11
12static __always_inline bool on_thread_stack(void)
13{
14 unsigned long base = (unsigned long)current->stack;
15 unsigned long sp = (unsigned long)current_stack_pointer;
16
17 return !((base ^ sp) & ~(THREAD_SIZE - 1));
18}
19
20#endif /* _ASM_ALPHA_STACKTRACE_H */