traps.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _ASMARM_TRAP_H
  2. #define _ASMARM_TRAP_H
  3. #include <linux/list.h>
  4. struct undef_hook {
  5. struct list_head node;
  6. u32 instr_mask;
  7. u32 instr_val;
  8. u32 cpsr_mask;
  9. u32 cpsr_val;
  10. int (*fn)(struct pt_regs *regs, unsigned int instr);
  11. };
  12. void register_undef_hook(struct undef_hook *hook);
  13. void unregister_undef_hook(struct undef_hook *hook);
  14. #ifdef CONFIG_FUNCTION_GRAPH_TRACER
  15. static inline int __in_irqentry_text(unsigned long ptr)
  16. {
  17. extern char __irqentry_text_start[];
  18. extern char __irqentry_text_end[];
  19. return ptr >= (unsigned long)&__irqentry_text_start &&
  20. ptr < (unsigned long)&__irqentry_text_end;
  21. }
  22. #else
  23. static inline int __in_irqentry_text(unsigned long ptr)
  24. {
  25. return 0;
  26. }
  27. #endif
  28. static inline int in_exception_text(unsigned long ptr)
  29. {
  30. extern char __exception_text_start[];
  31. extern char __exception_text_end[];
  32. int in;
  33. in = ptr >= (unsigned long)&__exception_text_start &&
  34. ptr < (unsigned long)&__exception_text_end;
  35. return in ? : __in_irqentry_text(ptr);
  36. }
  37. extern void __init early_trap_init(void);
  38. extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame);
  39. extern void *vectors_page;
  40. #endif