comlogout.c revision 1.1 1 1.1 mjacob /* $NetBSD: comlogout.c,v 1.1 1998/07/08 00:34:49 mjacob Exp $ */
2 1.1 mjacob /*
3 1.1 mjacob * Copyright (c) 1998 by Matthew Jacob
4 1.1 mjacob * NASA AMES Research Center.
5 1.1 mjacob * All rights reserved.
6 1.1 mjacob *
7 1.1 mjacob * Redistribution and use in source and binary forms, with or without
8 1.1 mjacob * modification, are permitted provided that the following conditions
9 1.1 mjacob * are met:
10 1.1 mjacob * 1. Redistributions of source code must retain the above copyright
11 1.1 mjacob * notice immediately at the beginning of the file, without modification,
12 1.1 mjacob * this list of conditions, and the following disclaimer.
13 1.1 mjacob * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 mjacob * notice, this list of conditions and the following disclaimer in the
15 1.1 mjacob * documentation and/or other materials provided with the distribution.
16 1.1 mjacob * 3. The name of the author may not be used to endorse or promote products
17 1.1 mjacob * derived from this software without specific prior written permission.
18 1.1 mjacob *
19 1.1 mjacob * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 1.1 mjacob * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.1 mjacob * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.1 mjacob * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
23 1.1 mjacob * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.1 mjacob * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.1 mjacob * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.1 mjacob * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.1 mjacob * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.1 mjacob * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.1 mjacob * SUCH DAMAGE.
30 1.1 mjacob */
31 1.1 mjacob
32 1.1 mjacob #include <sys/cdefs.h>
33 1.1 mjacob __KERNEL_RCSID(0, "$NetBSD: comlogout.c,v 1.1 1998/07/08 00:34:49 mjacob Exp $");
34 1.1 mjacob
35 1.1 mjacob #include <sys/param.h>
36 1.1 mjacob #include <sys/systm.h>
37 1.1 mjacob #include <sys/device.h>
38 1.1 mjacob
39 1.1 mjacob #include <machine/rpb.h>
40 1.1 mjacob #include <machine/autoconf.h>
41 1.1 mjacob #include <machine/conf.h>
42 1.1 mjacob #include <machine/bus.h>
43 1.1 mjacob #include <machine/frame.h>
44 1.1 mjacob #include <machine/cpuconf.h>
45 1.1 mjacob #include <machine/logout.h>
46 1.1 mjacob
47 1.1 mjacob /*
48 1.1 mjacob * Common PAL Logout Handling Code
49 1.1 mjacob */
50 1.1 mjacob
51 1.1 mjacob /* (pretty much just structured console printout right now) */
52 1.1 mjacob
53 1.1 mjacob void
54 1.1 mjacob ev5_logout_print(ev5lohdrp, mcucev5p)
55 1.1 mjacob mc_hdr_ev5 *ev5lohdrp;
56 1.1 mjacob mc_uc_ev5 *mcucev5p;
57 1.1 mjacob {
58 1.1 mjacob int i;
59 1.1 mjacob static const char *fmt1 = " %-30s = 0x%l016x\n";
60 1.1 mjacob
61 1.1 mjacob printf(" Processor Machine Check (%x), Code 0x%lx\n",
62 1.1 mjacob ALPHA_PROC_MCHECK, ev5lohdrp->mcheck_code);
63 1.1 mjacob /* Print PAL fields */
64 1.1 mjacob for (i = 0; i < 24; i += 2) {
65 1.1 mjacob printf("\tPAL temp[%d-%d]\t\t= 0x%l016x 0x%l016x\n", i, i+1,
66 1.1 mjacob mcucev5p->paltemp[i], mcucev5p->paltemp[i+1]);
67 1.1 mjacob }
68 1.1 mjacob for (i = 0; i < 8; i += 2) {
69 1.1 mjacob printf("\tshadow[%d-%d]\t\t\t= 0x%l016x 0x%l016x\n", i, i+1,
70 1.1 mjacob mcucev5p->shadow[i], mcucev5p->shadow[i+1]);
71 1.1 mjacob }
72 1.1 mjacob printf("\n");
73 1.1 mjacob printf(fmt1, "Excepting Instruction Addr", mcucev5p->exc_addr);
74 1.1 mjacob printf(fmt1, "Summary of arithmetic traps", mcucev5p->exc_sum);
75 1.1 mjacob printf(fmt1, "Exception mask", mcucev5p->exc_mask);
76 1.1 mjacob printf(fmt1, "Base address for PALcode", mcucev5p->pal_base);
77 1.1 mjacob printf(fmt1, "Interrupt Status Reg", mcucev5p->isr);
78 1.1 mjacob printf(fmt1, "Current setup of EV5 IBOX", mcucev5p->icsr);
79 1.1 mjacob printf(fmt1, (mcucev5p->ic_perr_stat & 0x800)?
80 1.1 mjacob "I-CACHE Reg Data parity error" :
81 1.1 mjacob "I-CACHE Reg Tag parity error", mcucev5p->ic_perr_stat);
82 1.1 mjacob printf(fmt1, "D-CACHE error Reg", mcucev5p->dc_perr_stat);
83 1.1 mjacob
84 1.1 mjacob if (mcucev5p->dc_perr_stat & 0x2) {
85 1.1 mjacob switch (mcucev5p->dc_perr_stat & 0x3c) {
86 1.1 mjacob case 8:
87 1.1 mjacob printf(" %-40s\n", "Data error in bank 1");
88 1.1 mjacob break;
89 1.1 mjacob case 4:
90 1.1 mjacob printf(" %-40s\n", "Data error in bank 0");
91 1.1 mjacob break;
92 1.1 mjacob case 20:
93 1.1 mjacob printf(" %-40s\n", "Tag error in bank 1");
94 1.1 mjacob break;
95 1.1 mjacob case 10:
96 1.1 mjacob printf(" %-40s\n", "Tag error in bank 0");
97 1.1 mjacob break;
98 1.1 mjacob }
99 1.1 mjacob }
100 1.1 mjacob printf(fmt1, "Effective VA", mcucev5p->va);
101 1.1 mjacob printf(fmt1, "Reason for D-stream", mcucev5p->mm_stat);
102 1.1 mjacob printf(fmt1, "EV5 SCache address", mcucev5p->sc_addr);
103 1.1 mjacob printf(fmt1, "EV5 SCache TAG/Data parity", mcucev5p->sc_stat);
104 1.1 mjacob printf(fmt1, "EV5 BC_TAG_ADDR", mcucev5p->bc_tag_addr);
105 1.1 mjacob printf(fmt1, "EV5 EI_ADDR Phys addr of Xfer", mcucev5p->ei_addr);
106 1.1 mjacob printf(fmt1, "Fill Syndrome", mcucev5p->fill_syndrome);
107 1.1 mjacob printf(fmt1, "ei_stat reg", mcucev5p->ei_stat);
108 1.1 mjacob printf(fmt1, "ld_lock", mcucev5p->ld_lock);
109 1.1 mjacob }
110