cxgb4/l2t: Mark expected switch fall-through
[linux/fpc-iii.git] / arch / um / include / asm / stacktrace.h
blob436b55952c3a518dce95a9a69782cbfc8d5b4f02
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_UML_STACKTRACE_H
3 #define _ASM_UML_STACKTRACE_H
5 #include <linux/uaccess.h>
6 #include <linux/ptrace.h>
8 struct stack_frame {
9 struct stack_frame *next_frame;
10 unsigned long return_address;
13 struct stacktrace_ops {
14 void (*address)(void *data, unsigned long address, int reliable);
17 #ifdef CONFIG_FRAME_POINTER
18 static inline unsigned long
19 get_frame_pointer(struct task_struct *task, struct pt_regs *segv_regs)
21 if (!task || task == current)
22 return segv_regs ? PT_REGS_BP(segv_regs) : current_bp();
23 return KSTK_EBP(task);
25 #else
26 static inline unsigned long
27 get_frame_pointer(struct task_struct *task, struct pt_regs *segv_regs)
29 return 0;
31 #endif
33 static inline unsigned long
34 *get_stack_pointer(struct task_struct *task, struct pt_regs *segv_regs)
36 if (!task || task == current)
37 return segv_regs ? (unsigned long *)PT_REGS_SP(segv_regs) : current_sp();
38 return (unsigned long *)KSTK_ESP(task);
41 void dump_trace(struct task_struct *tsk, const struct stacktrace_ops *ops, void *data);
43 #endif /* _ASM_UML_STACKTRACE_H */