kdebug.h 911 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _PPC64_KDEBUG_H
  2. #define _PPC64_KDEBUG_H 1
  3. /* nearly identical to x86_64/i386 code */
  4. #include <linux/notifier.h>
  5. struct pt_regs;
  6. struct die_args {
  7. struct pt_regs *regs;
  8. const char *str;
  9. long err;
  10. int trapnr;
  11. int signr;
  12. };
  13. /*
  14. Note - you should never unregister because that can race with NMIs.
  15. If you really want to do it first unregister - then synchronize_sched -
  16. then free.
  17. */
  18. int register_die_notifier(struct notifier_block *nb);
  19. extern struct notifier_block *ppc64_die_chain;
  20. /* Grossly misnamed. */
  21. enum die_val {
  22. DIE_OOPS = 1,
  23. DIE_IABR_MATCH,
  24. DIE_DABR_MATCH,
  25. DIE_BPT,
  26. DIE_SSTEP,
  27. DIE_GPF,
  28. DIE_PAGE_FAULT,
  29. };
  30. static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)
  31. {
  32. struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig };
  33. return notifier_call_chain(&ppc64_die_chain, val, &args);
  34. }
  35. #endif