kdebug.h 966 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. extern int register_die_notifier(struct notifier_block *);
  14. extern int unregister_die_notifier(struct notifier_block *);
  15. extern struct atomic_notifier_head sparc64die_chain;
  16. extern void bad_trap(struct pt_regs *, long);
  17. /* Grossly misnamed. */
  18. enum die_val {
  19. DIE_OOPS = 1,
  20. DIE_DEBUG, /* ta 0x70 */
  21. DIE_DEBUG_2, /* ta 0x71 */
  22. DIE_DIE,
  23. DIE_TRAP,
  24. DIE_TRAP_TL1,
  25. DIE_GPF,
  26. DIE_CALL,
  27. DIE_PAGE_FAULT,
  28. };
  29. static inline int notify_die(enum die_val val,char *str, struct pt_regs *regs,
  30. long err, int trap, int sig)
  31. {
  32. struct die_args args = { .regs = regs,
  33. .str = str,
  34. .err = err,
  35. .trapnr = trap,
  36. .signr = sig };
  37. return atomic_notifier_call_chain(&sparc64die_chain, val, &args);
  38. }
  39. #endif