xref: /csrg-svn/sys/vax/bi/kdbreg.h (revision 35041)
134293Skarels /*
2*35041Sbostic  * Copyright (c) 1988 Regents of the University of California.
3*35041Sbostic  * All rights reserved.
4*35041Sbostic  *
5*35041Sbostic  * This code is derived from software contributed to Berkeley by
6*35041Sbostic  * Chris Torek.
7*35041Sbostic  *
8*35041Sbostic  * Redistribution and use in source and binary forms are permitted
9*35041Sbostic  * provided that the above copyright notice and this paragraph are
10*35041Sbostic  * duplicated in all such forms and that any documentation,
11*35041Sbostic  * advertising materials, and other materials related to such
12*35041Sbostic  * distribution and use acknowledge that the software was developed
13*35041Sbostic  * by the University of California, Berkeley.  The name of the
14*35041Sbostic  * University may not be used to endorse or promote products derived
15*35041Sbostic  * from this software without specific prior written permission.
16*35041Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17*35041Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18*35041Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19*35041Sbostic  *
20*35041Sbostic  *	@(#)kdbreg.h	7.2 (Berkeley) 07/09/88
2134293Skarels  */
22*35041Sbostic 
2334293Skarels /*
2434293Skarels  * The KDB50 registers are embedded inside the bi interface
2534293Skarels  * general-purpose registers.
2634293Skarels  */
2734293Skarels struct	kdb_regs {
2834293Skarels 	struct	biiregs kdb_bi;
2934293Skarels 	short	kdb_xxx;	/* first half of GPR 0 unused */
3034293Skarels 	short	kdb_ip;		/* initialisation and polling */
3134293Skarels 	short	kdb_sa;		/* status & address (r/o half) */
3234293Skarels 	short	kdb_sw;		/* status & address (w/o half) */
3334293Skarels };
3434293Skarels 
3534293Skarels /*
3634293Skarels  * Bits in KDB status register during initialisation
3734293Skarels  */
3834293Skarels #define	KDB_ERR		0x8000	/* error */
3934293Skarels #define	KDB_STEP4	0x4000	/* step 4 has started */
4034293Skarels #define	KDB_STEP3	0x2000	/* step 3 has started */
4134293Skarels #define	KDB_STEP2	0x1000	/* step 2 has started */
4234293Skarels #define	KDB_STEP1	0x0800	/* step 1 has started */
4334293Skarels #define	KDB_DI		0x0100	/* controller implements diagnostics */
4434293Skarels #define	KDB_IE		0x0080	/* interrupt enable */
4534293Skarels #define	KDB_NCNRMASK	0x003f	/* in STEP1, bits 0-2=NCMDL2, 3-5=NRSPL2 */
4634293Skarels #define	KDB_IVECMASK	0x007f	/* in STEP2, bits 0-6 are interruptvec / 4 */
4734293Skarels 
4834293Skarels /* after initialisation: */
4934293Skarels #define	KDB_GO		0x0001	/* run */
5034293Skarels 
5134293Skarels #define KDBSR_BITS \
5234293Skarels "\20\20ERR\17STEP4\16STEP3\15STEP2\14STEP1\13oldNV\12oldQB\11DI\10IE\1GO"
5334293Skarels 
5434293Skarels /*
5534293Skarels  * KDB Communications Area.  Note that this structure definition
5634293Skarels  * requires NRSP and NCMD to be defined already.
5734293Skarels  */
5834293Skarels struct kdbca {
5934293Skarels 	short	ca_xxx1;	/* unused */
6034293Skarels 	char	ca_xxx2;	/* unused */
6134293Skarels 	char	ca_bdp;		/* BDP to purge  XXX */
6234293Skarels 	short	ca_cmdint;	/* command ring transition flag */
6334293Skarels 	short	ca_rspint;	/* response ring transition flag */
6434293Skarels 	long	ca_rspdsc[NRSP];/* response descriptors */
6534293Skarels 	long	ca_cmddsc[NCMD];/* command descriptors */
6634293Skarels };
6734293Skarels 
6834293Skarels /*
6934293Skarels  * Simplified routines (crash dump) use one command and one response.
7034293Skarels  */
7134293Skarels struct kdb1ca {
7234293Skarels 	long	ca_xxx;
7334293Skarels 	short	ca_cmdint;
7434293Skarels 	short	ca_rspint;
7534293Skarels 	long	ca_rspdsc;
7634293Skarels 	long	ca_cmddsc;
7734293Skarels };
7834293Skarels 
7934293Skarels /*
8034293Skarels  * Asserting KDB_MAP in values placed in mscp_seq.seq_buffer tells
8134293Skarels  * the KDB to use mscp_seq.seq_mapbase as a set of PTEs and seq_buffer
8234293Skarels  * as an offset value.  Hence we need no mappings; the KDB50 reads
8334293Skarels  * the hardware page tables directly.  (Without KDB_MAP, seq_bufer
8434293Skarels  * represents the physical memory address instead, and seq_mapbase is
8534293Skarels  * unused.)
8634293Skarels  */
8734293Skarels #define	KDB_MAP		0x80000000
8834293Skarels #define	KDB_PHYS	0		/* pseudo flag */
8934293Skarels 
9034293Skarels /*
9134293Skarels  * KDB statistics.
9234293Skarels  */
9334293Skarels #define	KS_MAXC	32
9434293Skarels 
9534293Skarels struct kdbstats {
9634293Skarels 	int	ks_sys;		/* transfers done from Sysmap */
9734293Skarels 	int	ks_paget;	/* transfers done from Usrptmap */
9834293Skarels 	int	ks_contig;	/* transfers done from contiguous user map */
9934293Skarels 	int	ks_copies;	/* transfers done from pte copies */
10034293Skarels 	int	ks_mapwait;	/* number of out-of-map waits */
10134293Skarels 	int	ks_cmd[KS_MAXC];/* commands started at once */
10234293Skarels 	int	ks_inval;	/* copies due to !PG_V */
10334293Skarels };
104