kdebug.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. extern int register_die_notifier(struct notifier_block *);
  15. extern int unregister_die_notifier(struct notifier_block *);
  16. /*
  17. * These are only here because kprobes.c wants them to implement a
  18. * blatant layering violation. Will hopefully go away soon once all
  19. * architectures are updated.
  20. */
  21. static inline int register_page_fault_notifier(struct notifier_block *nb)
  22. {
  23. return 0;
  24. }
  25. static inline int unregister_page_fault_notifier(struct notifier_block *nb)
  26. {
  27. return 0;
  28. }
  29. extern struct atomic_notifier_head powerpc_die_chain;
  30. /* Grossly misnamed. */
  31. enum die_val {
  32. DIE_OOPS = 1,
  33. DIE_IABR_MATCH,
  34. DIE_DABR_MATCH,
  35. DIE_BPT,
  36. DIE_SSTEP,
  37. };
  38. static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)
  39. {
  40. struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig };
  41. return atomic_notifier_call_chain(&powerpc_die_chain, val, &args);
  42. }
  43. #endif /* __KERNEL__ */
  44. #endif /* _ASM_POWERPC_KDEBUG_H */