xref: /original-bsd/sys/vax/bi/kdbreg.h (revision baf24c0d)
1 /*
2  * Copyright (c) 1988 Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Chris Torek.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)kdbreg.h	7.3 (Berkeley) 06/28/90
11  */
12 
13 /*
14  * The KDB50 registers are embedded inside the bi interface
15  * general-purpose registers.
16  */
17 struct	kdb_regs {
18 	struct	biiregs kdb_bi;
19 	short	kdb_xxx;	/* first half of GPR 0 unused */
20 	short	kdb_ip;		/* initialisation and polling */
21 	short	kdb_sa;		/* status & address (r/o half) */
22 	short	kdb_sw;		/* status & address (w/o half) */
23 };
24 
25 /*
26  * Bits in KDB status register during initialisation
27  */
28 #define	KDB_ERR		0x8000	/* error */
29 #define	KDB_STEP4	0x4000	/* step 4 has started */
30 #define	KDB_STEP3	0x2000	/* step 3 has started */
31 #define	KDB_STEP2	0x1000	/* step 2 has started */
32 #define	KDB_STEP1	0x0800	/* step 1 has started */
33 #define	KDB_DI		0x0100	/* controller implements diagnostics */
34 #define	KDB_IE		0x0080	/* interrupt enable */
35 #define	KDB_NCNRMASK	0x003f	/* in STEP1, bits 0-2=NCMDL2, 3-5=NRSPL2 */
36 #define	KDB_IVECMASK	0x007f	/* in STEP2, bits 0-6 are interruptvec / 4 */
37 
38 /* after initialisation: */
39 #define	KDB_GO		0x0001	/* run */
40 
41 #define KDBSR_BITS \
42 "\20\20ERR\17STEP4\16STEP3\15STEP2\14STEP1\13oldNV\12oldQB\11DI\10IE\1GO"
43 
44 /*
45  * KDB Communications Area.  Note that this structure definition
46  * requires NRSP and NCMD to be defined already.
47  */
48 struct kdbca {
49 	short	ca_xxx1;	/* unused */
50 	char	ca_xxx2;	/* unused */
51 	char	ca_bdp;		/* BDP to purge  XXX */
52 	short	ca_cmdint;	/* command ring transition flag */
53 	short	ca_rspint;	/* response ring transition flag */
54 	long	ca_rspdsc[NRSP];/* response descriptors */
55 	long	ca_cmddsc[NCMD];/* command descriptors */
56 };
57 
58 /*
59  * Simplified routines (crash dump) use one command and one response.
60  */
61 struct kdb1ca {
62 	long	ca_xxx;
63 	short	ca_cmdint;
64 	short	ca_rspint;
65 	long	ca_rspdsc;
66 	long	ca_cmddsc;
67 };
68 
69 /*
70  * Asserting KDB_MAP in values placed in mscp_seq.seq_buffer tells
71  * the KDB to use mscp_seq.seq_mapbase as a set of PTEs and seq_buffer
72  * as an offset value.  Hence we need no mappings; the KDB50 reads
73  * the hardware page tables directly.  (Without KDB_MAP, seq_bufer
74  * represents the physical memory address instead, and seq_mapbase is
75  * unused.)
76  */
77 #define	KDB_MAP		0x80000000
78 #define	KDB_PHYS	0		/* pseudo flag */
79 
80 /*
81  * KDB statistics.
82  */
83 #define	KS_MAXC	32
84 
85 struct kdbstats {
86 	int	ks_sys;		/* transfers done from Sysmap */
87 	int	ks_paget;	/* transfers done from Usrptmap */
88 	int	ks_contig;	/* transfers done from contiguous user map */
89 	int	ks_copies;	/* transfers done from pte copies */
90 	int	ks_mapwait;	/* number of out-of-map waits */
91 	int	ks_cmd[KS_MAXC];/* commands started at once */
92 	int	ks_inval;	/* copies due to !PG_V */
93 };
94