Home | History | Annotate | Line # | Download | only in common
comlogout.c revision 1.2
      1 /* $NetBSD: comlogout.c,v 1.2 1999/02/12 06:32:12 thorpej 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.2 1999/02/12 06:32:12 thorpej 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/conf.h>
     42 #include <machine/bus.h>
     43 #include <machine/frame.h>
     44 #include <machine/cpuconf.h>
     45 #include <machine/logout.h>
     46 
     47 /*
     48  * Common PAL Logout Handling Code
     49  */
     50 
     51 /* (pretty much just structured console printout right now) */
     52 
     53 void
     54 ev5_logout_print(ev5lohdrp, mcucev5p)
     55 	mc_hdr_ev5 *ev5lohdrp;
     56 	mc_uc_ev5 *mcucev5p;
     57 {
     58 	int i;
     59 	static const char *fmt1 = "        %-30s = 0x%l016x\n";
     60 
     61 	printf("      Processor Machine Check (%x), Code 0x%lx\n",
     62 	    ALPHA_PROC_MCHECK, ev5lohdrp->mcheck_code);
     63 	/* Print PAL fields */
     64 	for (i = 0; i < 24; i += 2) {
     65 		printf("\tPAL temp[%d-%d]\t\t= 0x%16lx 0x%16lx\n", i, i+1,
     66 		    mcucev5p->paltemp[i], mcucev5p->paltemp[i+1]);
     67 	}
     68 	for (i = 0; i < 8; i += 2) {
     69 		printf("\tshadow[%d-%d]\t\t\t= 0x%16lx 0x%16lx\n", i, i+1,
     70 		    mcucev5p->shadow[i], mcucev5p->shadow[i+1]);
     71 	}
     72 	printf("\n");
     73 	printf(fmt1, "Excepting Instruction Addr", mcucev5p->exc_addr);
     74 	printf(fmt1, "Summary of arithmetic traps", mcucev5p->exc_sum);
     75 	printf(fmt1, "Exception mask", mcucev5p->exc_mask);
     76 	printf(fmt1, "Base address for PALcode", mcucev5p->pal_base);
     77 	printf(fmt1, "Interrupt Status Reg", mcucev5p->isr);
     78 	printf(fmt1, "Current setup of EV5 IBOX", mcucev5p->icsr);
     79 	printf(fmt1, (mcucev5p->ic_perr_stat & 0x800)?
     80 	       "I-CACHE Reg Data parity error" :
     81 	       "I-CACHE Reg Tag parity error", mcucev5p->ic_perr_stat);
     82 	printf(fmt1, "D-CACHE error Reg", mcucev5p->dc_perr_stat);
     83 
     84 	if (mcucev5p->dc_perr_stat & 0x2) {
     85 		switch (mcucev5p->dc_perr_stat & 0x3c) {
     86 		case 8:
     87 			printf("        %-40s\n", "Data error in bank 1");
     88 			break;
     89 		case 4:
     90 			printf("        %-40s\n", "Data error in bank 0");
     91 			break;
     92 		case 20:
     93 			printf("        %-40s\n", "Tag error in bank 1");
     94 			break;
     95 		case 10:
     96 			printf("        %-40s\n", "Tag error in bank 0");
     97 			break;
     98 		}
     99 	}
    100 	printf(fmt1, "Effective VA", mcucev5p->va);
    101 	printf(fmt1, "Reason for D-stream", mcucev5p->mm_stat);
    102 	printf(fmt1, "EV5 SCache address", mcucev5p->sc_addr);
    103 	printf(fmt1, "EV5 SCache TAG/Data parity", mcucev5p->sc_stat);
    104 	printf(fmt1, "EV5 BC_TAG_ADDR", mcucev5p->bc_tag_addr);
    105 	printf(fmt1, "EV5 EI_ADDR Phys addr of Xfer", mcucev5p->ei_addr);
    106 	printf(fmt1, "Fill Syndrome", mcucev5p->fill_syndrome);
    107 	printf(fmt1, "ei_stat reg", mcucev5p->ei_stat);
    108 	printf(fmt1, "ld_lock", mcucev5p->ld_lock);
    109 }
    110