stacktrace.h 1.2 KB

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