strstr.c was inadvertently blasted with a copy of isa_nmi.c. Revert
and remove clause 3 while I'm here.
This commit is contained in:
parent
7ab1926316
commit
59b34b3404
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=314448
@ -1,9 +1,9 @@
|
|||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1991 The Regents of the University of California.
|
* Copyright (c) 1990, 1993
|
||||||
* All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
* This code is derived from software contributed to Berkeley by
|
* This code is derived from software contributed to Berkeley by
|
||||||
* William Jolitz.
|
* Chris Torek.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@ -28,42 +28,32 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/param.h>
|
||||||
#include <sys/syslog.h>
|
#include <sys/libkern.h>
|
||||||
#include <sys/systm.h>
|
|
||||||
|
|
||||||
#include <machine/md_var.h>
|
|
||||||
|
|
||||||
#define NMI_PARITY 0x04
|
|
||||||
#define NMI_EPARITY 0x02
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle a NMI, possibly a machine check.
|
* Find the first occurrence of find in s.
|
||||||
* return true to panic system, false to ignore.
|
|
||||||
*/
|
*/
|
||||||
int
|
char *
|
||||||
isa_nmi(int cd)
|
strstr(const char *s, const char *find)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
char c, sc;
|
||||||
int port = inb(0x33);
|
size_t len;
|
||||||
|
|
||||||
log(LOG_CRIT, "NMI PC98 port = %x\n", port);
|
if ((c = *find++) != 0) {
|
||||||
if (port & NMI_PARITY) {
|
len = strlen(find);
|
||||||
log(LOG_CRIT, "BASE RAM parity error, likely hardware failure.");
|
do {
|
||||||
retval = 1;
|
do {
|
||||||
} else if (port & NMI_EPARITY) {
|
if ((sc = *s++) == 0)
|
||||||
log(LOG_CRIT, "EXTENDED RAM parity error, likely hardware failure.");
|
return (NULL);
|
||||||
retval = 1;
|
} while (sc != c);
|
||||||
} else {
|
} while (strncmp(s, find, len) != 0);
|
||||||
log(LOG_CRIT, "\nNMI Resume ??\n");
|
s--;
|
||||||
}
|
}
|
||||||
|
return (__DECONST(char *, s));
|
||||||
return(retval);
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user