Merge tag 'kvm-x86-misc-6.9' of https://github.com/kvm-x86/linux into HEAD
[linux-2.6-block.git] / arch / riscv / include / asm / stacktrace.h
CommitLineData
99c168fc
KW
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef _ASM_RISCV_STACKTRACE_H
4#define _ASM_RISCV_STACKTRACE_H
5
6#include <linux/sched.h>
7#include <asm/ptrace.h>
8
9struct stackframe {
10 unsigned long fp;
11 unsigned long ra;
12};
13
14extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
9dd97064 15 bool (*fn)(void *, unsigned long), void *arg);
091b9450
KW
16extern void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
17 const char *loglvl);
99c168fc 18
f0bddf50
GR
19static inline bool on_thread_stack(void)
20{
21 return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1));
22}
23
2cf96378
BD
24
25#ifdef CONFIG_VMAP_STACK
26DECLARE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], overflow_stack);
27#endif /* CONFIG_VMAP_STACK */
28
99c168fc 29#endif /* _ASM_RISCV_STACKTRACE_H */