traps.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _ASMARM_TRAP_H
  2. #define _ASMARM_TRAP_H
  3. #include <linux/list.h>
  4. struct pt_regs;
  5. struct task_struct;
  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. void register_undef_hook(struct undef_hook *hook);
  15. void unregister_undef_hook(struct undef_hook *hook);
  16. #ifdef CONFIG_FUNCTION_GRAPH_TRACER
  17. static inline int __in_irqentry_text(unsigned long ptr)
  18. {
  19. extern char __irqentry_text_start[];
  20. extern char __irqentry_text_end[];
  21. return ptr >= (unsigned long)&__irqentry_text_start &&
  22. ptr < (unsigned long)&__irqentry_text_end;
  23. }
  24. #else
  25. static inline int __in_irqentry_text(unsigned long ptr)
  26. {
  27. return 0;
  28. }
  29. #endif
  30. static inline int in_exception_text(unsigned long ptr)
  31. {
  32. extern char __exception_text_start[];
  33. extern char __exception_text_end[];
  34. int in;
  35. in = ptr >= (unsigned long)&__exception_text_start &&
  36. ptr < (unsigned long)&__exception_text_end;
  37. return in ? : __in_irqentry_text(ptr);
  38. }
  39. extern void __init early_trap_init(void *);
  40. extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame);
  41. extern void ptrace_break(struct task_struct *tsk, struct pt_regs *regs);
  42. extern void *vectors_page;
  43. #endif