spi: efm32: Convert to use GPIO descriptors
[linux/fpc-iii.git] / arch / ia64 / kernel / stacktrace.c
blob6e583a6bd2f681bc1fe150d41f4fddf6dc624699
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * arch/ia64/kernel/stacktrace.c
5 * Stack trace management functions
7 */
8 #include <linux/sched.h>
9 #include <linux/stacktrace.h>
10 #include <linux/module.h>
12 static void
13 ia64_do_save_stack(struct unw_frame_info *info, void *arg)
15 struct stack_trace *trace = arg;
16 unsigned long ip;
17 int skip = trace->skip;
19 trace->nr_entries = 0;
20 do {
21 unw_get_ip(info, &ip);
22 if (ip == 0)
23 break;
24 if (skip == 0) {
25 trace->entries[trace->nr_entries++] = ip;
26 if (trace->nr_entries == trace->max_entries)
27 break;
28 } else
29 skip--;
30 } while (unw_unwind(info) >= 0);
34 * Save stack-backtrace addresses into a stack_trace buffer.
36 void save_stack_trace(struct stack_trace *trace)
38 unw_init_running(ia64_do_save_stack, trace);
40 EXPORT_SYMBOL(save_stack_trace);