summaryrefslogtreecommitdiff
path: root/sys/arch/i386/pci/pcibios.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2000-10-16 03:22:07 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2000-10-16 03:22:07 +0000
commita6cc64aa186e55eb9202907ea7f6928767796b23 (patch)
treefa5fc1f12f4ea01894538ef49ebb09ddb778aef4 /sys/arch/i386/pci/pcibios.c
parent3465db04ba1ba4b9d66a74e34d2f2014433f866b (diff)
a little verbosity on probe, a little caution on bios calls
Diffstat (limited to 'sys/arch/i386/pci/pcibios.c')
-rw-r--r--sys/arch/i386/pci/pcibios.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/sys/arch/i386/pci/pcibios.c b/sys/arch/i386/pci/pcibios.c
index 4fa9ba2b1a5..6076854a811 100644
--- a/sys/arch/i386/pci/pcibios.c
+++ b/sys/arch/i386/pci/pcibios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcibios.c,v 1.14 2000/09/22 02:00:43 mickey Exp $ */
+/* $OpenBSD: pcibios.c,v 1.15 2000/10/16 03:22:06 mickey Exp $ */
/* $NetBSD: pcibios.c,v 1.5 2000/08/01 05:23:59 uch Exp $ */
/*
@@ -170,12 +170,25 @@ pcibiosprobe(parent, match, aux)
{
struct bios_attach_args *ba = aux;
u_int32_t rev_maj, rev_min, mech1, mech2, scmech1, scmech2, maxbus;
+ int rv;
+
+ if (strcmp(ba->bios_dev, "pcibios"))
+ return 0;
+
+ rv = bios32_service(PCIBIOS_SIGNATURE, &pcibios_entry,
+ &pcibios_entry_info);
- return (!strcmp(ba->bios_dev, "pcibios") &&
- bios32_service(PCIBIOS_SIGNATURE, &pcibios_entry,
- &pcibios_entry_info) &&
+#ifdef PCIBIOSVERBOSE
+ printf("pcibiosprobe: 0x%lx:0x%lx at 0x%lx[0x%lx]\n",
+ pcibios_entry.segment,
+ pcibios_entry.offset,
+ pcibios_entry_info.bei_base,
+ pcibios_entry_info.bei_size);
+#endif
+
+ return rv &&
pcibios_get_status(NULL, &rev_maj, &rev_min, &mech1, &mech2,
- &scmech1, &scmech2, &maxbus) == PCIBIOS_SUCCESS);
+ &scmech1, &scmech2, &maxbus) == PCIBIOS_SUCCESS;
}
int pcibios_flags = -1;
@@ -370,11 +383,13 @@ pcibios_get_status(sc, rev_maj, rev_min, mech1, mech2, scmech1, scmech2, maxbus)
u_int32_t ax, bx, cx, edx;
int rv;
- __asm __volatile("pushl %%ds\n\t"
- "movl 4(%%edi), %%ecx\n\t"
+ __asm __volatile("pushl %%es\n\t"
+ "pushl %%ds\n\t"
+ "movw 4(%%edi), %%ecx\n\t"
"movl %%ecx, %%ds\n\t"
"lcall %%cs:(%%edi)\n\t"
"pop %%ds\n\t"
+ "pop %%es\n\t"
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
@@ -426,7 +441,7 @@ pcibios_get_intr_routing(sc, table, nentries, exclirq)
__asm __volatile("pushl %%es\n\t"
"pushl %%ds\n\t"
- "movl 4(%%esi), %%ecx\n\t"
+ "movw 4(%%esi), %%ecx\n\t"
"movl %%ecx, %%ds\n\t"
"lcall %%cs:(%%esi)\n\t"
"popl %%ds\n\t"