xref: /openbmc/linux/arch/microblaze/kernel/stacktrace.c (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
124b45a12SMichal Simek /*
224b45a12SMichal Simek  * Stack trace support for Microblaze.
324b45a12SMichal Simek  *
424b45a12SMichal Simek  * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
524b45a12SMichal Simek  * Copyright (C) 2009 PetaLogix
624b45a12SMichal Simek  *
724b45a12SMichal Simek  * This file is subject to the terms and conditions of the GNU General Public
824b45a12SMichal Simek  * License. See the file "COPYING" in the main directory of this archive
924b45a12SMichal Simek  * for more details.
1024b45a12SMichal Simek  */
1124b45a12SMichal Simek 
12d64af918SMichal Simek #include <linux/export.h>
1324b45a12SMichal Simek #include <linux/sched.h>
1424b45a12SMichal Simek #include <linux/stacktrace.h>
1524b45a12SMichal Simek #include <linux/thread_info.h>
1624b45a12SMichal Simek #include <linux/ptrace.h>
17ce3266c0SSteven J. Magnani #include <asm/unwind.h>
1824b45a12SMichal Simek 
save_stack_trace(struct stack_trace * trace)1924b45a12SMichal Simek void save_stack_trace(struct stack_trace *trace)
2024b45a12SMichal Simek {
21ce3266c0SSteven J. Magnani 	/* Exclude our helper functions from the trace*/
22ce3266c0SSteven J. Magnani 	trace->skip += 2;
23*14b0dd87SDmitry Safonov 	microblaze_unwind(NULL, trace, "");
2424b45a12SMichal Simek }
2524b45a12SMichal Simek EXPORT_SYMBOL_GPL(save_stack_trace);
2624b45a12SMichal Simek 
save_stack_trace_tsk(struct task_struct * tsk,struct stack_trace * trace)2724b45a12SMichal Simek void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
2824b45a12SMichal Simek {
29*14b0dd87SDmitry Safonov 	microblaze_unwind(tsk, trace, "");
3024b45a12SMichal Simek }
3124b45a12SMichal Simek EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
32