2 * arch/ubicom32/include/asm/stacktrace.h
3 * Stacktrace functions for the Ubicom32 architecture.
5 * (C) Copyright 2009, Ubicom, Inc.
7 * This file is part of the Ubicom32 Linux Kernel Port.
9 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10 * it and/or modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation, either version 2 of the
12 * License, or (at your option) any later version.
14 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with the Ubicom32 Linux Kernel Port. If not,
21 * see <http://www.gnu.org/licenses/>.
23 * Ubicom32 implementation derived from (with many thanks):
28 #ifndef _ASM_UBICOM32_STACKTRACE_H
29 #define _ASM_UBICOM32_STACKTRACE_H
31 #define between(a, b, c) (( \
32 ((unsigned long) a) >= ((unsigned long) b)) && \
33 (((unsigned long)a) <= ((unsigned long)c)))
36 * These symbols are filled in by the linker.
38 extern unsigned long _stext;
39 extern unsigned long _etext;
41 /* OCM text goes from __ocm_text_run_begin to __data_begin */
42 extern unsigned long __ocm_text_run_begin;
43 extern unsigned long __data_begin;
45 /* Account for OCM case - see stacktrace.c maybe combine(also trap.c) */
47 * ubicom32_is_kernel()
49 * Check to see if the given address belongs to the kernel.
50 * NOMMU does not permit any other means.
52 static inline int ubicom32_is_kernel(unsigned long addr)
54 int is_kernel = between(addr, &_stext, &_etext) || \
55 between(addr, &__ocm_text_run_begin, &__data_begin);
59 is_kernel = is_module_address(addr);
64 extern unsigned long stacktrace_iterate(
65 unsigned long **trace,
66 unsigned long stext, unsigned long etext,
67 unsigned long ocm_stext, unsigned long ocm_etext,
68 unsigned long sstack, unsigned long estack);
69 #ifdef CONFIG_STACKTRACE
70 void stacktrace_save_entries(struct task_struct *tsk, struct stack_trace *trace, unsigned long sp);
72 #endif /* _ASM_UBICOM32_STACKTRACE_H */