blob: b4debe283a79e2cb3f26c5d63925742e6efa5151 [file] [log] [blame]
Michal Simek24b45a12009-11-10 15:57:01 +01001/*
2 * Stack trace support for Microblaze.
3 *
4 * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2009 PetaLogix
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
Michal Simekd64af912013-02-01 13:10:35 +010012#include <linux/export.h>
Michal Simek24b45a12009-11-10 15:57:01 +010013#include <linux/sched.h>
14#include <linux/stacktrace.h>
15#include <linux/thread_info.h>
16#include <linux/ptrace.h>
Steven J. Magnanice3266c2010-04-27 12:37:54 -050017#include <asm/unwind.h>
Michal Simek24b45a12009-11-10 15:57:01 +010018
Michal Simek24b45a12009-11-10 15:57:01 +010019void save_stack_trace(struct stack_trace *trace)
20{
Steven J. Magnanice3266c2010-04-27 12:37:54 -050021 /* Exclude our helper functions from the trace*/
22 trace->skip += 2;
23 microblaze_unwind(NULL, trace);
Michal Simek24b45a12009-11-10 15:57:01 +010024}
25EXPORT_SYMBOL_GPL(save_stack_trace);
26
27void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
28{
Steven J. Magnanice3266c2010-04-27 12:37:54 -050029 microblaze_unwind(tsk, trace);
Michal Simek24b45a12009-11-10 15:57:01 +010030}
31EXPORT_SYMBOL_GPL(save_stack_trace_tsk);