Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ASMARM_TRAP_H |
| 2 | #define _ASMARM_TRAP_H |
| 3 | |
| 4 | #include <linux/list.h> |
| 5 | |
| 6 | struct undef_hook { |
| 7 | struct list_head node; |
| 8 | u32 instr_mask; |
| 9 | u32 instr_val; |
| 10 | u32 cpsr_mask; |
| 11 | u32 cpsr_val; |
| 12 | int (*fn)(struct pt_regs *regs, unsigned int instr); |
| 13 | }; |
| 14 | |
| 15 | void register_undef_hook(struct undef_hook *hook); |
| 16 | void unregister_undef_hook(struct undef_hook *hook); |
| 17 | |
Rabin Vincent | 61b5cb1 | 2010-10-07 20:51:58 +0530 | [diff] [blame] | 18 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 19 | static inline int __in_irqentry_text(unsigned long ptr) |
| 20 | { |
| 21 | extern char __irqentry_text_start[]; |
| 22 | extern char __irqentry_text_end[]; |
| 23 | |
| 24 | return ptr >= (unsigned long)&__irqentry_text_start && |
| 25 | ptr < (unsigned long)&__irqentry_text_end; |
| 26 | } |
| 27 | #else |
| 28 | static inline int __in_irqentry_text(unsigned long ptr) |
| 29 | { |
| 30 | return 0; |
| 31 | } |
| 32 | #endif |
| 33 | |
Nicolas Pitre | 785d3cd | 2007-12-03 15:27:56 -0500 | [diff] [blame] | 34 | static inline int in_exception_text(unsigned long ptr) |
| 35 | { |
| 36 | extern char __exception_text_start[]; |
| 37 | extern char __exception_text_end[]; |
Rabin Vincent | 61b5cb1 | 2010-10-07 20:51:58 +0530 | [diff] [blame] | 38 | int in; |
Nicolas Pitre | 785d3cd | 2007-12-03 15:27:56 -0500 | [diff] [blame] | 39 | |
Rabin Vincent | 61b5cb1 | 2010-10-07 20:51:58 +0530 | [diff] [blame] | 40 | in = ptr >= (unsigned long)&__exception_text_start && |
| 41 | ptr < (unsigned long)&__exception_text_end; |
| 42 | |
| 43 | return in ? : __in_irqentry_text(ptr); |
Nicolas Pitre | 785d3cd | 2007-12-03 15:27:56 -0500 | [diff] [blame] | 44 | } |
| 45 | |
Jason Wessel | 5cbad0e | 2008-02-20 13:33:40 -0600 | [diff] [blame] | 46 | extern void __init early_trap_init(void); |
Catalin Marinas | 67a94c2 | 2009-02-11 13:06:53 +0100 | [diff] [blame] | 47 | extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame); |
Will Deacon | 425fc47 | 2011-02-14 14:31:09 +0100 | [diff] [blame] | 48 | extern void ptrace_break(struct task_struct *tsk, struct pt_regs *regs); |
Jason Wessel | 5cbad0e | 2008-02-20 13:33:40 -0600 | [diff] [blame] | 49 | |
Catalin Marinas | 247055a | 2010-09-13 16:03:21 +0100 | [diff] [blame] | 50 | extern void *vectors_page; |
| 51 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | #endif |