xref: /openbmc/linux/arch/arc/include/asm/stacktrace.h (revision d2912cb1)
1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
23a51d50fSVineet Gupta /*
33a51d50fSVineet Gupta  * Copyright (C) 2014-15 Synopsys, Inc. (www.synopsys.com)
43a51d50fSVineet Gupta  * Copyright (C) 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
53a51d50fSVineet Gupta  */
63a51d50fSVineet Gupta 
73a51d50fSVineet Gupta #ifndef __ASM_STACKTRACE_H
83a51d50fSVineet Gupta #define __ASM_STACKTRACE_H
93a51d50fSVineet Gupta 
103a51d50fSVineet Gupta #include <linux/sched.h>
113a51d50fSVineet Gupta 
123a51d50fSVineet Gupta /**
133a51d50fSVineet Gupta  * arc_unwind_core - Unwind the kernel mode stack for an execution context
143a51d50fSVineet Gupta  * @tsk:		NULL for current task, specific task otherwise
153a51d50fSVineet Gupta  * @regs:		pt_regs used to seed the unwinder {SP, FP, BLINK, PC}
163a51d50fSVineet Gupta  * 			If NULL, use pt_regs of @tsk (if !NULL) otherwise
173a51d50fSVineet Gupta  * 			use the current values of {SP, FP, BLINK, PC}
183a51d50fSVineet Gupta  * @consumer_fn:	Callback invoked for each frame unwound
193a51d50fSVineet Gupta  * 			Returns 0 to continue unwinding, -1 to stop
203a51d50fSVineet Gupta  * @arg:		Arg to callback
213a51d50fSVineet Gupta  *
223a51d50fSVineet Gupta  * Returns the address of first function in stack
233a51d50fSVineet Gupta  *
243a51d50fSVineet Gupta  * Semantics:
253a51d50fSVineet Gupta  *  - synchronous unwinding (e.g. dump_stack): @tsk  NULL, @regs  NULL
263a51d50fSVineet Gupta  *  - Asynchronous unwinding of sleeping task: @tsk !NULL, @regs  NULL
273a51d50fSVineet Gupta  *  - Asynchronous unwinding of intr/excp etc: @tsk !NULL, @regs !NULL
283a51d50fSVineet Gupta  */
293a51d50fSVineet Gupta notrace noinline unsigned int arc_unwind_core(
303a51d50fSVineet Gupta 	struct task_struct *tsk, struct pt_regs *regs,
313a51d50fSVineet Gupta 	int (*consumer_fn) (unsigned int, void *),
323a51d50fSVineet Gupta 	void *arg);
333a51d50fSVineet Gupta 
343a51d50fSVineet Gupta #endif /* __ASM_STACKTRACE_H */
35