From 860234e8477849e80921da12a4ca79bb3e7e7d88 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 24 Jul 2023 14:02:36 +0000 Subject: [PATCH] after the boot block changes on i386, sthen noticed a dmesg change -pci0 at mainbus0 bus 0: configuration mode 1 (bios) +pci0 at mainbus0 bus 0: configuration mode 1 (no bios) deraadt then spent many hours narrowing down the problem to the inline assembly in pciprobe(). It tried to save the carry flag result of pci bios present. But did so after a shift which sets the carry flag. Ask for CF in the output and avoid the shift. ok deraadt@ kettenis@ --- sys/arch/i386/stand/libsa/pciprobe.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/arch/i386/stand/libsa/pciprobe.c b/sys/arch/i386/stand/libsa/pciprobe.c index 9854aa4cb5b..46c0117aa64 100644 --- a/sys/arch/i386/stand/libsa/pciprobe.c +++ b/sys/arch/i386/stand/libsa/pciprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pciprobe.c,v 1.10 2014/03/29 18:09:29 guenther Exp $ */ +/* $OpenBSD: pciprobe.c,v 1.11 2023/07/24 14:02:36 jsg Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -39,12 +39,12 @@ pciprobe(void) { bios_pciinfo_t bpi; u_int32_t hw_chars, rev, rc, sig; - u_int32_t entry32; + u_int32_t entry32, lastbus; /* 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) + __asm volatile(DOINT(0x1A) + : "=a" (hw_chars), "=b" (rev), "=c" (lastbus), + "=d" (sig), "=D" (entry32), "=@ccc" (rc) : "0" (0xB101), "4" (0x0) : "cc"); @@ -62,7 +62,7 @@ pciprobe(void) bpi.pci_chars = hw_chars & 0xFFFF; bpi.pci_rev = rev & 0xFFFF; bpi.pci_entry32 = entry32; - bpi.pci_lastbus = (rc>>8) & 0xFF; + bpi.pci_lastbus = lastbus & 0xFF; addbootarg(BOOTARG_PCIINFO, sizeof(bios_pciinfo_t), &bpi); } -- 2.20.1