
/*
 * @(#)panic.h	1.1 (National Semiconductor) 8/4/87 13:39:22
 * @(#) copyrights and other release restrictions may apply
 */

/* Structure to hold interesting data collected during a panic.
 * Those fields flagged by an "#" are initialized at system startup time,
 * and are thus readable even before a crash.
 */
/* XXX */
/*
 * NOTE: many other routines use the panic structure to obtain and/or change
 * current system status.  the name panic is poor name.  the idea behind
 * the panic structure is to obtain via a fixed physical address (this too
 * is a crock) a collection of bytes which provide the status of system.
 * PANICADDR is set to the location of the panic structure at startup time.
 */

struct panic {
	long	ps_gen[8];	/* general registers r0 - r7 */
	long	ps_pc;		/* pc at time of panic */
	long	ps_psrmod;	/* psr and mod at time of panic */
	long	ps_sp;		/* stack pointer */
	long	ps_fp;		/* frame pointer */
	long	ps_intbase;	/* interrupt base */
	long	ps_ptb0;	/* mmu ptb0 register */
	long	ps_ptb1;	/* mmu ptb1 register */
	long	ps_msr;		/* mmu status register */
	long	ps_eia;		/* mmu eia register */
	long	ps_bpr0;	/* first mmu breakpoint register */
	long	ps_bpr1;	/* second mmu breakpoint register */
	long	ps_nest;	/* counter for nested panics */
	char	*ps_string;	/* address of panic string */
	long	*ps_args;	/* address of arguments to panic string */
	char	*ps_version;	/* # address of system version string */
	struct	proc *ps_proc;	/* # address of proc table */
	struct	spt *ps_spt;	/* # address of spt table */
	struct	msgbuf *ps_msgbuf;	/* # address of message buffer */
	short	ps_nproc;	/* # size of proc table */
	short	ps_nspt;	/* # size of spt table */
	long	options;	/* bit selectable options (see below) */
};


/* The following definition is never changed, and points to the panic block.
 * This particular address is always available because it is one of the
 * reserved words in the kernel's mod table.
 */

#define	PANICADDR	12	/* address of pointer to panic block */


/*
 * options - bit selectable options on the panic options structure element
 */
#define FLAVOR_OFF	0x0001	/* ^A console flavors disabled */
#define SAFE_FLAVOR 	0x0002	/* ^A console flavors except
				 * ^AS (Shutdown), ^AR (Reboot),
				 * ^A<DEL> (Kill current process)
				 * are enabled
				 */
#define FLAVOR_ON	0x0000  /* ^A console flavors enabled */
#define FLAVOR_MODE	0x0003	/* flavor state bits */
