From a0f0f74348ab2bf34562e82997aec918448c6dd0 Mon Sep 17 00:00:00 2001 From: itohy Date: Wed, 29 Aug 2001 14:14:33 +0000 Subject: [PATCH] Print extra information on machine check (AS500, AS600). --- sys/arch/alpha/alpha/dec_kn20aa.c | 64 ++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/sys/arch/alpha/alpha/dec_kn20aa.c b/sys/arch/alpha/alpha/dec_kn20aa.c index e5b47ddb9282..6040492d6d40 100644 --- a/sys/arch/alpha/alpha/dec_kn20aa.c +++ b/sys/arch/alpha/alpha/dec_kn20aa.c @@ -1,4 +1,4 @@ -/* $NetBSD: dec_kn20aa.c,v 1.47 2001/06/05 04:53:12 thorpej Exp $ */ +/* $NetBSD: dec_kn20aa.c,v 1.48 2001/08/29 14:14:33 itohy Exp $ */ /* * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University. @@ -34,7 +34,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: dec_kn20aa.c,v 1.47 2001/06/05 04:53:12 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dec_kn20aa.c,v 1.48 2001/08/29 14:14:33 itohy Exp $"); #include #include @@ -46,6 +46,8 @@ __KERNEL_RCSID(0, "$NetBSD: dec_kn20aa.c,v 1.47 2001/06/05 04:53:12 thorpej Exp #include #include #include +#include +#include #include #include @@ -75,6 +77,12 @@ void dec_kn20aa_init __P((void)); static void dec_kn20aa_cons_init __P((void)); static void dec_kn20aa_device_register __P((struct device *, void *)); +static void dec_kn20aa_mcheck_handler + __P((unsigned long, struct trapframe *, unsigned long, unsigned long)); + +static void dec_kn20aa_mcheck __P((unsigned long, unsigned long, + unsigned long, struct trapframe *)); + #ifdef KGDB #include @@ -106,6 +114,7 @@ dec_kn20aa_init() platform.iobus = "cia"; platform.cons_init = dec_kn20aa_cons_init; platform.device_register = dec_kn20aa_device_register; + platform.mcheck_handler = dec_kn20aa_mcheck_handler; } static void @@ -289,3 +298,54 @@ dec_kn20aa_device_register(dev, aux) } } } + +static void +dec_kn20aa_mcheck(mces, type, logout, framep) + unsigned long mces; + unsigned long type; + unsigned long logout; + struct trapframe *framep; +{ + struct mchkinfo *mcp; + mc_hdr_ev5 *hdr; + mc_uc_ev5 *mptr; + + /* + * If we expected a machine check, just go handle it in common code. + */ + mcp = &curcpu()->ci_mcinfo; + if (mcp->mc_expected) { + machine_check(mces, framep, type, logout); + return; + } + + hdr = (mc_hdr_ev5 *) logout; + mptr = (mc_uc_ev5 *) (logout + sizeof (*hdr)); + + /* + * Now we can finally print some stuff... + */ + ev5_logout_print(hdr, mptr); + + machine_check(mces, framep, type, logout); +} + +static void +dec_kn20aa_mcheck_handler(mces, framep, vector, param) + unsigned long mces; + struct trapframe *framep; + unsigned long vector; + unsigned long param; +{ + + switch (vector) { + case ALPHA_SYS_MCHECK: + case ALPHA_PROC_MCHECK: + dec_kn20aa_mcheck(mces, vector, param, framep); + break; + default: + printf("KN20AA_MCHECK: unknown check vector 0x%lx\n", vector); + machine_check(mces, framep, vector, param); + break; + } +}