Michal Simek | 24b45a1 | 2009-11-10 15:57:01 +0100 | [diff] [blame] | 1 | /* |
| 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 | |
| 12 | #include <linux/sched.h> |
| 13 | #include <linux/stacktrace.h> |
| 14 | #include <linux/thread_info.h> |
| 15 | #include <linux/ptrace.h> |
| 16 | #include <linux/module.h> |
Steven J. Magnani | ce3266c | 2010-04-27 12:37:54 -0500 | [diff] [blame] | 17 | #include <asm/unwind.h> |
Michal Simek | 24b45a1 | 2009-11-10 15:57:01 +0100 | [diff] [blame] | 18 | |
Michal Simek | 24b45a1 | 2009-11-10 15:57:01 +0100 | [diff] [blame] | 19 | void save_stack_trace(struct stack_trace *trace) |
| 20 | { |
Steven J. Magnani | ce3266c | 2010-04-27 12:37:54 -0500 | [diff] [blame] | 21 | /* Exclude our helper functions from the trace*/ |
| 22 | trace->skip += 2; |
| 23 | microblaze_unwind(NULL, trace); |
Michal Simek | 24b45a1 | 2009-11-10 15:57:01 +0100 | [diff] [blame] | 24 | } |
| 25 | EXPORT_SYMBOL_GPL(save_stack_trace); |
| 26 | |
| 27 | void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) |
| 28 | { |
Steven J. Magnani | ce3266c | 2010-04-27 12:37:54 -0500 | [diff] [blame] | 29 | microblaze_unwind(tsk, trace); |
Michal Simek | 24b45a1 | 2009-11-10 15:57:01 +0100 | [diff] [blame] | 30 | } |
| 31 | EXPORT_SYMBOL_GPL(save_stack_trace_tsk); |