kdebug.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef _S390_KDEBUG_H
  2. #define _S390_KDEBUG_H
  3. /*
  4. * Feb 2006 Ported to s390 <grundym@us.ibm.com>
  5. */
  6. #include <linux/notifier.h>
  7. struct pt_regs;
  8. struct die_args {
  9. struct pt_regs *regs;
  10. const char *str;
  11. long err;
  12. int trapnr;
  13. int signr;
  14. };
  15. /* Note - you should never unregister because that can race with NMIs.
  16. * If you really want to do it first unregister - then synchronize_sched
  17. * - then free.
  18. */
  19. extern int register_die_notifier(struct notifier_block *);
  20. extern int unregister_die_notifier(struct notifier_block *);
  21. extern int register_page_fault_notifier(struct notifier_block *);
  22. extern int unregister_page_fault_notifier(struct notifier_block *);
  23. extern struct atomic_notifier_head s390die_chain;
  24. enum die_val {
  25. DIE_OOPS = 1,
  26. DIE_BPT,
  27. DIE_SSTEP,
  28. DIE_PANIC,
  29. DIE_NMI,
  30. DIE_DIE,
  31. DIE_NMIWATCHDOG,
  32. DIE_KERNELDEBUG,
  33. DIE_TRAP,
  34. DIE_GPF,
  35. DIE_CALL,
  36. DIE_NMI_IPI,
  37. DIE_PAGE_FAULT,
  38. };
  39. static inline int notify_die(enum die_val val, const char *str,
  40. struct pt_regs *regs, long err, int trap, int sig)
  41. {
  42. struct die_args args = {
  43. .regs = regs,
  44. .str = str,
  45. .err = err,
  46. .trapnr = trap,
  47. .signr = sig
  48. };
  49. return atomic_notifier_call_chain(&s390die_chain, val, &args);
  50. }
  51. #endif