home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / src / linux-headers-2.6.17-6 / include / asm-sparc64 / kdebug.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-08-11  |  966 b   |  50 lines

  1. #ifndef _SPARC64_KDEBUG_H
  2. #define _SPARC64_KDEBUG_H
  3.  
  4. /* Nearly identical to x86_64/i386 code. */
  5.  
  6. #include <linux/notifier.h>
  7.  
  8. struct pt_regs;
  9.  
  10. struct die_args {
  11.     struct pt_regs *regs;
  12.     const char *str;
  13.     long err;
  14.     int trapnr;
  15.     int signr;
  16. };
  17.  
  18. extern int register_die_notifier(struct notifier_block *);
  19. extern int unregister_die_notifier(struct notifier_block *);
  20. extern struct atomic_notifier_head sparc64die_chain;
  21.  
  22. extern void bad_trap(struct pt_regs *, long);
  23.  
  24. /* Grossly misnamed. */
  25. enum die_val {
  26.     DIE_OOPS = 1,
  27.     DIE_DEBUG,    /* ta 0x70 */
  28.     DIE_DEBUG_2,    /* ta 0x71 */
  29.     DIE_DIE,
  30.     DIE_TRAP,
  31.     DIE_TRAP_TL1,
  32.     DIE_GPF,
  33.     DIE_CALL,
  34.     DIE_PAGE_FAULT,
  35. };
  36.  
  37. static inline int notify_die(enum die_val val,char *str, struct pt_regs *regs,
  38.                  long err, int trap, int sig)
  39. {
  40.     struct die_args args = { .regs        = regs,
  41.                  .str        = str,
  42.                  .err        = err,
  43.                  .trapnr    = trap,
  44.                  .signr        = sig };
  45.  
  46.     return atomic_notifier_call_chain(&sparc64die_chain, val, &args);
  47. }
  48.  
  49. #endif
  50.