PERFORCE change 140089 for review

Julian Elischer julian at FreeBSD.org
Tue Apr 15 21:55:13 UTC 2008


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

Change 140089 by julian at julian_trafmon1 on 2008/04/15 21:54:58

	IFC to 140087

Affected files ...

.. //depot/projects/arp-v2/src/Makefile.inc1#3 integrate
.. //depot/projects/arp-v2/src/lib/libc/gen/Makefile.inc#4 integrate
.. //depot/projects/arp-v2/src/lib/libc/gen/Symbol.map#3 integrate
.. //depot/projects/arp-v2/src/lib/libc/gen/tcgetsid.3#1 branch
.. //depot/projects/arp-v2/src/lib/libc/gen/termios.c#2 integrate
.. //depot/projects/arp-v2/src/sys/ia64/conf/DEFAULTS#3 integrate
.. //depot/projects/arp-v2/src/sys/ia64/conf/GENERIC#4 integrate
.. //depot/projects/arp-v2/src/sys/ia64/conf/SKI#2 integrate
.. //depot/projects/arp-v2/src/sys/ia64/ia64/clock.c#2 integrate
.. //depot/projects/arp-v2/src/sys/ia64/ia64/interrupt.c#4 integrate
.. //depot/projects/arp-v2/src/sys/ia64/ia64/machdep.c#4 integrate
.. //depot/projects/arp-v2/src/sys/ia64/ia64/nexus.c#3 integrate
.. //depot/projects/arp-v2/src/sys/kern/sched_ule.c#4 integrate
.. //depot/projects/arp-v2/src/sys/kern/tty.c#4 integrate
.. //depot/projects/arp-v2/src/sys/mips/mips/cache.c#2 integrate
.. //depot/projects/arp-v2/src/sys/mips/mips/copystr.S#2 integrate
.. //depot/projects/arp-v2/src/sys/net/bpf.c#5 integrate
.. //depot/projects/arp-v2/src/sys/net/if_tap.c#2 integrate
.. //depot/projects/arp-v2/src/sys/netgraph/bluetooth/include/ng_bluetooth.h#2 integrate
.. //depot/projects/arp-v2/src/sys/netgraph/netgraph.h#3 integrate
.. //depot/projects/arp-v2/src/sys/netgraph/ng_base.c#5 integrate
.. //depot/projects/arp-v2/src/sys/sys/ttycom.h#2 integrate
.. //depot/projects/arp-v2/src/usr.sbin/ndiscvt/inf.c#2 integrate
.. //depot/projects/arp-v2/src/usr.sbin/ndiscvt/ndiscvt.c#2 integrate
.. //depot/projects/arp-v2/src/usr.sbin/ndiscvt/ndisgen.sh#2 integrate

Differences ...

==== //depot/projects/arp-v2/src/Makefile.inc1#3 (text+ko) ====

@@ -1,5 +1,5 @@
 #
-# $FreeBSD: src/Makefile.inc1,v 1.602 2008/03/29 17:44:38 ru Exp $
+# $FreeBSD: src/Makefile.inc1,v 1.603 2008/04/15 05:14:42 ru Exp $
 #
 # Make command line options:
 #	-DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
@@ -963,10 +963,12 @@
 #
 # cross-tools: Build cross-building tools
 #
-.if ${TARGET_ARCH} != ${MACHINE_ARCH}
+.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035
 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
 _btxld=		usr.sbin/btxld
 .endif
+.endif
+.if ${TARGET_ARCH} != ${MACHINE_ARCH}
 .if ${MK_RESCUE} != "no" || defined(RELEASEDIR)
 _crunchide=	usr.sbin/crunch/crunchide
 .endif

==== //depot/projects/arp-v2/src/lib/libc/gen/Makefile.inc#4 (text+ko) ====

@@ -1,5 +1,5 @@
 #	@(#)Makefile.inc	8.6 (Berkeley) 5/4/95
-# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.133 2008/03/29 16:19:35 das Exp $
+# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.134 2008/04/15 08:33:32 davidxu Exp $
 
 # machine-independent gen sources
 .PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen
@@ -63,7 +63,7 @@
 	setjmp.3 setmode.3 setproctitle.3 \
 	siginterrupt.3 signal.3 sigsetops.3 sleep.3 \
 	statvfs.3 stringlist.3 \
-	strtofflags.3 sysconf.3 sysctl.3 syslog.3 tcgetpgrp.3 \
+	strtofflags.3 sysconf.3 sysctl.3 syslog.3 tcgetpgrp.3 tcgetsid.3 \
 	tcsendbreak.3 tcsetattr.3 tcsetpgrp.3 time.3 times.3 timezone.3 \
 	ttyname.3 tzset.3 ualarm.3 ucontext.3 ulimit.3 uname.3 \
 	unvis.3 usleep.3 utime.3 valloc.3 vis.3 wordexp.3

==== //depot/projects/arp-v2/src/lib/libc/gen/Symbol.map#3 (text) ====

@@ -1,5 +1,5 @@
 /*
- * $FreeBSD: src/lib/libc/gen/Symbol.map,v 1.8 2008/01/26 17:09:40 yar Exp $
+ * $FreeBSD: src/lib/libc/gen/Symbol.map,v 1.9 2008/04/15 08:33:32 davidxu Exp $
  */
 
 FBSD_1.0 {
@@ -337,6 +337,7 @@
 	fts_get_clientptr;
 	fts_get_stream;
 	fts_set_clientptr;
+	tcgetsid;
 };
 
 FBSDprivate_1.0 {

==== //depot/projects/arp-v2/src/lib/libc/gen/termios.c#2 (text+ko) ====

@@ -31,7 +31,7 @@
 static char sccsid[] = "@(#)termios.c	8.2 (Berkeley) 2/21/94";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/gen/termios.c,v 1.14 2007/01/09 00:27:55 imp Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/gen/termios.c,v 1.15 2008/04/15 08:33:32 davidxu Exp $");
 
 #include "namespace.h"
 #include <sys/types.h>
@@ -99,6 +99,17 @@
 	return ((pid_t)s);
 }
 
+pid_t
+tcgetsid(int fd)
+{
+	int s;
+
+	if (_ioctl(fd, TIOCGSID, &s) < 0)
+		return ((pid_t)-1);
+
+	return ((pid_t)s);
+}
+
 speed_t
 cfgetospeed(t)
 	const struct termios *t;

==== //depot/projects/arp-v2/src/sys/ia64/conf/DEFAULTS#3 (text+ko) ====

@@ -1,7 +1,7 @@
 #
 # DEFAULTS -- Default kernel configuration file for FreeBSD/ia64
 #
-# $FreeBSD: src/sys/ia64/conf/DEFAULTS,v 1.13 2008/03/12 10:11:58 jeff Exp $
+# $FreeBSD: src/sys/ia64/conf/DEFAULTS,v 1.14 2008/04/15 17:02:23 marcel Exp $
 
 machine		ia64
 
@@ -9,6 +9,7 @@
 device 		acpi		# ACPI support
 
 # Pseudo devices.
+device		genclock	# Real-time clock
 device		mem		# Memory and kernel memory devices
 
 # UART chips on this platform

==== //depot/projects/arp-v2/src/sys/ia64/conf/GENERIC#4 (text+ko) ====

@@ -18,7 +18,7 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/ia64/conf/GENERIC,v 1.96 2008/03/27 11:54:18 dfr Exp $
+# $FreeBSD: src/sys/ia64/conf/GENERIC,v 1.97 2008/04/15 05:02:41 marcel Exp $
 
 cpu		ITANIUM
 ident		GENERIC
@@ -48,7 +48,7 @@
 options 	NFS_ROOT	# NFS usable as root device
 options 	PROCFS		# Process filesystem (/proc)
 options 	PSEUDOFS	# Pseudo-filesystem framework
-options 	SCHED_4BSD	# 4BSD scheduler
+options 	SCHED_ULE	# ULE scheduler
 options 	SCSI_DELAY=5000	# Delay (in ms) before probing SCSI
 options 	SCTP		# Stream Control Transmission Protocol
 options 	SMP		# Symmetric Multi-Processor support

==== //depot/projects/arp-v2/src/sys/ia64/conf/SKI#2 (text+ko) ====

@@ -17,7 +17,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check
 # first in NOTES.
 #
-# $FreeBSD: src/sys/ia64/conf/SKI,v 1.24 2006/06/15 19:58:53 netchild Exp $
+# $FreeBSD: src/sys/ia64/conf/SKI,v 1.25 2008/04/15 05:02:41 marcel Exp $
 
 cpu		ITANIUM
 ident		SKI
@@ -35,8 +35,8 @@
 options 	MD_ROOT		# MD usable as root device
 options 	PROCFS		# Process filesystem (/proc)
 options 	PSEUDOFS	# Pseudo-filesystem framework
-options 	SCHED_4BSD	# 4BSD scheduler
-#options 	SCHED_ULE	# ULE scheduler
+#options 	SCHED_4BSD	# 4BSD scheduler
+options 	SCHED_ULE	# ULE scheduler
 options 	SKI		# Include SKI support code
 options 	SOFTUPDATES	# Enable FFS soft updates support
 options 	SYSVMSG		# SYSV-style message queues

==== //depot/projects/arp-v2/src/sys/ia64/ia64/clock.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ia64/ia64/clock.c,v 1.32 2007/08/04 19:28:19 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/ia64/ia64/clock.c,v 1.33 2008/04/15 17:02:23 marcel Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -44,8 +44,6 @@
 
 uint64_t ia64_clock_reload;
 
-static int clock_initialized = 0;
-
 #ifndef SMP
 static timecounter_get_t ia64_get_timecount;
 
@@ -110,93 +108,3 @@
 
 	/* nothing to do */
 }
-
-void
-inittodr(time_t base)
-{
-	long days;
-	struct efi_tm tm;
-	struct timespec ts;
-	struct clocktime ct;
-
-	efi_get_time(&tm);
-
-	/*
-	 * This code was written in 2005, so logically EFI cannot return
-	 * a year smaller than that. Assume the EFI clock is out of whack
-	 * in that case and reset the EFI clock.
-	 */
-	if (tm.tm_year < 2005) {
-		printf("WARNING: CHECK AND RESET THE DATE!\n");
-		memset(&tm, 0, sizeof(tm));
-		tm.tm_year = 2005;
-		tm.tm_mon = tm.tm_mday = 1;
-		if (efi_set_time(&tm))
-			printf("ERROR: COULD NOT RESET EFI CLOCK!\n");
-	}
-
-	ct.nsec = tm.tm_nsec;
-	ct.sec = tm.tm_sec;
-	ct.min = tm.tm_min;
-	ct.hour = tm.tm_hour;
-	ct.day = tm.tm_mday;
-	ct.mon = tm.tm_mon;
-	ct.year = tm.tm_year;
-	ct.dow = -1;
-	if (clock_ct_to_ts(&ct, &ts))
-		printf("Invalid time in clock: check and reset the date!\n");
-	ts.tv_sec += utc_offset();
-
-	/*
-	 * The EFI clock is supposed to be a real-time clock, whereas the
-	 * base argument is coming from a saved (as on disk) time. It's
-	 * impossible for a saved time to represent a time in the future,
-	 * so we expect the EFI clock to be larger. If not, the EFI clock
-	 * may not be reliable and we trust the base.
-	 * Warn if the EFI clock was off by 2 or more days.
-	 */
-	if (ts.tv_sec < base) {
-		days = (base - ts.tv_sec) / (60L * 60L * 24L);
-		if (days >= 2)
-			printf("WARNING: EFI clock lost %ld days!\n", days);
-		ts.tv_sec = base;
-		ts.tv_nsec = 0;
-	}
-
-	tc_setclock(&ts);
-	clock_initialized = 1;
-}
-
-/*
- * Reset the TODR based on the time value; used when the TODR has a
- * preposterous value and also when the time is reset by the stime
- * system call.  Also called when the TODR goes past
- * TODRZERO + 100*(SECYEAR+2*SECDAY) (e.g. on Jan 2 just after midnight)
- * to wrap the TODR around.
- */
-void
-resettodr()
-{
-	struct timespec ts;
-	struct clocktime ct;
-	struct efi_tm tm;
-
-	if (!clock_initialized || disable_rtc_set)
-		return;
-
-	efi_get_time(&tm);
-	getnanotime(&ts);
-	ts.tv_sec -= utc_offset();
-	clock_ts_to_ct(&ts, &ct);
-
-	tm.tm_nsec = ts.tv_nsec;
-	tm.tm_sec = ct.sec;
-	tm.tm_min = ct.min;
-	tm.tm_hour = ct.hour;
-
-	tm.tm_year = ct.year;
-	tm.tm_mon = ct.mon;
-	tm.tm_mday = ct.day;
-	if (efi_set_time(&tm))
-		printf("ERROR: COULD NOT RESET EFI CLOCK!\n");
-}

==== //depot/projects/arp-v2/src/sys/ia64/ia64/interrupt.c#4 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/ia64/ia64/interrupt.c,v 1.67 2008/04/11 23:10:39 jeff Exp $ */
+/* $FreeBSD: src/sys/ia64/ia64/interrupt.c,v 1.68 2008/04/15 05:02:42 marcel Exp $ */
 /* $NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $ */
 
 /*-
@@ -47,6 +47,7 @@
 #include <sys/ktr.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
+#include <sys/sched.h>
 #include <sys/smp.h>
 #include <sys/sysctl.h>
 #include <sys/syslog.h>
@@ -241,6 +242,9 @@
 	} else if (vector == ipi_vector[IPI_TEST]) {
 		CTR1(KTR_SMP, "IPI_TEST, cpuid=%d", PCPU_GET(cpuid));
 		mp_ipi_test++;
+	} else if (vector == ipi_vector[IPI_PREEMPT]) {
+		CTR1(KTR_SMP, "IPI_PREEMPT, cpuid=%d", PCPU_GET(cpuid));
+		sched_preempt(curthread);
 #endif
 	} else {
 		ints[PCPU_GET(cpuid)]++;

==== //depot/projects/arp-v2/src/sys/ia64/ia64/machdep.c#4 (text+ko) ====

@@ -26,12 +26,13 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ia64/ia64/machdep.c,v 1.235 2008/03/30 23:09:14 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/ia64/ia64/machdep.c,v 1.236 2008/04/15 05:02:42 marcel Exp $");
 
 #include "opt_compat.h"
 #include "opt_ddb.h"
 #include "opt_kstack_pages.h"
 #include "opt_msgbuf.h"
+#include "opt_sched.h"
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -370,6 +371,12 @@
 	if (PCPU_GET(fpcurthread) == old)
 		old->td_frame->tf_special.psr |= IA64_PSR_DFH;
 	if (!savectx(oldpcb)) {
+		old->td_lock = mtx;
+#if defined(SCHED_ULE) && defined(SMP)
+		/* td_lock is volatile */
+		while (new->td_lock == &blocked_lock)
+			;
+#endif
 		newpcb = new->td_pcb;
 		oldpcb->pcb_current_pmap =
 		    pmap_switch(newpcb->pcb_current_pmap);
@@ -890,12 +897,16 @@
 {
 	u_int64_t start, end, now;
 
+	sched_pin();
+
 	start = ia64_get_itc();
 	end = start + (itc_frequency * n) / 1000000;
 	/* printf("DELAY from 0x%lx to 0x%lx\n", start, end); */
 	do {
 		now = ia64_get_itc();
 	} while (now < end || (now > start && end < start));
+
+	sched_unpin();
 }
 
 /*

==== //depot/projects/arp-v2/src/sys/ia64/ia64/nexus.c#3 (text+ko) ====

@@ -26,7 +26,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/ia64/ia64/nexus.c,v 1.19 2008/03/13 20:39:04 jhb Exp $
+ * $FreeBSD: src/sys/ia64/ia64/nexus.c,v 1.20 2008/04/15 17:02:23 marcel Exp $
  */
 
 /*
@@ -43,6 +43,7 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
+#include <sys/clock.h>
 #include <sys/kernel.h>
 #include <sys/malloc.h>
 #include <sys/module.h>
@@ -53,6 +54,7 @@
 #include <vm/vm.h>
 #include <vm/pmap.h>
 
+#include <machine/efi.h>
 #include <machine/intr.h>
 #include <machine/nexusvar.h>
 #include <machine/pmap.h>
@@ -66,6 +68,8 @@
 #include <isa/isareg.h>
 #include <sys/rtprio.h>
 
+#include "clock_if.h"
+
 static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
 struct nexus_device {
 	struct resource_list	nx_resources;
@@ -104,6 +108,9 @@
 static	int nexus_config_intr(device_t, int, enum intr_trigger,
 			      enum intr_polarity);
 
+static int nexus_gettime(device_t, struct timespec *);
+static int nexus_settime(device_t, struct timespec *);
+
 static device_method_t nexus_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe,		nexus_probe),
@@ -130,6 +137,10 @@
 	DEVMETHOD(bus_delete_resource,	nexus_delete_resource),
 	DEVMETHOD(bus_config_intr,	nexus_config_intr),
 
+	/* Clock interface */
+	DEVMETHOD(clock_gettime,	nexus_gettime),
+	DEVMETHOD(clock_settime,	nexus_settime),
+
 	{ 0, 0 }
 };
 
@@ -229,6 +240,7 @@
 
 	if (acpi_identify() == 0)
 		BUS_ADD_CHILD(dev, 10, "acpi", 0);
+	clock_register(dev, 1000);
 	bus_generic_attach(dev);
 	return 0;
 }
@@ -521,54 +533,49 @@
 	return (sapic_config_intr(irq, trig, pol));
 }
 
-#if 0
+static int
+nexus_gettime(device_t dev, struct timespec *ts)
+{
+	struct clocktime ct;
+	struct efi_tm tm;
+
+	efi_get_time(&tm);
 
-/*
- * Placeholder which claims PnP 'devices' which describe system 
- * resources.
- */
-static struct isa_pnp_id sysresource_ids[] = {
-	{ 0x010cd041 /* PNP0c01 */, "System Memory" },
-	{ 0x020cd041 /* PNP0c02 */, "System Resource" },
-	{ 0 }
-};
+	/*
+	 * This code was written in 2005, so logically EFI cannot return
+	 * a year smaller than that. Assume the EFI clock is out of whack
+	 * in that case and reset the EFI clock.
+	 */
+	if (tm.tm_year < 2005)
+		return (EINVAL);
 
-static int
-sysresource_probe(device_t dev)
-{
-	int	result;
-	
-	if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, sysresource_ids)) <= 0) {
-		device_quiet(dev);
-	}
-	return(result);
+	ct.nsec = tm.tm_nsec;
+	ct.sec = tm.tm_sec;
+	ct.min = tm.tm_min;
+	ct.hour = tm.tm_hour;
+	ct.day = tm.tm_mday;
+	ct.mon = tm.tm_mon;
+	ct.year = tm.tm_year;
+	ct.dow = -1;
+	return (clock_ct_to_ts(&ct, ts));
 }
 
 static int
-sysresource_attach(device_t dev)
+nexus_settime(device_t dev, struct timespec *ts)
 {
-	return(0);
-}
+	struct clocktime ct;
+	struct efi_tm tm;
 
-static device_method_t sysresource_methods[] = {
-	/* Device interface */
-	DEVMETHOD(device_probe,		sysresource_probe),
-	DEVMETHOD(device_attach,	sysresource_attach),
-	DEVMETHOD(device_detach,	bus_generic_detach),
-	DEVMETHOD(device_shutdown,	bus_generic_shutdown),
-	DEVMETHOD(device_suspend,	bus_generic_suspend),
-	DEVMETHOD(device_resume,	bus_generic_resume),
-	{ 0, 0 }
-};
+	efi_get_time(&tm);
 
-static driver_t sysresource_driver = {
-	"sysresource",
-	sysresource_methods,
-	1,		/* no softc */
-};
+	clock_ts_to_ct(ts, &ct);
+	tm.tm_nsec = ts->tv_nsec;
+	tm.tm_sec = ct.sec;
+	tm.tm_min = ct.min;
+	tm.tm_hour = ct.hour;
+	tm.tm_year = ct.year;
+	tm.tm_mon = ct.mon;
+	tm.tm_mday = ct.day;
+	return (efi_set_time(&tm));
+}
 
-static devclass_t sysresource_devclass;
-
-DRIVER_MODULE(sysresource, isa, sysresource_driver, sysresource_devclass, 0, 0);
-
-#endif

==== //depot/projects/arp-v2/src/sys/kern/sched_ule.c#4 (text+ko) ====

@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.240 2008/04/04 01:16:18 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.241 2008/04/15 05:02:42 marcel Exp $");
 
 #include "opt_hwpmc_hooks.h"
 #include "opt_sched.h"
@@ -72,7 +72,7 @@
 #include <machine/cpu.h>
 #include <machine/smp.h>
 
-#if !defined(__i386__) && !defined(__amd64__) && !defined(__powerpc__) && !defined(__arm__)
+#if defined(__sparc64__) || defined(__mips__)
 #error "This architecture is not currently compatible with ULE"
 #endif
 

==== //depot/projects/arp-v2/src/sys/kern/tty.c#4 (text+ko) ====

@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.275 2008/03/19 06:19:00 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.276 2008/04/15 08:33:32 davidxu Exp $");
 
 #include "opt_compat.h"
 #include "opt_tty.h"
@@ -1010,6 +1010,11 @@
 			return (ENOTTY);
 		*(int *)data = tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID;
 		break;
+	case TIOCGSID:                  /* get sid of tty */
+		if (!isctty(p, tp))
+			return (ENOTTY);
+		*(int *)data = tp->t_session->s_sid;
+		break;
 #ifdef TIOCHPCL
 	case TIOCHPCL:			/* hang up on last close */
 		s = spltty();

==== //depot/projects/arp-v2/src/sys/mips/mips/cache.c#2 (text+ko) ====

@@ -1,32 +1,74 @@
+/*      $NetBSD: cache.c,v 1.33 2005/12/24 23:24:01 perry Exp $ */
+
 /*-
- * Copyright (c) 2006 Fill this file and put your name here
+ * Copyright 2001, 2002 Wasabi Systems, Inc.
  * All rights reserved.
  *
+ * Written by Jason R. Thorpe and Simon Burge for Wasabi Systems, Inc.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification, immediately at the beginning of the file.
- * 2. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed for the NetBSD Project by
+ *      Wasabi Systems, Inc.
+ * 4. The name of Wasabi Systems, Inc. may not be used to endorse
+ *    or promote products derived from this software without specific prior
+ *    written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright 2000, 2001
+ * Broadcom Corporation. All rights reserved.
+ * 
+ * This software is furnished under license and may be used and copied only
+ * in accordance with the following terms and conditions.  Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * modified or unmodified copies of this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ * 
+ * 1) Any source code used, modified or distributed must reproduce and
+ *    retain this copyright notice and list of conditions as they appear in
+ *    the source file.
+ * 
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ *    Broadcom Corporation.  The "Broadcom Corporation" name may not be
+ *    used to endorse or promote products derived from this software
+ *    without the prior written permission of Broadcom Corporation.
  *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED
+ *    WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
+ *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ *    NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE
+ *    FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE
+ *    LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ *    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ *    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ *    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ *    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ *    OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/mips/mips/cache.c,v 1.1 2008/04/13 07:27:37 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/mips/mips/cache.c,v 1.2 2008/04/15 05:35:00 imp Exp $");
 
 #include <sys/types.h>
 #include <sys/systm.h>

==== //depot/projects/arp-v2/src/sys/mips/mips/copystr.S#2 (text+ko) ====

@@ -1,6 +1,11 @@
+/*      $NetBSD: copy.S,v 1.5 2007/10/17 19:55:37 garbled Exp $ */
+
 /*-
- * Copyright (c) [year] [your name]
- * All rights reserved.
+ * Copyright (c) 1992, 1993
+ *      The Regents of the University of California.  All rights reserved.
+ * 
+ * This code is derived from software contributed to Berkeley by
+ * Digital Equipment Corporation and Ralph Campbell.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -10,11 +15,14 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -23,13 +31,28 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id$
+ * Copyright (C) 1989 Digital Equipment Corporation.
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies.
+ * Digital Equipment Corporation makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ * 
+ * from: Header: /sprite/src/kernel/mach/ds3100.md/RCS/loMem.s,
+ *      v 1.1 89/07/11 17:55:04 nelson Exp  SPRITE (DECWRL)
+ * from: Header: /sprite/src/kernel/mach/ds3100.md/RCS/machAsm.s,
+ *      v 9.2 90/01/29 18:00:39 shirriff Exp  SPRITE (DECWRL)
+ * from: Header: /sprite/src/kernel/vm/ds3100.md/vmPmaxAsm.s,
+ *      v 1.1 89/07/10 14:27:41 nelson Exp  SPRITE (DECWRL)
+ * 
+ *      @(#)locore.s    8.5 (Berkeley) 1/4/94
  */
 	
 #include "assym.s"
 #include <machine/asm.h>
 #include <machine/asmacros.h>
-__FBSDID("$FreeBSD: src/sys/mips/mips/copystr.S,v 1.1 2008/04/13 07:27:37 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/mips/mips/copystr.S,v 1.2 2008/04/15 05:31:19 imp Exp $");
 
 #include <sys/errno.h>
 

==== //depot/projects/arp-v2/src/sys/net/bpf.c#5 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/net/bpf.c,v 1.192 2008/04/15 00:50:01 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/net/bpf.c,v 1.193 2008/04/15 17:08:24 jkim Exp $");
 
 #include "opt_bpf.h"
 #include "opt_mac.h"
@@ -841,6 +841,9 @@
 		mc = m_dup(m, M_DONTWAIT);
 		if (mc != NULL)
 			mc->m_pkthdr.rcvif = ifp;
+		/* Set M_PROMISC for outgoing packets to be discarded. */
+		if (d->bd_direction == BPF_D_INOUT)
+			m->m_flags |= M_PROMISC;
 	} else
 		mc = NULL;
 
@@ -1571,9 +1574,6 @@
 #define	BPF_CHECK_DIRECTION(d, i)				\
 	    (((d)->bd_direction == BPF_D_IN && (i) == NULL) ||	\
 	    ((d)->bd_direction == BPF_D_OUT && (i) != NULL))
-#define	BPF_CHECK_DUPLICATE(d, i)				\
-	    ((d)->bd_feedback &&				\
-	    (d)->bd_direction == BPF_D_INOUT &&	(i) == NULL)
 
 /*
  * Incoming linkage from device drivers, when packet is in an mbuf chain.
@@ -1586,14 +1586,19 @@
 	int gottime;
 	struct timeval tv;
 
+	/* Skip outgoing duplicate packets. */
+	if ((m->m_flags & M_PROMISC) != 0 && m->m_pkthdr.rcvif == NULL) {
+		m->m_flags &= ~M_PROMISC;
+		return;
+	}
+
 	gottime = 0;
 
 	pktlen = m_length(m, NULL);
 
 	BPFIF_LOCK(bp);
 	LIST_FOREACH(d, &bp->bif_dlist, bd_next) {
-		if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif) ||
-		    BPF_CHECK_DUPLICATE(d, m->m_pkthdr.rcvif))
+		if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif))
 			continue;
 		BPFD_LOCK(d);
 		++d->bd_rcount;
@@ -1636,6 +1641,12 @@
 	int gottime;
 	struct timeval tv;
 
+	/* Skip outgoing duplicate packets. */
+	if ((m->m_flags & M_PROMISC) != 0 && m->m_pkthdr.rcvif == NULL) {
+		m->m_flags &= ~M_PROMISC;
+		return;
+	}
+
 	gottime = 0;
 
 	pktlen = m_length(m, NULL);
@@ -1651,8 +1662,7 @@
 
 	BPFIF_LOCK(bp);
 	LIST_FOREACH(d, &bp->bif_dlist, bd_next) {
-		if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif) ||
-		    BPF_CHECK_DUPLICATE(d, m->m_pkthdr.rcvif))
+		if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif))
 			continue;
 		BPFD_LOCK(d);
 		++d->bd_rcount;
@@ -1675,7 +1685,6 @@
 }
 
 #undef	BPF_CHECK_DIRECTION
-#undef	BPF_CHECK_DUPLICATE
 
 /*
  * Move the packet data from interface memory (pkt) into the

==== //depot/projects/arp-v2/src/sys/net/if_tap.c#2 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 /*
- * $FreeBSD: src/sys/net/if_tap.c,v 1.71 2007/03/19 18:17:31 bms Exp $
+ * $FreeBSD: src/sys/net/if_tap.c,v 1.72 2008/04/15 16:54:39 emax Exp $
  * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $
  */
 
@@ -404,6 +404,7 @@
 	struct ifnet		*ifp = NULL;
 	struct tap_softc	*tp = NULL;
 	unsigned short		 macaddr_hi;
+	uint32_t		 macaddr_mid;
 	int			 unit, s;
 	char			*name = NULL;
 	u_char			eaddr[6];
@@ -432,8 +433,9 @@
 
 	/* generate fake MAC address: 00 bd xx xx xx unit_no */
 	macaddr_hi = htons(0x00bd);
+	macaddr_mid = (uint32_t) ticks;
 	bcopy(&macaddr_hi, eaddr, sizeof(short));
-	bcopy(&ticks, &eaddr[2], sizeof(long));
+	bcopy(&macaddr_mid, &eaddr[2], sizeof(uint32_t));
 	eaddr[5] = (u_char)unit;
 
 	/* fill the rest and attach interface */

==== //depot/projects/arp-v2/src/sys/netgraph/bluetooth/include/ng_bluetooth.h#2 (text+ko) ====

@@ -28,12 +28,14 @@
  * SUCH DAMAGE.
  *
  * $Id: ng_bluetooth.h,v 1.4 2003/04/26 22:32:34 max Exp $
- * $FreeBSD: src/sys/netgraph/bluetooth/include/ng_bluetooth.h,v 1.4 2005/01/07 01:45:43 imp Exp $
+ * $FreeBSD: src/sys/netgraph/bluetooth/include/ng_bluetooth.h,v 1.5 2008/04/15 21:15:32 mav Exp $
  */
 
 #ifndef _NETGRAPH_BLUETOOTH_H_
 #define _NETGRAPH_BLUETOOTH_H_
 
+#include <sys/queue.h>
+
 /*
  * Version of the stack
  */
@@ -147,8 +149,7 @@
 struct ng_item;
 
 struct ng_bt_itemq {
-	struct ng_item	*head;   /* first item in the queue */
-	struct ng_item	*tail;   /* last item in the queue */
+	STAILQ_HEAD(, ng_item)	queue;	/* actually items queue */
 	u_int32_t	 len;    /* number of items in the queue */
 	u_int32_t	 maxlen; /* maximal number of items in the queue */
 	u_int32_t	 drops;  /* number if dropped items */
@@ -156,14 +157,20 @@
 typedef struct ng_bt_itemq	ng_bt_itemq_t;
 typedef struct ng_bt_itemq *	ng_bt_itemq_p;
 
-#define NG_BT_ITEMQ_INIT(q, _maxlen)	NG_BT_MBUFQ_INIT((q), (_maxlen))
+#define NG_BT_ITEMQ_INIT(q, _maxlen)			\
+	do {						\
+		STAILQ_INIT(&(q)->queue);		\
+		(q)->len = 0;				\
+		(q)->maxlen = (_maxlen);		\
+		(q)->drops = 0;				\
+	} while (0)
 
 #define NG_BT_ITEMQ_DESTROY(q)				\
 	do {						\
 		NG_BT_ITEMQ_DRAIN((q));			\
 	} while (0)
 
-#define NG_BT_ITEMQ_FIRST(q)	NG_BT_MBUFQ_FIRST((q))
+#define NG_BT_ITEMQ_FIRST(q)	STAILQ_FIRST(&(q)->queue)
 
 #define NG_BT_ITEMQ_LEN(q)	NG_BT_MBUFQ_LEN((q))
 
@@ -173,37 +180,22 @@
 
 #define NG_BT_ITEMQ_ENQUEUE(q, i)			\
 	do {						\
-		(i)->el_next = NULL;			\
-							\
-		if ((q)->tail == NULL)			\
-			(q)->head = (i);		\
-		else					\
-			(q)->tail->el_next = (i);	\
-							\
-		(q)->tail = (i);			\
+		STAILQ_INSERT_TAIL(&(q)->queue, (i), el_next);	\
 		(q)->len ++;				\
 	} while (0)
 
 #define NG_BT_ITEMQ_DEQUEUE(q, i)			\
 	do {						\
-		(i) = (q)->head;			\
+		(i) = STAILQ_FIRST(&(q)->queue);	\
 		if ((i) != NULL) {			\
-			(q)->head = (q)->head->el_next;	\
-			if ((q)->head == NULL)		\
-				(q)->tail = NULL;	\
-							\
+			STAILQ_REMOVE_HEAD(&(q)->queue, el_next);	\
 			(q)->len --;			\
-			(i)->el_next = NULL;		\
 		} 					\
 	} while (0)
 
 #define NG_BT_ITEMQ_PREPEND(q, i)			\
 	do {						\
-		(i)->el_next = (q)->head;		\
-		if ((q)->tail == NULL)			\
-			(q)->tail = (i);		\
-							\
-		(q)->head = (i);			\
+		STAILQ_INSERT_HEAD(&(q)->queue, (i), el_next);	\
 		(q)->len ++;				\
 	} while (0)
 

==== //depot/projects/arp-v2/src/sys/netgraph/netgraph.h#3 (text+ko) ====

@@ -37,7 +37,7 @@
  *
  * Author: Julian Elischer <julian at freebsd.org>
  *
- * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.72 2008/03/11 21:58:48 mav Exp $
+ * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.73 2008/04/15 21:15:31 mav Exp $
  * $Whistle: netgraph.h,v 1.29 1999/11/01 07:56:13 julian Exp $
  */
 
@@ -66,7 +66,7 @@
  * Change it for NETGRAPH_DEBUG version so we cannot mix debug and non debug
  * modules.
  */
-#define _NG_ABI_VERSION 11
+#define _NG_ABI_VERSION 12
 #ifdef	NETGRAPH_DEBUG /*----------------------------------------------*/
 #define NG_ABI_VERSION	(_NG_ABI_VERSION + 0x10000)
 #else	/* NETGRAPH_DEBUG */ /*----------------------------------------------*/
@@ -107,13 +107,13 @@
 	char	hk_name[NG_HOOKSIZ];	/* what this node knows this link as */
 	void   *hk_private;		/* node dependant ID for this hook */
 	int	hk_flags;		/* info about this hook/link */
-	int	hk_refs;		/* dont actually free this till 0 */
 	int	hk_type;		/* tbd: hook data link type */
 	struct	ng_hook *hk_peer;	/* the other end of this link */
 	struct	ng_node *hk_node;	/* The node this hook is attached to */
 	LIST_ENTRY(ng_hook) hk_hooks;	/* linked list of all hooks on node */
 	ng_rcvmsg_t	*hk_rcvmsg;	/* control messages come here */
 	ng_rcvdata_t	*hk_rcvdata;	/* data comes here */
+	int	hk_refs;		/* dont actually free this till 0 */
 #ifdef	NETGRAPH_DEBUG /*----------------------------------------------*/
 #define HK_MAGIC 0x78573011
 	int	hk_magic;
@@ -331,26 +331,25 @@
  * embedded in the node structure
  */
 struct ng_queue {
-	u_long		q_flags;
+	u_int		q_flags;	/* Current r/w/q lock flags */
+	u_int		q_flags2;	/* Other queue flags */
 	struct mtx	q_mtx;
-	item_p queue;
-	item_p *last;
-	struct ng_node *q_node;		/* find the front of the node.. */
+	STAILQ_ENTRY(ng_node)	q_work;	/* nodes with work to do */
+	STAILQ_HEAD(, ng_item)	queue;	/* actually items queue */

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


More information about the p4-projects mailing list