summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTobias Weingartner <weingart@cvs.openbsd.org>1997-04-17 17:21:17 +0000
committerTobias Weingartner <weingart@cvs.openbsd.org>1997-04-17 17:21:17 +0000
commitb190182f1bb6e444fe2da5c8a5d1dbdce4639336 (patch)
treed8df7031ddae72e3485e6f7b7066ef7f41a774cc /sys/arch
parent2215e440af2ece665afae8189b09bcd7b3bbe00a (diff)
New memprobe for weird machines... please test.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/stand/libsa/memprobe.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/arch/i386/stand/libsa/memprobe.c b/sys/arch/i386/stand/libsa/memprobe.c
index 4dc2ca6d85d..621e1526569 100644
--- a/sys/arch/i386/stand/libsa/memprobe.c
+++ b/sys/arch/i386/stand/libsa/memprobe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memprobe.c,v 1.4 1997/04/15 06:43:15 mickey Exp $ */
+/* $OpenBSD: memprobe.c,v 1.5 1997/04/17 17:21:16 weingart Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -47,7 +47,7 @@ memprobe()
/* probe extended memory
*
- * There is no need to do this in assembly language. This are
+ * There is no need to do this in assembly language. This is
* much easier to debug in C anyways.
*/
for(ram = 1024; ram < 512*1024; ram += 4){
@@ -64,6 +64,12 @@ memprobe()
*
* This is a hack, but it seems to work ok. Maybe this is
* the *real* way that you are supposed to do probing???
+ *
+ * Modify the original a bit. We write everything first, and
+ * then test for the values. This should croak on machines that
+ * return values just written on non-existent memory...
+ *
+ * BTW: These machines are pretty boken IMHO.
*/
static int addrprobe(int kloc){
volatile int *loc, i;
@@ -82,6 +88,16 @@ static int addrprobe(int kloc){
if(*loc != pat[i]) return(1);
}
+ /* Write address */
+ for(i = 0; i < sizeof(pat)/sizeof(pat[0]); i++){
+ loc[i] = pat[i];
+ }
+
+ /* Read address */
+ for(i = 0; i < sizeof(pat)/sizeof(pat[0]); i++){
+ if(loc[i] != pat[i]) return(1);
+ }
+
return(0);
}