···11+/*22+ * Copyright (C) 2014-15 Synopsys, Inc. (www.synopsys.com)33+ * Copyright (C) 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)44+ *55+ * This program is free software; you can redistribute it and/or modify66+ * it under the terms of the GNU General Public License version 2 as77+ * published by the Free Software Foundation.88+ */99+1010+#ifndef __ASM_STACKTRACE_H1111+#define __ASM_STACKTRACE_H1212+1313+#include <linux/sched.h>1414+1515+/**1616+ * arc_unwind_core - Unwind the kernel mode stack for an execution context1717+ * @tsk: NULL for current task, specific task otherwise1818+ * @regs: pt_regs used to seed the unwinder {SP, FP, BLINK, PC}1919+ * If NULL, use pt_regs of @tsk (if !NULL) otherwise2020+ * use the current values of {SP, FP, BLINK, PC}2121+ * @consumer_fn: Callback invoked for each frame unwound2222+ * Returns 0 to continue unwinding, -1 to stop2323+ * @arg: Arg to callback2424+ *2525+ * Returns the address of first function in stack2626+ *2727+ * Semantics:2828+ * - synchronous unwinding (e.g. dump_stack): @tsk NULL, @regs NULL2929+ * - Asynchronous unwinding of sleeping task: @tsk !NULL, @regs NULL3030+ * - Asynchronous unwinding of intr/excp etc: @tsk !NULL, @regs !NULL3131+ */3232+notrace noinline unsigned int arc_unwind_core(3333+ struct task_struct *tsk, struct pt_regs *regs,3434+ int (*consumer_fn) (unsigned int, void *),3535+ void *arg);3636+3737+#endif /* __ASM_STACKTRACE_H */
+14-1
arch/arc/kernel/stacktrace.c
···4343 struct pt_regs *regs,4444 struct unwind_frame_info *frame_info)4545{4646+ /*4747+ * synchronous unwinding (e.g. dump_stack)4848+ * - uses current values of SP and friends4949+ */4650 if (tsk == NULL && regs == NULL) {4751 unsigned long fp, sp, blink, ret;4852 frame_info->task = current;···6561 frame_info->regs.r63 = ret;6662 frame_info->call_frame = 0;6763 } else if (regs == NULL) {6464+ /*6565+ * Asynchronous unwinding of sleeping task6666+ * - Gets SP etc from task's pt_regs (saved bottom of kernel6767+ * mode stack of task)6868+ */68696970 frame_info->task = tsk;7071···9283 frame_info->call_frame = 0;93849485 } else {8686+ /*8787+ * Asynchronous unwinding of intr/exception8888+ * - Just uses the pt_regs passed8989+ */9590 frame_info->task = tsk;96919792 frame_info->regs.r27 = regs->fp;···1089510996#endif11097111111-static noinline unsigned int9898+notrace noinline unsigned int11299arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,113100 int (*consumer_fn) (unsigned int, void *), void *arg)114101{