Subject: Re: Today's current + mp_1
To: None <mjw@celos.net>
From: Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>
List: tech-smp
Date: 01/17/2002 06:56:15
Hi,

       From: Mark White <mjw@celos.net>
    Subject: Today's current + mp_1
      Date : Wed, 16 Jan 2002 15:44:59 +0000
 Message-ID: <20020116154459.B29091@celos.net>

$ /home/src/toolchain/bin/i386--netbsdelf-gcc  -ffreestanding  -O2 -Werror -Wall -Wno-main -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-uninitialized  -Di386 -I.  -I../../../../arch -I../../../.. -nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT   -c ../../../../uvm/uvm_vnode.c
$ /home/src/toolchain/bin/i386--netbsdelf-gcc  -ffreestanding  -O2 -Werror -Wall -Wno-main -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-uninitialized  -Di386 -I.  -I../../../../arch -I../../../.. -nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT   -c ../../../../arch/i386/i386/autoconf.c
$ ../../../../arch/i386/i386/autoconf.c: In function `device_register':
$ ../../../../arch/i386/i386/autoconf.c:516: structure has no member named `ia_iobase'
$ *** Error code 1
$ 
$ Stop.
$ make: stopped in /usr/src/sys/arch/i386/compile/ANDUIN
$ 
$ Probably it's one of those rollback situtations, but I don't
$ know which files to roll.  Suggestions?

I have met same problem.
I think sommerfeld_i386mp_1 branch need to sync with -current.

At least it need next patch for me.
How about next patch?

Regards!

PS.
    Under my i386mp box,"make build" works.
    But "make build NBUILDJOBS=4" failed when make tools.

---
 Masanori Kanaoka	kanaoka@ann.hi-ho.ne.jp

Index: i386/autoconf.c
===================================================================
RCS file: /ftp/cvs/syssrc/sys/arch/i386/i386/autoconf.c,v
retrieving revision 1.45.2.10
diff -u -r1.45.2.10 autoconf.c
--- i386/autoconf.c	2001/12/29 21:09:05	1.45.2.10
+++ i386/autoconf.c	2002/01/15 06:36:15
@@ -513,7 +513,8 @@
 			struct isa_attach_args *iaa = aux;
 
 			/* compare IO base address */
-			if (bin->addr.iobase == iaa->ia_iobase)
+			if (iaa->ia_nio > 0 &&
+			    bin->addr.iobase == iaa->ia_io[0].ir_addr)
 				goto found;
 		}
 #if NPCI > 0
Index: isa/npx_isa.c
===================================================================
RCS file: /ftp/cvs/syssrc/sys/arch/i386/isa/npx_isa.c,v
retrieving revision 1.1.6.2
diff -u -r1.1.6.2 npx_isa.c
--- isa/npx_isa.c	2001/12/29 21:09:10	1.1.6.2
+++ isa/npx_isa.c	2002/01/15 06:44:10
@@ -68,25 +68,43 @@
 	bus_space_handle_t ioh;
 	enum npx_type result;
 
-	ia->ia_iosize = 16;
-	ia->ia_msize = 0;
+	if (ia->ia_nio < 1)
+		return (0);
+	if (ia->ia_nirq < 1)
+		return (0);
+
+	if (ISA_DIRECT_CONFIG(ia))
+		return (0);
 
-	if (bus_space_map(ia->ia_iot, 0xf0, ia->ia_iosize, 0, &ioh) != 0)
+	if (bus_space_map(ia->ia_iot, 0xf0, 16, 0, &ioh) != 0)
 		return (0);
 
-	result = npxprobe1(ia->ia_iot, ioh, ia->ia_irq);
-	if (result != NPX_INTERRUPT)
-		ia->ia_irq = IRQUNK;	/* zap the interrupt */
-
-	bus_space_unmap(ia->ia_iot, ioh, ia->ia_iosize);
-
-	/*
-	 * Remember our result -- we don't want to have to npxprobe1()
-	 * again (especially if we've zapped the IRQ).
-	 */
-	ia->ia_aux = (void *)(u_long)result;
+	result = npxprobe1(ia->ia_iot, ioh, ia->ia_irq[0].ir_irq);
+
+	bus_space_unmap(ia->ia_iot, ioh, 16);
+
+	if (result != NPX_NONE) {
+		/*
+		 * Remember our result -- we don't want to have to npxprobe1()
+		 * again (especially if we've zapped the IRQ).
+		 */
+		ia->ia_aux = (void *)(u_long)result;
+
+		ia->ia_nio = 1;
+		ia->ia_io[0].ir_addr = 0xf0;
+		ia->ia_io[0].ir_size = 16;
+
+		if (result != NPX_INTERRUPT)
+			ia->ia_nirq = 0;	/* zap the interrupt */
+		else
+			ia->ia_nirq = 1;
+
+		ia->ia_niomem = 0;
+		ia->ia_ndrq = 0;
+		return (1);
+	}
 
-	return (result != NPX_NONE);
+	return (0);
 }
 
 void
@@ -97,7 +115,7 @@
 
 	sc->sc_iot = ia->ia_iot;
 
-	if (bus_space_map(sc->sc_iot, 0xf0, ia->ia_iosize, 0, &sc->sc_ioh)) {
+	if (bus_space_map(sc->sc_iot, 0xf0, 16, 0, &sc->sc_ioh)) {
 		printf("\n");
 		panic("npxattach: unable to map I/O space");
 	}
@@ -108,7 +126,7 @@
 	case NPX_INTERRUPT:
 		printf("\n");
 		lcr0(rcr0() & ~CR0_NE);
-		sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq,
+		sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq,
 		    IST_EDGE, IPL_NONE, npxintr, 0);
 		break;
 	case NPX_EXCEPTION: