kdebug.h 769 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __ASM_SH_KDEBUG_H
  2. #define __ASM_SH_KDEBUG_H
  3. #include <linux/notifier.h>
  4. struct pt_regs;
  5. struct die_args {
  6. struct pt_regs *regs;
  7. int trapnr;
  8. };
  9. int register_die_notifier(struct notifier_block *nb);
  10. int unregister_die_notifier(struct notifier_block *nb);
  11. int register_page_fault_notifier(struct notifier_block *nb);
  12. int unregister_page_fault_notifier(struct notifier_block *nb);
  13. extern struct atomic_notifier_head shdie_chain;
  14. /* Grossly misnamed. */
  15. enum die_val {
  16. DIE_TRAP,
  17. DIE_PAGE_FAULT,
  18. };
  19. static inline int notify_die(enum die_val val, struct pt_regs *regs,
  20. int trap, int sig)
  21. {
  22. struct die_args args = {
  23. .regs = regs,
  24. .trapnr = trap,
  25. };
  26. return atomic_notifier_call_chain(&shdie_chain, val, &args);
  27. }
  28. #endif /* __ASM_SH_KDEBUG_H */