1122048Snyan/*-
2122048Snyan * Copyright (c) 1991 The Regents of the University of California.
3122048Snyan * All rights reserved.
4122048Snyan *
5122048Snyan * This code is derived from software contributed to Berkeley by
6122048Snyan * William Jolitz.
7122048Snyan *
8122048Snyan * Redistribution and use in source and binary forms, with or without
9122048Snyan * modification, are permitted provided that the following conditions
10122048Snyan * are met:
11122048Snyan * 1. Redistributions of source code must retain the above copyright
12122048Snyan *    notice, this list of conditions and the following disclaimer.
13122048Snyan * 2. Redistributions in binary form must reproduce the above copyright
14122048Snyan *    notice, this list of conditions and the following disclaimer in the
15122048Snyan *    documentation and/or other materials provided with the distribution.
16122048Snyan * 4. Neither the name of the University nor the names of its contributors
17122048Snyan *    may be used to endorse or promote products derived from this software
18122048Snyan *    without specific prior written permission.
19122048Snyan *
20122048Snyan * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21122048Snyan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22122048Snyan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23122048Snyan * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24122048Snyan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25122048Snyan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26122048Snyan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27122048Snyan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28122048Snyan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29122048Snyan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30122048Snyan * SUCH DAMAGE.
31122048Snyan *
32122048Snyan *	from: @(#)isa.c	7.2 (Berkeley) 5/13/91
33122048Snyan */
34122048Snyan
35122048Snyan#include <sys/cdefs.h>
36122048Snyan__FBSDID("$FreeBSD$");
37122048Snyan
38122048Snyan#include <sys/types.h>
39122048Snyan#include <sys/syslog.h>
40122048Snyan#include <sys/systm.h>
41122048Snyan
42122048Snyan#include <machine/md_var.h>
43122048Snyan
44122048Snyan#define NMI_PARITY 0x04
45122048Snyan#define NMI_EPARITY 0x02
46122048Snyan
47122048Snyan/*
48122048Snyan * Handle a NMI, possibly a machine check.
49122048Snyan * return true to panic system, false to ignore.
50122048Snyan */
51122048Snyanint
52122048Snyanisa_nmi(int cd)
53122048Snyan{
54122048Snyan	int retval = 0;
55122048Snyan 	int port = inb(0x33);
56122048Snyan
57122048Snyan	log(LOG_CRIT, "NMI PC98 port = %x\n", port);
58122048Snyan	if (port & NMI_PARITY) {
59122048Snyan		log(LOG_CRIT, "BASE RAM parity error, likely hardware failure.");
60122048Snyan		retval = 1;
61122048Snyan	} else if (port & NMI_EPARITY) {
62122048Snyan		log(LOG_CRIT, "EXTENDED RAM parity error, likely hardware failure.");
63122048Snyan		retval = 1;
64122048Snyan	} else {
65122048Snyan		log(LOG_CRIT, "\nNMI Resume ??\n");
66122048Snyan	}
67122048Snyan
68122048Snyan	return(retval);
69122048Snyan}
70