18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _LINUX_UNWINDER_H
38c2ecf20Sopenharmony_ci#define _LINUX_UNWINDER_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <asm/stacktrace.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cistruct unwinder {
88c2ecf20Sopenharmony_ci	const char *name;
98c2ecf20Sopenharmony_ci	struct list_head list;
108c2ecf20Sopenharmony_ci	int rating;
118c2ecf20Sopenharmony_ci	void (*dump)(struct task_struct *, struct pt_regs *,
128c2ecf20Sopenharmony_ci		     unsigned long *, const struct stacktrace_ops *, void *);
138c2ecf20Sopenharmony_ci};
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciextern int unwinder_init(void);
168c2ecf20Sopenharmony_ciextern int unwinder_register(struct unwinder *);
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciextern void unwind_stack(struct task_struct *, struct pt_regs *,
198c2ecf20Sopenharmony_ci			 unsigned long *, const struct stacktrace_ops *,
208c2ecf20Sopenharmony_ci			 void *);
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciextern void stack_reader_dump(struct task_struct *, struct pt_regs *,
238c2ecf20Sopenharmony_ci			      unsigned long *, const struct stacktrace_ops *,
248c2ecf20Sopenharmony_ci			      void *);
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/*
278c2ecf20Sopenharmony_ci * Used by fault handling code to signal to the unwinder code that it
288c2ecf20Sopenharmony_ci * should switch to a different unwinder.
298c2ecf20Sopenharmony_ci */
308c2ecf20Sopenharmony_ciextern int unwinder_faulted;
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#endif /* _LINUX_UNWINDER_H */
33