#ifndef _SPARC_CRASH_H_7c635f9d_
#define _SPARC_CRASH_H_7c635f9d_

#define KAC_NARGS 6
#define KAC_MAXCALLS 10

struct _sparc_crashinfo {
  int type;
#define CI_NULL      0 /* nothing here yet */
#define CI_ARITHTRAP 1 /* arithmetic trap/fault */
#define CI_ILLINST   2 /* illegal/reserved instruction */
#define CI_TRACE     3 /* trace trap */
#define CI_MEMFAULT  4 /* memory fault */
#define CI_FRAMEFAULT 5 /* stack frame error */
  int pc;
  int npc;
  int psr;
  union {
    int subtype; /* CI_ARITHTRAP, CI_ILLINST */
/* CI_ARITHTRAP: arithmetic traps */
#define CI_AT_IDIVZ    1 /* integer divide-by-zero */
#define CI_AT_FINEXACT 2 /* floating inexact */
#define CI_AT_FDIVZ    3 /* floating divide-by-zero */
#define CI_AT_FUNDERF  4 /* floating underflow */
#define CI_AT_FOPERAND 5 /* operand error */
#define CI_AT_FOVERF   6 /* floating overflow */
#define CI_AT_BOUNDS   7 /* bounds check failed */
#define CI_AT_OVERFTRAP 8 /* general overflow trap */
#define CI_AT_FDISABLED 9 /* floating point disabled */
#define CI_AT_FERROR  10 /* general floating point exception */
/* CI_ILLINST: illegal instructions */
#define CI_II_UNIMP   1 /* unimplemented instruction */
#define CI_II_PRIV    2 /* privileged instruction */
#define CI_II_SYSCALL 3 /* syscall */
#define CI_II_COPROT  4 /* co-processor protocal fault */
    /* nothing extra for CI_TRACE */
    struct {		/* CI_MEMFAULT */
      int addr; /* address */
      int be; /* bus error bits */
      } memfault;
    } un;
  unsigned long int registers[19];
  struct _sparc_crashframe {
    int pc;
    unsigned char flags;
#define CI_CF_VALID 0x01
    unsigned long int args[KAC_NARGS];
    } callstack[KAC_MAXCALLS];
  } ;

typedef struct _sparc_crashinfo CRASHINFO;
typedef struct _sparc_crashframe CRASHFRAME;

#endif
