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