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 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the University of California, Berkeley. The name of the 14 * University may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * 20 * @(#)kdbreg.h 7.2 (Berkeley) 07/09/88 21 */ 22 23 /* 24 * The KDB50 registers are embedded inside the bi interface 25 * general-purpose registers. 26 */ 27 struct kdb_regs { 28 struct biiregs kdb_bi; 29 short kdb_xxx; /* first half of GPR 0 unused */ 30 short kdb_ip; /* initialisation and polling */ 31 short kdb_sa; /* status & address (r/o half) */ 32 short kdb_sw; /* status & address (w/o half) */ 33 }; 34 35 /* 36 * Bits in KDB status register during initialisation 37 */ 38 #define KDB_ERR 0x8000 /* error */ 39 #define KDB_STEP4 0x4000 /* step 4 has started */ 40 #define KDB_STEP3 0x2000 /* step 3 has started */ 41 #define KDB_STEP2 0x1000 /* step 2 has started */ 42 #define KDB_STEP1 0x0800 /* step 1 has started */ 43 #define KDB_DI 0x0100 /* controller implements diagnostics */ 44 #define KDB_IE 0x0080 /* interrupt enable */ 45 #define KDB_NCNRMASK 0x003f /* in STEP1, bits 0-2=NCMDL2, 3-5=NRSPL2 */ 46 #define KDB_IVECMASK 0x007f /* in STEP2, bits 0-6 are interruptvec / 4 */ 47 48 /* after initialisation: */ 49 #define KDB_GO 0x0001 /* run */ 50 51 #define KDBSR_BITS \ 52 "\20\20ERR\17STEP4\16STEP3\15STEP2\14STEP1\13oldNV\12oldQB\11DI\10IE\1GO" 53 54 /* 55 * KDB Communications Area. Note that this structure definition 56 * requires NRSP and NCMD to be defined already. 57 */ 58 struct kdbca { 59 short ca_xxx1; /* unused */ 60 char ca_xxx2; /* unused */ 61 char ca_bdp; /* BDP to purge XXX */ 62 short ca_cmdint; /* command ring transition flag */ 63 short ca_rspint; /* response ring transition flag */ 64 long ca_rspdsc[NRSP];/* response descriptors */ 65 long ca_cmddsc[NCMD];/* command descriptors */ 66 }; 67 68 /* 69 * Simplified routines (crash dump) use one command and one response. 70 */ 71 struct kdb1ca { 72 long ca_xxx; 73 short ca_cmdint; 74 short ca_rspint; 75 long ca_rspdsc; 76 long ca_cmddsc; 77 }; 78 79 /* 80 * Asserting KDB_MAP in values placed in mscp_seq.seq_buffer tells 81 * the KDB to use mscp_seq.seq_mapbase as a set of PTEs and seq_buffer 82 * as an offset value. Hence we need no mappings; the KDB50 reads 83 * the hardware page tables directly. (Without KDB_MAP, seq_bufer 84 * represents the physical memory address instead, and seq_mapbase is 85 * unused.) 86 */ 87 #define KDB_MAP 0x80000000 88 #define KDB_PHYS 0 /* pseudo flag */ 89 90 /* 91 * KDB statistics. 92 */ 93 #define KS_MAXC 32 94 95 struct kdbstats { 96 int ks_sys; /* transfers done from Sysmap */ 97 int ks_paget; /* transfers done from Usrptmap */ 98 int ks_contig; /* transfers done from contiguous user map */ 99 int ks_copies; /* transfers done from pte copies */ 100 int ks_mapwait; /* number of out-of-map waits */ 101 int ks_cmd[KS_MAXC];/* commands started at once */ 102 int ks_inval; /* copies due to !PG_V */ 103 }; 104