PERFORCE change 42366 for review

Peter Wemm peter at FreeBSD.org
Fri Nov 14 11:43:43 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=42366

Change 42366 by peter at peter_daintree on 2003/11/14 11:43:00

	IFC @42364

Affected files ...

.. //depot/projects/hammer/include/ifaddrs.h#2 integrate
.. //depot/projects/hammer/lib/libc/net/Makefile.inc#6 integrate
.. //depot/projects/hammer/lib/libc/net/getifmaddrs.3#1 branch
.. //depot/projects/hammer/lib/libc/net/getifmaddrs.c#1 branch
.. //depot/projects/hammer/sys/dev/an/if_an.c#12 integrate
.. //depot/projects/hammer/sys/dev/an/if_anreg.h#5 integrate
.. //depot/projects/hammer/sys/dev/bfe/if_bfe.c#3 integrate
.. //depot/projects/hammer/sys/dev/my/if_my.c#10 integrate
.. //depot/projects/hammer/sys/dev/owi/if_owi.c#3 integrate
.. //depot/projects/hammer/sys/dev/owi/if_wivar.h#2 integrate
.. //depot/projects/hammer/sys/dev/re/if_re.c#7 integrate
.. //depot/projects/hammer/sys/dev/wl/if_wl.c#8 integrate
.. //depot/projects/hammer/sys/i386/i386/apic_vector.s#4 integrate
.. //depot/projects/hammer/sys/i386/i386/local_apic.c#3 integrate
.. //depot/projects/hammer/sys/i386/i386/machdep.c#26 integrate
.. //depot/projects/hammer/sys/i386/include/apicvar.h#4 integrate
.. //depot/projects/hammer/sys/i386/include/intr_machdep.h#2 integrate
.. //depot/projects/hammer/sys/i386/isa/atpic.c#4 integrate
.. //depot/projects/hammer/sys/i386/isa/icu.h#4 integrate
.. //depot/projects/hammer/sys/kern/kern_event.c#11 integrate
.. //depot/projects/hammer/sys/kern/kern_exit.c#16 integrate
.. //depot/projects/hammer/sys/net/rtsock.c#8 integrate
.. //depot/projects/hammer/sys/pci/if_dc.c#26 integrate
.. //depot/projects/hammer/sys/pci/if_dcreg.h#12 integrate
.. //depot/projects/hammer/sys/pci/if_pcn.c#13 integrate
.. //depot/projects/hammer/sys/pci/if_pcnreg.h#2 integrate
.. //depot/projects/hammer/sys/pci/if_rl.c#22 integrate
.. //depot/projects/hammer/sys/pci/if_rlreg.h#8 integrate
.. //depot/projects/hammer/sys/pci/if_sf.c#14 integrate
.. //depot/projects/hammer/sys/pci/if_sfreg.h#2 integrate
.. //depot/projects/hammer/sys/pci/if_sis.c#18 integrate
.. //depot/projects/hammer/sys/pci/if_sisreg.h#5 integrate
.. //depot/projects/hammer/sys/pci/if_sk.c#16 integrate
.. //depot/projects/hammer/sys/pci/if_skreg.h#5 integrate
.. //depot/projects/hammer/sys/pci/if_ste.c#14 integrate
.. //depot/projects/hammer/sys/pci/if_stereg.h#4 integrate
.. //depot/projects/hammer/sys/pci/if_ti.c#15 integrate
.. //depot/projects/hammer/sys/pci/if_tireg.h#3 integrate
.. //depot/projects/hammer/sys/pci/if_tl.c#12 integrate
.. //depot/projects/hammer/sys/pci/if_tlreg.h#3 integrate
.. //depot/projects/hammer/sys/pci/if_vr.c#13 integrate
.. //depot/projects/hammer/sys/pci/if_vrreg.h#4 integrate
.. //depot/projects/hammer/sys/pci/if_wb.c#13 integrate
.. //depot/projects/hammer/sys/pci/if_wbreg.h#2 integrate
.. //depot/projects/hammer/sys/pci/if_xl.c#27 integrate
.. //depot/projects/hammer/sys/pci/if_xlreg.h#8 integrate
.. //depot/projects/hammer/sys/sys/socket.h#6 integrate

Differences ...

==== //depot/projects/hammer/include/ifaddrs.h#2 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/include/ifaddrs.h,v 1.2 2002/03/23 17:24:53 imp Exp $	*/
+/*	$FreeBSD: src/include/ifaddrs.h,v 1.3 2003/11/14 18:53:22 bms Exp $	*/
 
 /*
  * Copyright (c) 1995, 1999
@@ -46,11 +46,20 @@
 #define	ifa_broadaddr	ifa_dstaddr	/* broadcast address interface */
 #endif
 
+struct ifmaddrs {
+	struct ifmaddrs	*ifma_next;
+	struct sockaddr	*ifma_name;
+	struct sockaddr	*ifma_addr;
+	struct sockaddr	*ifma_lladdr;
+};
+
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
 extern int getifaddrs(struct ifaddrs **);
 extern void freeifaddrs(struct ifaddrs *);
+extern int getifmaddrs(struct ifmaddrs **);
+extern void freeifmaddrs(struct ifmaddrs *);
 __END_DECLS
 
 #endif

==== //depot/projects/hammer/lib/libc/net/Makefile.inc#6 (text+ko) ====

@@ -1,12 +1,12 @@
 #	from @(#)Makefile.inc	8.2 (Berkeley) 9/5/93
-# $FreeBSD: src/lib/libc/net/Makefile.inc,v 1.49 2003/10/24 18:26:28 ume Exp $
+# $FreeBSD: src/lib/libc/net/Makefile.inc,v 1.50 2003/11/14 18:53:22 bms Exp $
 
 # machine-independent net sources
 .PATH: ${.CURDIR}/${MACHINE_ARCH}/net ${.CURDIR}/net
 
 SRCS+=	addr2ascii.c ascii2addr.c base64.c ether_addr.c getaddrinfo.c \
 	gethostbydns.c gethostbyht.c gethostbynis.c gethostnamadr.c \
-	getifaddrs.c getnameinfo.c \
+	getifaddrs.c getifmaddrs.c getnameinfo.c \
 	getnetbydns.c getnetbyht.c getnetbynis.c getnetnamadr.c \
 	getproto.c getprotoent.c getprotoname.c getservbyname.c \
 	getservbyport.c getservent.c herror.c hesiod.c inet_addr.c \
@@ -40,7 +40,7 @@
 .endif
 
 MAN+=	addr2ascii.3 byteorder.3 ethers.3 getaddrinfo.3 gethostbyname.3 \
-	getifaddrs.3 getipnodebyname.3 \
+	getifaddrs.3 getifmaddrs.3 getipnodebyname.3 \
 	getnameinfo.3 getnetent.3 getprotoent.3 getservent.3 hesiod.3 \
 	if_indextoname.3 \
 	inet.3 inet_net.3 \
@@ -59,6 +59,7 @@
 	gethostbyname.3 herror.3 gethostbyname.3 hstrerror.3 \
 	gethostbyname.3 sethostent.3
 MLINKS+=getifaddrs.3 freeifaddrs.3
+MLINKS+=getifmaddrs.3 freeifmaddrs.3
 MLINKS+=getipnodebyname.3 getipnodebyaddr.3 getipnodebyname.3 freehostent.3
 MLINKS+=getnetent.3 endnetent.3 getnetent.3 getnetbyaddr.3 \
 	getnetent.3 getnetbyname.3 getnetent.3 setnetent.3

==== //depot/projects/hammer/sys/dev/an/if_an.c#12 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/an/if_an.c,v 1.55 2003/10/31 18:31:56 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/an/if_an.c,v 1.56 2003/11/14 19:00:29 sam Exp $");
 
 /*
  * The Aironet 4500/4800 series cards come in PCMCIA, ISA and PCI form.
@@ -833,6 +833,8 @@
 	struct an_card_rx_desc an_rx_desc;
 	u_int8_t	*buf;
 
+	AN_LOCK_ASSERT(sc);
+
 	ifp = &sc->arpcom.ac_if;
 
 	if (!sc->mpi350) {
@@ -981,7 +983,9 @@
 				rx_frame.an_rx_signal_strength,
 				rx_frame.an_rsvd0);
 #endif
+			AN_UNLOCK(sc);
 			(*ifp->if_input)(ifp, m);
+			AN_LOCK(sc);
 		}
 
 	} else { /* MPI-350 */

==== //depot/projects/hammer/sys/dev/an/if_anreg.h#5 (text+ko) ====

@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/an/if_anreg.h,v 1.19 2003/08/24 17:48:04 obrien Exp $
+ * $FreeBSD: src/sys/dev/an/if_anreg.h,v 1.20 2003/11/14 19:00:30 sam Exp $
  */
 
 #define AN_TIMEOUT	65536
@@ -502,6 +502,7 @@
 
 #define AN_LOCK(_sc)		mtx_lock(&(_sc)->an_mtx)
 #define AN_UNLOCK(_sc)		mtx_unlock(&(_sc)->an_mtx)
+#define AN_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->an_mtx, MA_OWNED)
 
 void	an_release_resources	(device_t);
 int	an_alloc_port		(device_t, int, int);

==== //depot/projects/hammer/sys/dev/bfe/if_bfe.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
 
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bfe/if_bfe.c,v 1.3 2003/10/31 18:31:57 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bfe/if_bfe.c,v 1.4 2003/11/14 19:00:30 sam Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1153,7 +1153,9 @@
 
 		ifp->if_ipackets++;
 		m->m_pkthdr.rcvif = ifp;
+		BFE_UNLOCK(sc);
 		(*ifp->if_input)(ifp, m);
+		BFE_LOCK(sc);
 
         BFE_INC(cons, BFE_RX_LIST_CNT);
 	}

==== //depot/projects/hammer/sys/dev/my/if_my.c#10 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/my/if_my.c,v 1.20 2003/11/13 20:55:49 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/my/if_my.c,v 1.21 2003/11/14 19:00:30 sam Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1277,7 +1277,9 @@
 			}
 		}
 #endif
+		MY_UNLOCK(sc);
 		(*ifp->if_input)(ifp, m);
+		MY_LOCK(sc);
 	}
 	MY_UNLOCK(sc);
 	return;

==== //depot/projects/hammer/sys/dev/owi/if_owi.c#3 (text+ko) ====

@@ -100,7 +100,7 @@
 
 #if !defined(lint)
 static const char rcsid[] =
-  "$FreeBSD: src/sys/dev/owi/if_owi.c,v 1.2 2003/10/14 05:25:31 imp Exp $";
+  "$FreeBSD: src/sys/dev/owi/if_owi.c,v 1.3 2003/11/14 19:00:30 sam Exp $";
 #endif
 
 static void wi_intr(void *);
@@ -449,6 +449,8 @@
 	struct mbuf		*m;
 	int			id;
 
+	WI_LOCK_ASSERT(sc);
+
 	ifp = &sc->arpcom.ac_if;
 
 	id = CSR_READ_2(sc, WI_RX_FID);
@@ -650,7 +652,9 @@
 #ifdef WICACHE
 		wi_cache_store(sc, eh, m, rx_frame.wi_q_info);
 #endif  
+		WI_UNLOCK(sc);
 		(*ifp->if_input)(ifp, m);
+		WI_LOCK(sc);
 	}
 }
 

==== //depot/projects/hammer/sys/dev/owi/if_wivar.h#2 (text+ko) ====

@@ -31,7 +31,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/owi/if_wivar.h,v 1.1 2003/08/24 05:42:49 imp Exp $
+ * $FreeBSD: src/sys/dev/owi/if_wivar.h,v 1.2 2003/11/14 19:00:30 sam Exp $
  */
 
 #define WICACHE			/* turn on signal strength cache code */  
@@ -171,9 +171,11 @@
 #define ifaddr_byindex(idx) ifnet_addrs[(idx) - 1];
 #define	WI_LOCK(_sc, _s)	s = splimp()
 #define	WI_UNLOCK(_sc, _s)	splx(s)
+#define	WI_LOCK_ASSERT(_sc)
 #else
 #define	WI_LOCK(_sc, _s) _s = 1
 #define	WI_UNLOCK(_sc, _s)
+#define	WI_LOCK_ASSERT(_sc)
 #endif
 
 int owi_generic_attach(device_t);

==== //depot/projects/hammer/sys/dev/re/if_re.c#7 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.14 2003/11/14 17:16:57 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.15 2003/11/14 19:00:31 sam Exp $");
 
 /*
  * RealTek 8139C+/8169/8169S/8110S PCI NIC driver
@@ -1517,6 +1517,8 @@
 	struct rl_desc		*cur_rx;
 	u_int32_t		rxstat, rxvlan;
 
+	RL_LOCK_ASSERT(sc);
+
 	ifp = &sc->arpcom.ac_if;
 	i = sc->rl_ldata.rl_rx_prodidx;
 
@@ -1659,7 +1661,9 @@
 		if (rxvlan & RL_RDESC_VLANCTL_TAG)
 			VLAN_INPUT_TAG(ifp, m,
 			    ntohs((rxvlan & RL_RDESC_VLANCTL_DATA)), continue);
+		RL_UNLOCK(sc);
 		(*ifp->if_input)(ifp, m);
+		RL_LOCK(sc);
 	}
 
 	/* Flush the RX DMA ring */

==== //depot/projects/hammer/sys/dev/wl/if_wl.c#8 (text+ko) ====

@@ -173,7 +173,7 @@
 */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/wl/if_wl.c,v 1.56 2003/11/13 20:55:51 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/wl/if_wl.c,v 1.57 2003/11/14 19:00:31 sam Exp $");
 
 
 /*
@@ -265,6 +265,7 @@
 };
 
 #define WL_LOCK(_sc)	mtx_lock(&(_sc)->wl_mtx)
+#define WL_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->wl_mtx, MA_OWNED)
 #define WL_UNLOCK(_sc)	mtx_unlock(&(_sc)->wl_mtx)
 
 static int	wlprobe(device_t);
@@ -1069,6 +1070,7 @@
     u_short		mlen, len;
     u_short		bytes_in_msg, bytes_in_mbuf, bytes;
 
+    WL_LOCK_ASSERT(sc);
 
 #ifdef WLDEBUG
     if (sc->wl_if.if_flags & IFF_DEBUG)
@@ -1212,7 +1214,9 @@
      * received packet is now in a chain of mbuf's.  next step is
      * to pass the packet upwards.
      */
+    WL_UNLOCK(sc);
     (*ifp->if_input)(ifp, m);
+    WL_LOCK(sc);
     return 1;
 }
 

==== //depot/projects/hammer/sys/i386/i386/apic_vector.s#4 (text+ko) ====

@@ -32,7 +32,7 @@
  * SUCH DAMAGE.
  *
  *	from: vector.s, 386BSD 0.1 unknown origin
- * $FreeBSD: src/sys/i386/i386/apic_vector.s,v 1.93 2003/11/13 18:16:37 jhb Exp $
+ * $FreeBSD: src/sys/i386/i386/apic_vector.s,v 1.94 2003/11/14 19:10:12 jhb Exp $
  */
 
 /*
@@ -117,6 +117,8 @@
 	ISR_VEC(3, apic_isr3)
 	ISR_VEC(4, apic_isr4)
 	ISR_VEC(5, apic_isr5)
+	ISR_VEC(6, apic_isr6)
+	ISR_VEC(7, apic_isr7)
 MCOUNT_LABEL(eintr2)
 
 #ifdef SMP

==== //depot/projects/hammer/sys/i386/i386/local_apic.c#3 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/local_apic.c,v 1.2 2003/11/12 18:13:57 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/local_apic.c,v 1.3 2003/11/14 19:10:12 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -59,6 +59,10 @@
  */
 #define	MAX_APICID	16
 
+/* Sanity checks on IDT vectors. */
+CTASSERT(APIC_IO_INTS + APIC_NUM_IOINTS <= APIC_LOCAL_INTS);
+CTASSERT(IPI_STOP < APIC_SPURIOUS_INT);
+
 /*
  * Support for local APICs.  Local APICs manage interrupts on each
  * individual processor as opposed to I/O APICs which receive interrupts
@@ -104,8 +108,8 @@
 	IDTVEC(apic_isr3),	/* 96 - 127 */
 	IDTVEC(apic_isr4),	/* 128 - 159 */
 	IDTVEC(apic_isr5),	/* 160 - 191 */
-	NULL,			/* 192 - 223 */
-	NULL			/* 224 - 255 */
+	IDTVEC(apic_isr6),	/* 192 - 223 */
+	IDTVEC(apic_isr7),	/* 224 - 255 */
 };
 
 volatile lapic_t *lapic;
@@ -491,7 +495,7 @@
 	u_int vector;
 
 	KASSERT(irq < NUM_IO_INTS, ("Invalid IRQ %u", irq));
-	vector = irq + IDT_IO_INTS;
+	vector = irq + APIC_IO_INTS;
 	if (vector >= IDT_SYSCALL)
 		vector++;
 	return (vector);
@@ -501,12 +505,12 @@
 apic_idt_to_irq(u_int vector)
 {
 
-	KASSERT(vector >= IDT_IO_INTS && vector != IDT_SYSCALL &&
-	    vector <= IDT_IO_INTS + NUM_IO_INTS,
+	KASSERT(vector >= APIC_IO_INTS && vector != IDT_SYSCALL &&
+	    vector <= APIC_IO_INTS + NUM_IO_INTS,
 	    ("Vector %u does not map to an IRQ line", vector));
 	if (vector > IDT_SYSCALL)
 		vector--;
-	return (vector - IDT_IO_INTS);
+	return (vector - APIC_IO_INTS);
 }
 
 /*

==== //depot/projects/hammer/sys/i386/i386/machdep.c#26 (text+ko) ====

@@ -38,9 +38,9 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/machdep.c,v 1.581 2003/11/09 20:31:02 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/machdep.c,v 1.582 2003/11/14 19:00:02 jhb Exp $");
 
-#include "opt_apic.h"
+#include "opt_acpi.h"
 #include "opt_atalk.h"
 #include "opt_compat.h"
 #include "opt_cpu.h"

==== //depot/projects/hammer/sys/i386/include/apicvar.h#4 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/i386/include/apicvar.h,v 1.3 2003/11/13 16:41:07 jhb Exp $
+ * $FreeBSD: src/sys/i386/include/apicvar.h,v 1.4 2003/11/14 19:10:13 jhb Exp $
  */
 
 #ifndef _MACHINE_APICVAR_H_
@@ -40,13 +40,13 @@
  * Layout of local APIC interrupt vectors:
  *
  *	0xff (255)  +-------------+
- *                  |             | 15 (Spurious Vector)
+ *                  |             | 15 (Spurious / IPIs / Local Interrupts )
  *	0xf0 (240)  +-------------+
- *                  |             | 14 (Interprocessor Interrupts)
+ *                  |             | 14 (I/O Interrupts)
  *	0xe0 (224)  +-------------+
- *                  |             | 13 (Local Interrupt (LINT[01]))
+ *                  |             | 13 (I/O Interrupts)
  *	0xd0 (208)  +-------------+
- *                  |             | 12 (Local Timer and Error Interrupts)
+ *                  |             | 12 (I/O Interrupts)
  *	0xc0 (192)  +-------------+
  *                  |             | 11 (I/O Interrupts)
  *	0xb0 (176)  +-------------+
@@ -66,7 +66,7 @@
  *	0x40 (64)   +-------------+
  *                  |             | 3 (I/O Interrupts)
  *	0x30 (48)   +-------------+
- *                  |             | 2 (I/O Interrupts)
+ *                  |             | 2 (ATPIC Interrupts)
  *	0x20 (32)   +-------------+
  *                  |             | 1 (Exceptions, traps, faults, etc.)
  *	0x10 (16)   +-------------+
@@ -78,23 +78,24 @@
  */
 
 #define	APIC_ID_ALL	0xff
-#define	APIC_NUM_IOINTS	160
+#define	APIC_IO_INTS	(IDT_IO_INTS + 16)
+#define	APIC_NUM_IOINTS	192
 
-#define	APIC_LOCAL_INTS	(IDT_IO_INTS + APIC_NUM_IOINTS)
+#define	APIC_LOCAL_INTS	240
 #define	APIC_TIMER_INT	APIC_LOCAL_INTS
 #define	APIC_ERROR_INT	(APIC_LOCAL_INTS + 1)
 #define	APIC_THERMAL_INT (APIC_LOCAL_INTS + 2)
 
-#define	APIC_IPI_INTS	(APIC_LOCAL_INTS + 32)
+#define	APIC_IPI_INTS	(APIC_LOCAL_INTS + 3)
 #define	IPI_AST		APIC_IPI_INTS		/* Generate software trap. */
 #define	IPI_INVLTLB	(APIC_IPI_INTS + 1)	/* TLB Shootdown IPIs */
 #define	IPI_INVLPG	(APIC_IPI_INTS + 2)
 #define	IPI_INVLRNG	(APIC_IPI_INTS + 3)
+#define	IPI_LAZYPMAP	(APIC_IPI_INTS + 4)	/* Lazy pmap release. */
 #define	IPI_HARDCLOCK	(APIC_IPI_INTS + 8)	/* Inter-CPU clock handling. */
 #define	IPI_STATCLOCK	(APIC_IPI_INTS + 9)
 #define	IPI_RENDEZVOUS	(APIC_IPI_INTS + 10)	/* Inter-CPU rendezvous. */
-#define	IPI_LAZYPMAP	(APIC_IPI_INTS + 11)	/* Lazy pmap release. */
-#define	IPI_STOP	(APIC_IPI_INTS + 12)	/* Stop CPU until restarted. */
+#define	IPI_STOP	(APIC_IPI_INTS + 11)	/* Stop CPU until restarted. */
 
 #define	APIC_SPURIOUS_INT 255
 
@@ -127,7 +128,8 @@
 
 inthand_t
 	IDTVEC(apic_isr1), IDTVEC(apic_isr2), IDTVEC(apic_isr3),
-	IDTVEC(apic_isr4), IDTVEC(apic_isr5), IDTVEC(spuriousint);
+	IDTVEC(apic_isr4), IDTVEC(apic_isr5), IDTVEC(apic_isr6),
+	IDTVEC(apic_isr7), IDTVEC(spuriousint);
 
 u_int	apic_irq_to_idt(u_int irq);
 u_int	apic_idt_to_irq(u_int vector);

==== //depot/projects/hammer/sys/i386/include/intr_machdep.h#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/i386/include/intr_machdep.h,v 1.1 2003/11/03 21:25:52 jhb Exp $
+ * $FreeBSD: src/sys/i386/include/intr_machdep.h,v 1.2 2003/11/14 19:10:13 jhb Exp $
  */
 
 #ifndef __MACHINE_INTR_MACHDEP_H__
@@ -31,8 +31,8 @@
 
 #ifdef _KERNEL
 
-/* With I/O APIC's we can have up to 159 interrupts. */
-#define	NUM_IO_INTS	159
+/* With I/O APIC's we can have up to 191 interrupts. */
+#define	NUM_IO_INTS	191
 #define	INTRCNT_COUNT	(1 + NUM_IO_INTS * 2)
 
 #ifndef LOCORE

==== //depot/projects/hammer/sys/i386/isa/atpic.c#4 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/isa/atpic.c,v 1.3 2003/11/12 18:13:57 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/isa/atpic.c,v 1.4 2003/11/14 19:13:06 jhb Exp $");
 
 #include "opt_auto_eoi.h"
 #include "opt_isa.h"
@@ -73,14 +73,14 @@
 #define	SLAVE_MODE	9	/* 8086 mode */
 #else /* IBM-PC */
 #ifdef AUTO_EOI_1
-#define	MASTER_MODE	(2 | 1)	/* Auto EOI, 8086 mode */
+#define	MASTER_MODE	(ICW4_8086 | ICW4_AEOI)
 #else
-#define	MASTER_MODE	1	/* 8086 mode */
+#define	MASTER_MODE	ICW4_8086
 #endif
 #ifdef AUTO_EOI_2
-#define	SLAVE_MODE	(2 | 1)	/* Auto EOI, 8086 mode */
+#define	SLAVE_MODE	(ICW4_8086 | ICW4_AEOI)
 #else
-#define	SLAVE_MODE	1	/* 8086 mode */
+#define	SLAVE_MODE	ICW4_8086
 #endif
 #endif /* PC98 */
 
@@ -263,11 +263,12 @@
 	/* Reset the PIC and program with next four bytes. */
 	mtx_lock_spin(&icu_lock);
 #ifdef DEV_MCA
+	/* MCA uses level triggered interrupts. */
 	if (MCA_system)
-		outb(pic->at_ioaddr, 0x19);
+		outb(pic->at_ioaddr, ICW1_RESET | ICW1_IC4 | ICW1_LTIM);
 	else
 #endif
-		outb(pic->at_ioaddr, 0x11);
+		outb(pic->at_ioaddr, ICW1_RESET | ICW1_IC4);
 	imr_addr = pic->at_ioaddr + ICU_IMR_OFFSET;
 
 	/* Start vector. */
@@ -293,12 +294,12 @@
 	outb(imr_addr, *pic->at_imen);
 
 	/* Reset is finished, default to IRR on read. */
-	outb(pic->at_ioaddr, 0x0a);
+	outb(pic->at_ioaddr, OCW3_SEL | OCW3_RR);
 
 #ifndef PC98
-	/* Set priority order to 3-7, 0-2 (com2 first). */
+	/* OCW2_L1 sets priority order to 3-7, 0-2 (com2 first). */
 	if (!slave)
-		outb(pic->at_ioaddr, 0xc0 | (3 - 1));
+		outb(pic->at_ioaddr, OCW2_R | OCW2_SL | OCW2_L1);
 #endif
 	mtx_unlock_spin(&icu_lock);
 }

==== //depot/projects/hammer/sys/i386/isa/icu.h#4 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)icu.h	5.6 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/i386/isa/icu.h,v 1.29 2003/11/12 18:13:57 jhb Exp $
+ * $FreeBSD: src/sys/i386/isa/icu.h,v 1.30 2003/11/14 19:12:25 jhb Exp $
  */
 
 /*
@@ -86,6 +86,62 @@
 #define	IRQ7		0x0080		/* lowest - parallel printer */
 #endif
 
+/* Initialization control word 1. Written to even address. */
+#define	ICW1_IC4	0x01		/* ICW4 present */
+#define	ICW1_SNGL	0x02		/* 1 = single, 0 = cascaded */
+#define	ICW1_ADI	0x04		/* 1 = 4, 0 = 8 byte vectors */
+#define	ICW1_LTIM	0x08		/* 1 = level trigger, 0 = edge */
+#define	ICW1_RESET	0x10		/* must be 1 */
+/* 0x20 - 0x80 - in 8080/8085 mode only */
+
+/* Initialization control word 2. Written to the odd address. */
+/* No definitions, it is the base vector of the IDT for 8086 mode */
+
+/* Initialization control word 3. Written to the odd address. */
+/* For a master PIC, bitfield indicating a slave 8259 on given input */
+/* For slave, lower 3 bits are the slave's ID binary id on master */
+
+#ifdef PC98
+/* XXX: missing pc98 bits */
+#else
+
+/* Initialization control word 4. Written to the odd address. */
+#define	ICW4_8086	0x01		/* 1 = 8086, 0 = 8080 */
+#define	ICW4_AEOI	0x02		/* 1 = Auto EOI */
+#define	ICW4_MS		0x04		/* 1 = buffered master, 0 = slave */
+#define	ICW4_BUF	0x08		/* 1 = enable buffer mode */
+#define	ICW4_SFNM	0x10		/* 1 = special fully nested mode */
+
+#endif
+
+/* Operation control words.  Written after initialization. */
+
+/* Operation control word type 1 */
+/*
+ * No definitions.  Written to the odd address.  Bitmask for interrupts.
+ * 1 = disabled.
+ */
+
+/* Operation control word type 2.  Bit 3 (0x08) must be zero. Even address. */
+#define	OCW2_L0		0x01		/* Level */
+#define	OCW2_L1		0x02
+#define	OCW2_L2		0x04
+/* 0x08 must be 0 to select OCW2 vs OCW3 */
+/* 0x10 must be 0 to select OCW2 vs ICW1 */
+#define	OCW2_EOI	0x20		/* 1 = EOI */
+#define	OCW2_SL		0x40		/* EOI mode */
+#define	OCW2_R		0x80		/* EOI mode */
+
+/* Operation control word type 3.  Bit 3 (0x08) must be set. Even address. */
+#define	OCW3_RIS	0x01		/* 1 = read IS, 0 = read IR */
+#define	OCW3_RR		0x02		/* register read */
+#define	OCW3_P		0x04		/* poll mode command */
+/* 0x08 must be 1 to select OCW3 vs OCW2 */
+#define	OCW3_SEL	0x08		/* must be 1 */
+/* 0x10 must be 0 to select OCW3 vs ICW1 */
+#define	OCW3_SMM	0x20		/* special mode mask */
+#define	OCW3_ESMM	0x40		/* enable SMM */
+
 /*
  * Interrupt Control offset into Interrupt descriptor table (IDT)
  */
@@ -100,8 +156,7 @@
 #define	ICU_SLAVEID	2
 #endif
 
-#define	ICU_EOI		0x20
-#define	HWI_MASK	0xffff		/* bits for h/w interrupts */
+#define	ICU_EOI		(OCW2_EOI)	/* non-specific EOI */
 
 #ifndef LOCORE
 void	atpic_handle_intr(struct intrframe iframe);

==== //depot/projects/hammer/sys/kern/kern_event.c#11 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_event.c,v 1.64 2003/11/09 09:17:24 tanimura Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_event.c,v 1.65 2003/11/14 18:49:01 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -218,7 +218,8 @@
 		kn->kn_flags &= ~EV_FLAG1;
 	}
 
-	SLIST_INSERT_HEAD(&p->p_klist, kn, kn_selnext);
+	if (immediate == 0)
+		SLIST_INSERT_HEAD(&p->p_klist, kn, kn_selnext);
 
 	/*
 	 * Immediately activate any exit notes if the target process is a
@@ -280,13 +281,6 @@
 	}
 
 	/*
-	 * Process will already be reported as gone.
-	 * Do not report anything else, as the knote will be destroyed soon.
-	 */
-	if (kn->kn_status & KN_DETACHED)
-		return (0);
-
-	/*
 	 * process forked, and user wants to track the new process,
 	 * so attach a new knote to it, and immediately report an
 	 * event with the parent's pid.

==== //depot/projects/hammer/sys/kern/kern_exit.c#16 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_exit.c,v 1.217 2003/06/15 00:31:23 davidxu Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_exit.c,v 1.218 2003/11/14 18:49:01 cognet Exp $");
 
 #include "opt_compat.h"
 #include "opt_ktrace.h"
@@ -436,6 +436,13 @@
 	 * Notify interested parties of our demise.
 	 */
 	KNOTE(&p->p_klist, NOTE_EXIT);
+	/*
+	 * Just delete all entries in the p_klist. At this point we won't
+	 * report any more events, and there are nasty race conditions that
+	 * can beat us if we don't.
+	 */
+	while (SLIST_FIRST(&p->p_klist))
+		SLIST_REMOVE_HEAD(&p->p_klist, kn_selnext);
 
 	/*
 	 * Notify parent that we're gone.  If parent has the PS_NOCLDWAIT

==== //depot/projects/hammer/sys/net/rtsock.c#8 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)rtsock.c	8.7 (Berkeley) 10/12/95
- * $FreeBSD: src/sys/net/rtsock.c,v 1.94 2003/11/08 23:36:30 sam Exp $
+ * $FreeBSD: src/sys/net/rtsock.c,v 1.95 2003/11/14 18:48:15 bms Exp $
  */
 
 #include <sys/param.h>
@@ -85,6 +85,7 @@
 static int	rt_xaddrs(caddr_t, caddr_t, struct rt_addrinfo *);
 static int	sysctl_dumpentry(struct radix_node *rn, void *vw);
 static int	sysctl_iflist(int af, struct walkarg *w);
+static int	sysctl_ifmalist(int af, struct walkarg *w);
 static int	route_output(struct mbuf *, struct socket *);
 static void	rt_setmetrics(u_long, struct rt_metrics *, struct rt_metrics *);
 static void	rt_dispatch(struct mbuf *, struct sockaddr *);
@@ -684,6 +685,10 @@
 		len = sizeof(struct if_msghdr);
 		break;
 
+	case RTM_NEWMADDR:
+		len = sizeof(struct ifma_msghdr);
+		break;
+
 	default:
 		len = sizeof(struct rt_msghdr);
 	}
@@ -1014,6 +1019,61 @@
 	return (error);
 }
 
+int
+sysctl_ifmalist(af, w)
+	int	af;
+	register struct	walkarg *w;
+{
+	register struct ifnet *ifp;
+	struct ifmultiaddr *ifma;
+	struct	rt_addrinfo info;
+	int	len, error = 0;
+
+	bzero((caddr_t)&info, sizeof(info));
+	/* IFNET_RLOCK(); */		/* could sleep XXX */
+	TAILQ_FOREACH(ifp, &ifnet, if_link) {
+		if (w->w_arg && w->w_arg != ifp->if_index)
+			continue;
+		TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+			if (af && af != ifma->ifma_addr->sa_family)
+				continue;
+			if (jailed(curproc->p_ucred) &&
+			    prison_if(curproc->p_ucred, ifma->ifma_addr))
+				continue;
+			info.rti_addrs = RTA_IFA;
+			info.rti_info[RTAX_IFA] = ifma->ifma_addr;
+			if (TAILQ_FIRST(&ifp->if_addrhead)) {
+				info.rti_addrs |= RTA_IFP;
+				info.rti_info[RTAX_IFP] =
+				    TAILQ_FIRST(&ifp->if_addrhead)->ifa_addr;
+			} else
+				info.rti_info[RTAX_IFP] = NULL;
+
+			if (ifma->ifma_addr->sa_family != AF_LINK) {
+				info.rti_addrs |= RTA_GATEWAY;
+				info.rti_info[RTAX_GATEWAY] = ifma->ifma_lladdr;
+			} else
+				info.rti_info[RTAX_GATEWAY] = NULL;
+
+			len = rt_msg2(RTM_NEWMADDR, &info, 0, w);
+			if (w->w_req && w->w_tmem) {
+				register struct ifma_msghdr *ifmam;
+
+				ifmam = (struct ifma_msghdr *)w->w_tmem;
+				ifmam->ifmam_index = ifma->ifma_ifp->if_index;
+				ifmam->ifmam_flags = 0;
+				ifmam->ifmam_addrs = info.rti_addrs;
+				error = SYSCTL_OUT(w->w_req, w->w_tmem, len);
+				if (error)
+					goto done;
+			}
+		}
+	}
+done:
+	/* IFNET_RUNLOCK(); */ /* XXX */
+	return (error);
+}
+
 static int
 sysctl_rtsock(SYSCTL_HANDLER_ARGS)
 {
@@ -1066,6 +1126,11 @@
 
 	case NET_RT_IFLIST:
 		error = sysctl_iflist(af, &w);
+		break;
+
+	case NET_RT_IFMALIST:
+		error = sysctl_ifmalist(af, &w);
+		break;
 	}
 	splx(s);
 	if (w.w_tmem)

==== //depot/projects/hammer/sys/pci/if_dc.c#26 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_dc.c,v 1.134 2003/11/14 17:16:57 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_dc.c,v 1.135 2003/11/14 19:00:31 sam Exp $");
 
 /*
  * DEC "tulip" clone ethernet driver. Supports the DEC/Intel 21143
@@ -2723,6 +2723,8 @@
 	int i, total_len = 0;
 	u_int32_t rxstat;
 
+	DC_LOCK_ASSERT(sc);
+
 	ifp = &sc->arpcom.ac_if;
 	i = sc->dc_cdata.dc_rx_prod;
 
@@ -2816,7 +2818,9 @@
 		}
 
 		ifp->if_ipackets++;
+		DC_UNLOCK(sc);
 		(*ifp->if_input)(ifp, m);
+		DC_LOCK(sc);
 	}
 
 	sc->dc_cdata.dc_rx_prod = i;
@@ -3069,6 +3073,7 @@
 		CSR_WRITE_4(sc, DC_IMR, DC_INTRS);
 		return;
 	}
+	DC_LOCK(sc);
 	sc->rxcycles = count;
 	dc_rxeof(sc);
 	dc_txeof(sc);
@@ -3082,8 +3087,10 @@
 		status &= (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF |
 			DC_ISR_TX_NOBUF | DC_ISR_TX_IDLE | DC_ISR_TX_UNDERRUN |
 			DC_ISR_BUS_ERR);
-		if (!status)
+		if (!status) {
+			DC_UNLOCK(sc);
 			return;
+		}
 		/* ack what we have */
 		CSR_WRITE_4(sc, DC_ISR, status);
 
@@ -3107,6 +3114,7 @@
 			dc_init(sc);
 		}
 	}
+	DC_UNLOCK(sc);
 }
 #endif /* DEVICE_POLLING */
 

==== //depot/projects/hammer/sys/pci/if_dcreg.h#12 (text+ko) ====

@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_dcreg.h,v 1.38 2003/10/05 19:57:10 mbr Exp $
+ * $FreeBSD: src/sys/pci/if_dcreg.h,v 1.39 2003/11/14 19:00:31 sam Exp $
  */
 
 /*
@@ -766,6 +766,7 @@
 
 #define	DC_LOCK(_sc)		mtx_lock(&(_sc)->dc_mtx)
 #define	DC_UNLOCK(_sc)		mtx_unlock(&(_sc)->dc_mtx)
+#define	DC_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->dc_mtx, MA_OWNED)
 
 #define DC_TX_POLL		0x00000001
 #define DC_TX_COALESCE		0x00000002

==== //depot/projects/hammer/sys/pci/if_pcn.c#13 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_pcn.c,v 1.51 2003/11/14 17:16:57 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_pcn.c,v 1.52 2003/11/14 19:00:31 sam Exp $");
 
 /*
  * AMD Am79c972 fast ethernet PCI NIC driver. Datatheets are available
@@ -796,6 +796,8 @@
 	struct pcn_rx_desc	*cur_rx;
 	int			i;
 
+	PCN_LOCK_ASSERT(sc);
+
 	ifp = &sc->arpcom.ac_if;
 	i = sc->pcn_cdata.pcn_rx_prod;
 
@@ -833,7 +835,9 @@
 		    cur_rx->pcn_rxlen - ETHER_CRC_LEN;
 		m->m_pkthdr.rcvif = ifp;
 
+		PCN_UNLOCK(sc);
 		(*ifp->if_input)(ifp, m);
+		PCN_LOCK(sc);
 	}
 
 	sc->pcn_cdata.pcn_rx_prod = i;

==== //depot/projects/hammer/sys/pci/if_pcnreg.h#2 (text+ko) ====

@@ -30,7 +30,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_pcnreg.h,v 1.7 2001/02/09 06:11:20 bmilekic Exp $
+ * $FreeBSD: src/sys/pci/if_pcnreg.h,v 1.8 2003/11/14 19:00:31 sam Exp $
  */
 
 /*
@@ -453,6 +453,7 @@
 
 #define	PCN_LOCK(_sc)		mtx_lock(&(_sc)->pcn_mtx)
 #define	PCN_UNLOCK(_sc)		mtx_unlock(&(_sc)->pcn_mtx)
+#define	PCN_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->pcn_mtx, MA_OWNED)
 
 /*
  * register space access macros

==== //depot/projects/hammer/sys/pci/if_rl.c#22 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.124 2003/11/14 17:16:57 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.125 2003/11/14 19:00:31 sam Exp $");
 
 /*
  * RealTek 8129/8139 PCI NIC driver
@@ -1236,6 +1236,8 @@
 	u_int16_t		limit;
 	u_int16_t		rx_bytes = 0, max_bytes;
 
+	RL_LOCK_ASSERT(sc);
+
 	ifp = &sc->arpcom.ac_if;
 

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list