kdebug.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef _SPARC64_KDEBUG_H
  2. #define _SPARC64_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. /* Note - you should never unregister because that can race with NMIs.
  14. * If you really want to do it first unregister - then synchronize_sched
  15. * - then free.
  16. */
  17. int register_die_notifier(struct notifier_block *nb);
  18. extern struct notifier_block *sparc64die_chain;
  19. extern void bad_trap(struct pt_regs *, long);
  20. /* Grossly misnamed. */
  21. enum die_val {
  22. DIE_OOPS = 1,
  23. DIE_DEBUG, /* ta 0x70 */
  24. DIE_DEBUG_2, /* ta 0x71 */
  25. DIE_DIE,
  26. DIE_TRAP,
  27. DIE_TRAP_TL1,
  28. DIE_GPF,
  29. DIE_CALL,
  30. DIE_PAGE_FAULT,
  31. };
  32. static inline int notify_die(enum die_val val,char *str, struct pt_regs *regs,
  33. long err, int trap, int sig)
  34. {
  35. struct die_args args = { .regs = regs,
  36. .str = str,
  37. .err = err,
  38. .trapnr = trap,
  39. .signr = sig };
  40. return notifier_call_chain(&sparc64die_chain, val, &args);
  41. }
  42. #endif