kdebug.h 985 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _ASM_POWERPC_KDEBUG_H
  2. #define _ASM_POWERPC_KDEBUG_H
  3. #ifdef __KERNEL__
  4. /* nearly identical to x86_64/i386 code */
  5. #include <linux/notifier.h>
  6. struct pt_regs;
  7. struct die_args {
  8. struct pt_regs *regs;
  9. const char *str;
  10. long err;
  11. int trapnr;
  12. int signr;
  13. };
  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. int register_die_notifier(struct notifier_block *nb);
  20. extern struct notifier_block *powerpc_die_chain;
  21. /* Grossly misnamed. */
  22. enum die_val {
  23. DIE_OOPS = 1,
  24. DIE_IABR_MATCH,
  25. DIE_DABR_MATCH,
  26. DIE_BPT,
  27. DIE_SSTEP,
  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(&powerpc_die_chain, val, &args);
  34. }
  35. #endif /* __KERNEL__ */
  36. #endif /* _ASM_POWERPC_KDEBUG_H */