kdebug.h 943 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef _ASM_POWERPC_KDEBUG_H
  2. #define _ASM_POWERPC_KDEBUG_H
  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 *powerpc_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_PAGE_FAULT,
  28. };
  29. static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)
  30. {
  31. struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig };
  32. return notifier_call_chain(&powerpc_die_chain, val, &args);
  33. }
  34. #endif /* _ASM_POWERPC_KDEBUG_H */