summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2000-10-25 17:12:08 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2000-10-25 17:12:08 +0000
commit4cb052202a59a124c023337a8632ee4fc4c9bc4a (patch)
tree841d2e072571becdfd88152e2df1465dcbda2387 /sys/arch/i386
parent5d6c15ef4e2bbfec556cf7537790f524f02dcea3 (diff)
add pciprobe back into /boot.
it appears there are machines only equipped w/ real-mode pci bios. int time, we will benefit from this the other way around, -- we'll elliminate pci bios _calls_ in kernel instead.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/stand/boot/conf.c4
-rw-r--r--sys/arch/i386/stand/libsa/Makefile4
-rw-r--r--sys/arch/i386/stand/libsa/machdep.c4
-rw-r--r--sys/arch/i386/stand/libsa/pciprobe.c74
4 files changed, 80 insertions, 6 deletions
diff --git a/sys/arch/i386/stand/boot/conf.c b/sys/arch/i386/stand/boot/conf.c
index c3f07e89e36..b0932ced027 100644
--- a/sys/arch/i386/stand/boot/conf.c
+++ b/sys/arch/i386/stand/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.15 2000/10/19 17:15:26 fgsch Exp $ */
+/* $OpenBSD: conf.c,v 1.16 2000/10/25 17:11:58 mickey Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -48,7 +48,7 @@
#include <dev/cons.h>
#include <lib/libsa/exec.h>
-const char version[] = "1.25";
+const char version[] = "1.26";
int debug = 1;
const struct x_sw execsw[] = {
diff --git a/sys/arch/i386/stand/libsa/Makefile b/sys/arch/i386/stand/libsa/Makefile
index 678f616137d..0d568eeaa67 100644
--- a/sys/arch/i386/stand/libsa/Makefile
+++ b/sys/arch/i386/stand/libsa/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.37 2000/10/09 20:37:18 mickey Exp $
+# $OpenBSD: Makefile,v 1.38 2000/10/25 17:12:07 mickey Exp $
.include "${.CURDIR}/../Makefile.inc"
@@ -21,7 +21,7 @@ CLEANFILES+= gidt.o debug_i386.o alloca.o \
.else
SRCS+= gidt.S debug_i386.S alloca.S \
biosdev.c bioscons.c gateA20.c apmprobe.c \
- memprobe.c diskprobe.c smpprobe.c \
+ memprobe.c diskprobe.c pciprobe.c smpprobe.c \
time.c
CLEANFILES+= unixdev.o unixsys.o nullfs.o
.endif
diff --git a/sys/arch/i386/stand/libsa/machdep.c b/sys/arch/i386/stand/libsa/machdep.c
index 45b5c090f20..f9b013a2235 100644
--- a/sys/arch/i386/stand/libsa/machdep.c
+++ b/sys/arch/i386/stand/libsa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.29 2000/10/09 20:37:19 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.30 2000/10/25 17:12:07 mickey Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -59,7 +59,7 @@ machdep()
cninit(); CKPT('3');
#ifndef _TEST
apmprobe(); CKPT('4');
-/* pciprobe(); CKPT('5'); */
+ pciprobe(); CKPT('5');
/* smpprobe(); CKPT('6'); */
memprobe(); CKPT('7');
printf("\n");
diff --git a/sys/arch/i386/stand/libsa/pciprobe.c b/sys/arch/i386/stand/libsa/pciprobe.c
new file mode 100644
index 00000000000..b78f5cc1b5f
--- /dev/null
+++ b/sys/arch/i386/stand/libsa/pciprobe.c
@@ -0,0 +1,74 @@
+/* $OpenBSD: pciprobe.c,v 1.5 2000/10/25 17:12:07 mickey Exp $ */
+
+/*
+ * Copyright (c) 1997 Tobias Weingartner
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Tobias Weingartner.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <sys/param.h>
+#include <stand/boot/bootarg.h>
+#include <machine/biosvar.h>
+#include "libsa.h"
+
+#define PCI_SIG 0x20494350 /* PCI Signature */
+
+void
+pciprobe()
+{
+ bios_pciinfo_t bpi;
+ u_int32_t hw_chars, rev, rc, sig;
+ u_int32_t entry32;
+
+ /* PCI BIOS v2.0c+ - Installation Check */
+ __asm __volatile(DOINT(0x1A) ";shll $8,%2; setc %b2"
+ : "=a" (hw_chars), "=b" (rev), "=c" (rc),
+ "=d" (sig), "=D" (entry32)
+ : "0" (0xB101), "4" (0x0)
+ : "cc");
+
+ if (rc & 0xff00 || hw_chars & 0xff00)
+ return;
+ if (sig != PCI_SIG)
+ return;
+
+ printf(" pci");
+#ifdef DEBUG
+ printf("[V%d.%d, %x 0x%x %d]", (rev>>8)&0xFF, (rev&0xFF),
+ hw_chars, entry32, (rc>>8)&0xFF);
+#endif
+
+ bpi.pci_chars = hw_chars & 0xFFFF;
+ bpi.pci_rev = rev & 0xFFFF;
+ bpi.pci_entry32 = entry32;
+ bpi.pci_lastbus = (rc>>8) & 0xFF;
+
+ addbootarg(BOOTARG_PCIINFO, sizeof(bios_pciinfo_t), &bpi);
+}
+