[PATCH] [RFC] i386/i386_mainbus: fix the build when MPBIOS and ACPI are disabled

2024-04-24 Thread Paolo Pisati
In sys/arch/i386/i386/i386_mainbus.c::i386_mainbus_rescan() mp_pci_scan() is
only executed if:

...
if (npcibus == 0 && mpacpi_active)
npcibus = mp_pci_scan(self, &mba.mba_pba, pcibusprint);
if (npcibus == 0 && mpbios_scanned != 0)
npcibus = mp_pci_scan(self, &mba.mba_pba, pcibusprint);
...

hence follow the same condition during the unwind.

Signed-off-by: Paolo Pisati 
---
 sys/arch/i386/i386/i386_mainbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arch/i386/i386/i386_mainbus.c 
b/sys/arch/i386/i386/i386_mainbus.c
index f6d2f24a593a..2834002e5989 100644
--- a/sys/arch/i386/i386/i386_mainbus.c
+++ b/sys/arch/i386/i386/i386_mainbus.c
@@ -178,7 +178,7 @@ i386_mainbus_childdetached(device_t self, device_t child)
if (sc->sc_pci == child)
sc->sc_pci = NULL;
 
-#if NPCI > 0
+#if NPCI > 0 && (defined(ACPI_SCANPCI) || defined(MPBIOS_SCANPCI))
mp_pci_childdetached(self, child);
 #endif
 }
-- 
2.34.1



[PATCH] x86/intr.c: fix build if NO_PCI_MSI_MSIX is defined

2024-04-24 Thread Paolo Pisati
...
/home/flag/bsd/netbsd/src/sys/arch/x86/x86/intr.c: In function 
'intr_create_intrid':
/home/flag/bsd/netbsd/src/sys/arch/x86/x86/intr.c:315:34: error: 
'MSI_INT_DEV_MASK' undeclared (first use in this function)
  315 |   pih = __SHIFTIN((uint64_t)dev, MSI_INT_DEV_MASK)
  |  ^~~~
...

Signed-off-by: Paolo Pisati 
---
 sys/arch/x86/x86/intr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/arch/x86/x86/intr.c b/sys/arch/x86/x86/intr.c
index a94ea7f17707..beb3dab5673b 100644
--- a/sys/arch/x86/x86/intr.c
+++ b/sys/arch/x86/x86/intr.c
@@ -138,6 +138,7 @@ __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.167 2024/03/05 
20:58:05 andvar Exp $");
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
 #include "opt_acpi.h"
+#include "opt_pci.h"
 
 #include 
 #include 
-- 
2.34.1



Re: Creating a hackable kernel for AMD64

2024-04-24 Thread Emile `iMil' Heitor

On Tue, 23 Apr 2024, Taylor R Campbell wrote:


Cool, thanks!  The main thing you're trying to do -- pass a kernel on
the command line to qemu -- doesn't work on x86.


It does with these patches: 
https://github.com/NetBSDfr/NetBSD-src/tree/nbfr_master
They need to be reviewed before I merge them into current.

Cheers,


Emile `iMil' Heitor  | https://imil.net