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