^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2014-15 Synopsys, Inc. (www.synopsys.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #ifndef __ASM_STACKTRACE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define __ASM_STACKTRACE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * arc_unwind_core - Unwind the kernel mode stack for an execution context
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * @tsk: NULL for current task, specific task otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * @regs: pt_regs used to seed the unwinder {SP, FP, BLINK, PC}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * If NULL, use pt_regs of @tsk (if !NULL) otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * use the current values of {SP, FP, BLINK, PC}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * @consumer_fn: Callback invoked for each frame unwound
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * Returns 0 to continue unwinding, -1 to stop
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * @arg: Arg to callback
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * Returns the address of first function in stack
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * Semantics:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * - synchronous unwinding (e.g. dump_stack): @tsk NULL, @regs NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * - Asynchronous unwinding of sleeping task: @tsk !NULL, @regs NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * - Asynchronous unwinding of intr/excp etc: @tsk !NULL, @regs !NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) notrace noinline unsigned int arc_unwind_core(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) struct task_struct *tsk, struct pt_regs *regs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) int (*consumer_fn) (unsigned int, void *),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) void *arg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #endif /* __ASM_STACKTRACE_H */