blob: f555bb3664dcaa2dbee6ab4e1f486d24e360ba8f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASMARM_TRAP_H
2#define _ASMARM_TRAP_H
3
4#include <linux/list.h>
5
Mikael Petterssone7d59db2011-07-22 16:47:26 +01006struct pt_regs;
7struct task_struct;
8
Linus Torvalds1da177e2005-04-16 15:20:36 -07009struct undef_hook {
10 struct list_head node;
11 u32 instr_mask;
12 u32 instr_val;
13 u32 cpsr_mask;
14 u32 cpsr_val;
15 int (*fn)(struct pt_regs *regs, unsigned int instr);
16};
17
18void register_undef_hook(struct undef_hook *hook);
19void unregister_undef_hook(struct undef_hook *hook);
20
Rabin Vincent61b5cb12010-10-07 20:51:58 +053021#ifdef CONFIG_FUNCTION_GRAPH_TRACER
22static inline int __in_irqentry_text(unsigned long ptr)
23{
24 extern char __irqentry_text_start[];
25 extern char __irqentry_text_end[];
26
27 return ptr >= (unsigned long)&__irqentry_text_start &&
28 ptr < (unsigned long)&__irqentry_text_end;
29}
30#else
31static inline int __in_irqentry_text(unsigned long ptr)
32{
33 return 0;
34}
35#endif
36
Nicolas Pitre785d3cd2007-12-03 15:27:56 -050037static inline int in_exception_text(unsigned long ptr)
38{
39 extern char __exception_text_start[];
40 extern char __exception_text_end[];
Rabin Vincent61b5cb12010-10-07 20:51:58 +053041 int in;
Nicolas Pitre785d3cd2007-12-03 15:27:56 -050042
Rabin Vincent61b5cb12010-10-07 20:51:58 +053043 in = ptr >= (unsigned long)&__exception_text_start &&
44 ptr < (unsigned long)&__exception_text_end;
45
46 return in ? : __in_irqentry_text(ptr);
Nicolas Pitre785d3cd2007-12-03 15:27:56 -050047}
48
Russell King94e5a852012-01-18 15:32:49 +000049extern void __init early_trap_init(void *);
Catalin Marinas67a94c22009-02-11 13:06:53 +010050extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame);
Will Deacon425fc472011-02-14 14:31:09 +010051extern void ptrace_break(struct task_struct *tsk, struct pt_regs *regs);
Jason Wessel5cbad0e2008-02-20 13:33:40 -060052
Catalin Marinas247055a2010-09-13 16:03:21 +010053extern void *vectors_page;
54
Linus Torvalds1da177e2005-04-16 15:20:36 -070055#endif