Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jun 2005 05:17:23 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 78316 for review
Message-ID:  <200506100517.j5A5HNhC013330@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=78316

Change 78316 by marcel@marcel_nfs on 2005/06/10 05:17:03

	IFC @78313

Affected files ...

.. //depot/projects/tty/lib/libpmc/libpmc.c#4 integrate
.. //depot/projects/tty/sbin/dhclient/dhclient-script#2 integrate
.. //depot/projects/tty/share/man/man4/dummynet.4#2 integrate
.. //depot/projects/tty/share/man/man4/if_bridge.4#3 integrate
.. //depot/projects/tty/sys/alpha/alpha/pmap.c#11 integrate
.. //depot/projects/tty/sys/amd64/amd64/pmap.c#12 integrate
.. //depot/projects/tty/sys/arm/arm/pmap.c#8 integrate
.. //depot/projects/tty/sys/i386/i386/pmap.c#16 integrate
.. //depot/projects/tty/sys/ia64/ia64/pmap.c#14 integrate
.. //depot/projects/tty/sys/kern/kern_switch.c#18 integrate
.. //depot/projects/tty/sys/net/if_bridge.c#3 integrate
.. //depot/projects/tty/sys/net/if_bridgevar.h#2 integrate
.. //depot/projects/tty/sys/net/if_ethersubr.c#15 integrate
.. //depot/projects/tty/sys/net80211/ieee80211.h#4 integrate
.. //depot/projects/tty/sys/net80211/ieee80211_input.c#8 integrate
.. //depot/projects/tty/sys/net80211/ieee80211_node.c#8 integrate
.. //depot/projects/tty/sys/net80211/ieee80211_output.c#8 integrate
.. //depot/projects/tty/sys/netinet/ip_dummynet.c#12 integrate
.. //depot/projects/tty/sys/netinet/ip_dummynet.h#8 integrate
.. //depot/projects/tty/sys/powerpc/powerpc/pmap.c#11 integrate
.. //depot/projects/tty/sys/security/mac/mac_system.c#4 integrate
.. //depot/projects/tty/sys/sparc64/sparc64/pmap.c#11 integrate
.. //depot/projects/tty/sys/vm/pmap.h#8 integrate
.. //depot/projects/tty/sys/vm/vm_pageq.c#9 integrate

Differences ...

==== //depot/projects/tty/lib/libpmc/libpmc.c#4 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libpmc/libpmc.c,v 1.6 2005/06/09 19:45:06 jkoshy Exp $");
+__FBSDID("$FreeBSD: src/lib/libpmc/libpmc.c,v 1.7 2005/06/10 03:45:04 jkoshy Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -139,7 +139,8 @@
 
 static int pmc_syscall = -1;		/* filled in by pmc_init() */
 
-struct pmc_op_getcpuinfo cpu_info;	/* filled in by pmc_init() */
+static struct pmc_cpuinfo cpu_info;	/* filled in by pmc_init() */
+
 
 /* Architecture dependent event parsing */
 static int (*pmc_mdep_allocate_pmc)(enum pmc_event _pe, char *_ctrspec,
@@ -1752,8 +1753,7 @@
 		return -1;
 	}
 
-	/* kernel<->library, library<->userland interfaces are identical */
-	*pci = (struct pmc_cpuinfo *) &cpu_info;
+	*pci = &cpu_info;
 	return 0;
 }
 
@@ -1893,8 +1893,10 @@
 pmc_init(void)
 {
 	int error, pmc_mod_id;
+	unsigned int n;
 	uint32_t abi_version;
 	struct module_stat pmc_modstat;
+	struct pmc_op_getcpuinfo op_cpu_info;
 
 	if (pmc_syscall != -1) /* already inited */
 		return 0;
@@ -1920,9 +1922,16 @@
 		return (pmc_syscall = -1);
 	}
 
-	if (PMC_CALL(GETCPUINFO, &cpu_info) < 0)
+	if (PMC_CALL(GETCPUINFO, &op_cpu_info) < 0)
 		return (pmc_syscall = -1);
 
+	cpu_info.pm_cputype = op_cpu_info.pm_cputype;
+	cpu_info.pm_ncpu    = op_cpu_info.pm_ncpu;
+	cpu_info.pm_npmc    = op_cpu_info.pm_npmc;
+	cpu_info.pm_nclass  = op_cpu_info.pm_nclass;
+	for (n = 0; n < cpu_info.pm_nclass; n++)
+		cpu_info.pm_classes[n] = op_cpu_info.pm_classes[n];
+
 	/* set parser pointer */
 	switch (cpu_info.pm_cputype) {
 #if defined(__i386__)

==== //depot/projects/tty/sbin/dhclient/dhclient-script#2 (text+ko) ====

@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # $OpenBSD: dhclient-script,v 1.6 2004/05/06 18:22:41 claudio Exp $
-# $FreeBSD: src/sbin/dhclient/dhclient-script,v 1.3 2005/06/08 18:21:56 brooks Exp $
+# $FreeBSD: src/sbin/dhclient/dhclient-script,v 1.4 2005/06/10 03:41:18 brooks Exp $
 #
 # Copyright (c) 2003 Kenneth R Westerback <krw@openbsd.org>
 #
@@ -186,6 +186,17 @@
 # Start of active code.
 #
 
+# Invoke the local dhcp client enter hooks, if they exist.
+if [ -f /etc/dhclient-enter-hooks ]; then
+	exit_status=0
+	. /etc/dhclient-enter-hooks
+	# allow the local script to abort processing of this state
+	# local script must set exit_status variable to nonzero.
+	if [ $exit_status -ne 0 ]; then
+		exit $exit_status
+	fi
+fi
+
 if [ -x $NETSTAT ]; then
 	if_defaulroute=`$NETSTAT -rn | $GREP "^default" | $AWK '{print $6}'`
 else

==== //depot/projects/tty/share/man/man4/dummynet.4#2 (text+ko) ====

@@ -1,5 +1,5 @@
 .\"
-.\" $FreeBSD: src/share/man/man4/dummynet.4,v 1.20 2002/11/29 11:39:19 ru Exp $
+.\" $FreeBSD: src/share/man/man4/dummynet.4,v 1.21 2005/06/10 01:25:22 thompsa Exp $
 .\"
 .Dd October 28, 2002
 .Dt DUMMYNET 4
@@ -61,6 +61,7 @@
 .Sh SEE ALSO
 .Xr setsockopt 2 ,
 .Xr bridge 4 ,
+.Xr if_bridge 4 ,
 .Xr ip 4 ,
 .Xr ipfw 8 ,
 .Xr sysctl 8

==== //depot/projects/tty/share/man/man4/if_bridge.4#3 (text+ko) ====

@@ -33,7 +33,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/if_bridge.4,v 1.2 2005/06/07 21:20:18 thompsa Exp $
+.\" $FreeBSD: src/share/man/man4/if_bridge.4,v 1.3 2005/06/10 01:25:22 thompsa Exp $
 .Dd January 4, 2004
 .Dt IF_BRIDGE 4
 .Os
@@ -107,6 +107,9 @@
 , set to 
 .Li 0
 to disable it.
+This needs to be enabled for
+.Xr dummynet 4
+support.
 When ipfw is enabled pfil_bridge and pfil_member will be disabled so that IPFW
 is not run twice, these can be re-enabled if desired.
 .El

==== //depot/projects/tty/sys/alpha/alpha/pmap.c#11 (text+ko) ====

@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.177 2005/01/05 20:05:49 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.178 2005/06/10 03:33:35 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -302,7 +302,6 @@
 
 vm_offset_t virtual_avail;	/* VA of first avail page (after kernel bss) */
 vm_offset_t virtual_end;	/* VA of last avail page (end of kernel AS) */
-static boolean_t pmap_initialized = FALSE;	/* Has pmap_init completed? */
 
 static int nklev3, nklev2;
 vm_offset_t kernel_vm_end;
@@ -554,29 +553,24 @@
 }
 
 /*
+ *	Initialize a vm_page's machine-dependent fields.
+ */
+void
+pmap_page_init(vm_page_t m)
+{
+
+	TAILQ_INIT(&m->md.pv_list);
+	m->md.pv_list_count = 0;
+}
+
+/*
  *	Initialize the pmap module.
  *	Called by vm_init, to initialize any structures that the pmap
  *	system needs to map virtual memory.
- *	pmap_init has been enhanced to support in a fairly consistant
- *	way, discontiguous physical memory.
  */
 void
 pmap_init(void)
 {
-	int i;
-
-	/*
-	 * Allocate memory for random pmap data structures.  Includes the
-	 * pv_head_table.
-	 */
-
-	for(i = 0; i < vm_page_array_size; i++) {
-		vm_page_t m;
-
-		m = &vm_page_array[i];
-		TAILQ_INIT(&m->md.pv_list);
-		m->md.pv_list_count = 0;
- 	}
 
 	/*
 	 * init the pv free list
@@ -584,11 +578,6 @@
 	pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL,
 	    NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
 	uma_prealloc(pvzone, MINPV);
-
-	/*
-	 * Now it is safe to enable pv_table recording.
-	 */
-	pmap_initialized = TRUE;
 }
 
 /*
@@ -1516,7 +1505,7 @@
 	 * XXX this makes pmap_page_protect(NONE) illegal for non-managed
 	 * pages!
 	 */
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) {
+	if (m->flags & PG_FICTITIOUS) {
 		panic("pmap_page_protect: illegal for unmanaged page, va: 0x%lx", VM_PAGE_TO_PHYS(m));
 	}
 #endif
@@ -1745,8 +1734,7 @@
 	 * raise IPL while manipulating pv_table since pmap_enter can be
 	 * called at interrupt time.
 	 */
-	if (pmap_initialized && 
-	    (m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) == 0) {
+	if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) {
 		pmap_insert_entry(pmap, va, mpte, m);
 		managed |= PG_MANAGED;
 	}
@@ -2056,7 +2044,7 @@
 	pv_entry_t pv;
 	int loops = 0;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return FALSE;
 
 	/*
@@ -2162,7 +2150,7 @@
 	pt_entry_t *pte;
 	int changed;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS) ||
+	if ((m->flags & PG_FICTITIOUS) ||
 	    (!setem && bit == (PG_UWE|PG_KWE) &&
 	     (m->flags & PG_WRITEABLE) == 0))
 		return;
@@ -2247,7 +2235,7 @@
 	pt_entry_t *pte;
 	int count;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return 0;
 
 	/*
@@ -2285,7 +2273,7 @@
 	boolean_t rv;
 
 	rv = FALSE;
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return (rv);
 
 	/*
@@ -2335,7 +2323,7 @@
 	pv_entry_t pv;
 	pt_entry_t *pte;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return;
 
 	/*
@@ -2364,7 +2352,7 @@
 	pv_entry_t pv;
 	pt_entry_t *pte;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return;
 
 	/*

==== //depot/projects/tty/sys/amd64/amd64/pmap.c#12 (text+ko) ====

@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.515 2005/02/05 19:21:54 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.516 2005/06/10 03:33:35 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -165,7 +165,6 @@
 vm_paddr_t avail_end;		/* PA of last available physical page */
 vm_offset_t virtual_avail;	/* VA of first avail page (after kernel bss) */
 vm_offset_t virtual_end;	/* VA of last avail page (end of kernel AS) */
-static boolean_t pmap_initialized = FALSE;	/* Has pmap_init completed? */
 
 static int nkpt;
 static int ndmpdp;
@@ -531,29 +530,24 @@
 }
 
 /*
+ *	Initialize a vm_page's machine-dependent fields.
+ */
+void
+pmap_page_init(vm_page_t m)
+{
+
+	TAILQ_INIT(&m->md.pv_list);
+	m->md.pv_list_count = 0;
+}
+
+/*
  *	Initialize the pmap module.
  *	Called by vm_init, to initialize any structures that the pmap
  *	system needs to map virtual memory.
- *	pmap_init has been enhanced to support in a fairly consistant
- *	way, discontiguous physical memory.
  */
 void
 pmap_init(void)
 {
-	int i;
-
-	/*
-	 * Allocate memory for random pmap data structures.  Includes the
-	 * pv_head_table.
-	 */
-
-	for(i = 0; i < vm_page_array_size; i++) {
-		vm_page_t m;
-
-		m = &vm_page_array[i];
-		TAILQ_INIT(&m->md.pv_list);
-		m->md.pv_list_count = 0;
-	}
 
 	/*
 	 * init the pv free list
@@ -561,11 +555,6 @@
 	pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL, 
 	    NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
 	uma_prealloc(pvzone, MINPV);
-
-	/*
-	 * Now it is safe to enable pv_table recording.
-	 */
-	pmap_initialized = TRUE;
 }
 
 /*
@@ -1675,7 +1664,7 @@
 	/*
 	 * XXX This makes pmap_remove_all() illegal for non-managed pages!
 	 */
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) {
+	if (m->flags & PG_FICTITIOUS) {
 		panic("pmap_remove_all: illegal for unmanaged page, va: 0x%lx",
 		    VM_PAGE_TO_PHYS(m));
 	}
@@ -1955,8 +1944,7 @@
 	 * raise IPL while manipulating pv_table since pmap_enter can be
 	 * called at interrupt time.
 	 */
-	if (pmap_initialized && 
-	    (m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) == 0) {
+	if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) {
 		pmap_insert_entry(pmap, va, m);
 		pa |= PG_MANAGED;
 	}
@@ -2449,7 +2437,7 @@
 	pv_entry_t pv;
 	int loops = 0;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return FALSE;
 
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
@@ -2567,7 +2555,7 @@
 	boolean_t rv;
 
 	rv = FALSE;
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return (rv);
 
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
@@ -2628,7 +2616,7 @@
 	register pv_entry_t pv;
 	pt_entry_t pbits, *pte;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS) ||
+	if ((m->flags & PG_FICTITIOUS) ||
 	    (bit == PG_RW && (m->flags & PG_WRITEABLE) == 0))
 		return;
 
@@ -2713,7 +2701,7 @@
 	pt_entry_t v;
 	int rtval = 0;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return (rtval);
 
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);

==== //depot/projects/tty/sys/arm/arm/pmap.c#8 (text+ko) ====

@@ -147,7 +147,7 @@
 #include "opt_vm.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.32 2005/06/07 23:04:24 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.33 2005/06/10 03:33:35 alc Exp $");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
@@ -1927,33 +1927,28 @@
 	bcopy(kernel_pmap, pmap, sizeof(*pmap));
 }
 
+/*
+ *	Initialize a vm_page's machine-dependent fields.
+ */
+void
+pmap_page_init(vm_page_t m)
+{
+
+	TAILQ_INIT(&m->md.pv_list);
+	m->md.pv_list_count = 0;
+}
 
 /*
  *      Initialize the pmap module.
  *      Called by vm_init, to initialize any structures that the pmap
  *      system needs to map virtual memory.
- *      pmap_init has been enhanced to support in a fairly consistant
- *      way, discontiguous physical memory.
  */
 void
 pmap_init(void)
 {
-	int i;
 
 	PDEBUG(1, printf("pmap_init: phys_start = %08x\n"));
-	/*
-	 * Allocate memory for random pmap data structures.  Includes the
-	 * pv_head_table.
-	 */
-
-	for(i = 0; i < vm_page_array_size; i++) {
-		vm_page_t m;
 
-		m = &vm_page_array[i];
-		TAILQ_INIT(&m->md.pv_list);
-		m->md.pv_list_count = 0;
-	}
-
 	/*
 	 * init the pv free list
 	 */
@@ -3156,7 +3151,7 @@
 	 * XXX this makes pmap_page_protect(NONE) illegal for non-managed
 	 * pages!
 	 */
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) {
+	if (m->flags & PG_FICTITIOUS) {
 		panic("pmap_page_protect: illegal for unmanaged page, va: 0x%x", VM_PAGE_TO_PHYS(m));
 	}
 #endif
@@ -4331,7 +4326,7 @@
 	int loops = 0;
 	int s;
 	
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return (FALSE);
 		
 	s = splvm();

==== //depot/projects/tty/sys/i386/i386/pmap.c#16 (text+ko) ====

@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.521 2005/02/05 19:21:54 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.522 2005/06/10 03:33:35 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -190,7 +190,6 @@
 vm_paddr_t avail_end;	/* PA of last available physical page */
 vm_offset_t virtual_avail;	/* VA of first avail page (after kernel bss) */
 vm_offset_t virtual_end;	/* VA of last avail page (end of kernel AS) */
-static boolean_t pmap_initialized = FALSE;	/* Has pmap_init completed? */
 int pgeflag = 0;		/* PG_G or-in */
 int pseflag = 0;		/* PG_PS or-in */
 
@@ -443,6 +442,17 @@
 	}
 }
 
+/*
+ * Initialize a vm_page's machine-dependent fields.
+ */
+void
+pmap_page_init(vm_page_t m)
+{
+
+	TAILQ_INIT(&m->md.pv_list);
+	m->md.pv_list_count = 0;
+}
+
 #ifdef PAE
 
 static MALLOC_DEFINE(M_PMAPPDPT, "pmap", "pmap pdpt");
@@ -460,26 +470,10 @@
  *	Initialize the pmap module.
  *	Called by vm_init, to initialize any structures that the pmap
  *	system needs to map virtual memory.
- *	pmap_init has been enhanced to support in a fairly consistant
- *	way, discontiguous physical memory.
  */
 void
 pmap_init(void)
 {
-	int i;
-
-	/*
-	 * Allocate memory for random pmap data structures.  Includes the
-	 * pv_head_table.
-	 */
-
-	for(i = 0; i < vm_page_array_size; i++) {
-		vm_page_t m;
-
-		m = &vm_page_array[i];
-		TAILQ_INIT(&m->md.pv_list);
-		m->md.pv_list_count = 0;
-	}
 
 	/*
 	 * init the pv free list
@@ -494,11 +488,6 @@
 	    UMA_ZONE_VM | UMA_ZONE_NOFREE);
 	uma_zone_set_allocf(pdptzone, pmap_pdpt_allocf);
 #endif
-
-	/*
-	 * Now it is safe to enable pv_table recording.
-	 */
-	pmap_initialized = TRUE;
 }
 
 /*
@@ -1714,7 +1703,7 @@
 	/*
 	 * XXX This makes pmap_remove_all() illegal for non-managed pages!
 	 */
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) {
+	if (m->flags & PG_FICTITIOUS) {
 		panic("pmap_remove_all: illegal for unmanaged page, va: 0x%x",
 		    VM_PAGE_TO_PHYS(m));
 	}
@@ -1997,8 +1986,7 @@
 	 * raise IPL while manipulating pv_table since pmap_enter can be
 	 * called at interrupt time.
 	 */
-	if (pmap_initialized && 
-	    (m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) == 0) {
+	if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) {
 		pmap_insert_entry(pmap, va, m);
 		pa |= PG_MANAGED;
 	}
@@ -2525,7 +2513,7 @@
 	pv_entry_t pv;
 	int loops = 0;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return FALSE;
 
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
@@ -2645,7 +2633,7 @@
 	boolean_t rv;
 
 	rv = FALSE;
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return (rv);
 
 	sched_pin();
@@ -2708,7 +2696,7 @@
 	register pv_entry_t pv;
 	pt_entry_t pbits, *pte;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS) ||
+	if ((m->flags & PG_FICTITIOUS) ||
 	    (bit == PG_RW && (m->flags & PG_WRITEABLE) == 0))
 		return;
 
@@ -2800,7 +2788,7 @@
 	pt_entry_t v;
 	int rtval = 0;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return (rtval);
 
 	sched_pin();

==== //depot/projects/tty/sys/ia64/ia64/pmap.c#14 (text+ko) ====

@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.159 2005/04/16 23:38:32 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.160 2005/06/10 03:33:36 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -154,7 +154,6 @@
 
 vm_offset_t virtual_avail;	/* VA of first avail page (after kernel bss) */
 vm_offset_t virtual_end;	/* VA of last avail page (end of kernel AS) */
-static boolean_t pmap_initialized = FALSE;	/* Has pmap_init completed? */
 
 vm_offset_t vhpt_base, vhpt_size;
 struct mtx pmap_vhptmutex;
@@ -444,31 +443,26 @@
 }
 
 /*
+ *	Initialize a vm_page's machine-dependent fields.
+ */
+void
+pmap_page_init(vm_page_t m)
+{
+
+	TAILQ_INIT(&m->md.pv_list);
+	m->md.pv_list_count = 0;
+}
+
+/*
  *	Initialize the pmap module.
  *	Called by vm_init, to initialize any structures that the pmap
  *	system needs to map virtual memory.
- *	pmap_init has been enhanced to support in a fairly consistant
- *	way, discontiguous physical memory.
  */
 void
 pmap_init(void)
 {
-	int i;
 
 	/*
-	 * Allocate memory for random pmap data structures.  Includes the
-	 * pv_head_table.
-	 */
-
-	for(i = 0; i < vm_page_array_size; i++) {
-		vm_page_t m;
-
-		m = &vm_page_array[i];
-		TAILQ_INIT(&m->md.pv_list);
-		m->md.pv_list_count = 0;
- 	}
-
-	/*
 	 * Init the pv free list and the PTE free list.
 	 */
 	pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry),
@@ -478,11 +472,6 @@
 	ptezone = uma_zcreate("PT ENTRY", sizeof (struct ia64_lpte), 
 	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM|UMA_ZONE_NOFREE);
 	uma_prealloc(ptezone, MINPV);
-
-	/*
-	 * Now it is safe to enable pv_table recording.
-	 */
-	pmap_initialized = TRUE;
 }
 
 /*
@@ -1391,7 +1380,7 @@
 	 * XXX this makes pmap_page_protect(NONE) illegal for non-managed
 	 * pages!
 	 */
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) {
+	if (m->flags & PG_FICTITIOUS) {
 		panic("pmap_page_protect: illegal for unmanaged page, va: 0x%lx", VM_PAGE_TO_PHYS(m));
 	}
 #endif
@@ -1572,8 +1561,7 @@
 	/*
 	 * Enter on the PV list if part of our managed memory.
 	 */
-	if (pmap_initialized &&
-	    (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) {
+	if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) {
 		pmap_insert_entry(pmap, va, m);
 		managed = TRUE;
 	}
@@ -1648,8 +1636,7 @@
 	/*
 	 * Enter on the PV list since its part of our managed memory.
 	 */
-	if (pmap_initialized &&
-	    (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) {
+	if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) {
 		pmap_insert_entry(pmap, va, m);
 		managed = TRUE;
 	}
@@ -1809,7 +1796,7 @@
 	int loops = 0;
 	int s;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return FALSE;
 
 	s = splvm();
@@ -1932,7 +1919,7 @@
 	pv_entry_t pv;
 	int count = 0;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return 0;
 
 	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
@@ -1965,7 +1952,7 @@
 {
 	pv_entry_t pv;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return FALSE;
 
 	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
@@ -1996,7 +1983,7 @@
 	boolean_t rv;
 
 	rv = FALSE;
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return (rv);
 
 	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
@@ -2041,7 +2028,7 @@
 	pmap_t oldpmap;
 	pv_entry_t pv;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return;
 
 	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
@@ -2071,7 +2058,7 @@
 	pmap_t oldpmap;
 	pv_entry_t pv;
 
-	if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
+	if (m->flags & PG_FICTITIOUS)
 		return;
 
 	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {

==== //depot/projects/tty/sys/kern/kern_switch.c#18 (text+ko) ====

@@ -86,7 +86,7 @@
 ***/
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_switch.c,v 1.115 2005/06/09 19:43:08 ups Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_switch.c,v 1.116 2005/06/10 03:00:29 ups Exp $");
 
 #include "opt_sched.h"
 
@@ -675,11 +675,9 @@
 	    TD_IS_INHIBITED(ctd) || td->td_kse->ke_state != KES_THREAD)
 		return (0);
 #ifndef FULL_PREEMPTION
-	if (pri > PRI_MAX_ITHD)
+	if (pri > PRI_MAX_ITHD && cpri < PRI_MIN_IDLE)
 		return (0);
 #endif
-	if (cpri >= PRI_MIN_IDLE)
-		return (0);
 
 	if (ctd->td_critnest > 1) {
 		CTR1(KTR_PROC, "maybe_preempt: in critical section %d",

==== //depot/projects/tty/sys/net/if_bridge.c#3 (text+ko) ====

@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/net/if_bridge.c,v 1.3 2005/06/07 21:20:18 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/net/if_bridge.c,v 1.4 2005/06/10 01:25:21 thompsa Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -129,7 +129,6 @@
 #include <net/route.h>
 #include <netinet/ip_fw.h>
 #include <netinet/ip_dummynet.h>
-#include <net/bridge.h>
 
 #define sc_if ifb_ac.ac_if
 /*
@@ -178,6 +177,7 @@
 extern	struct mbuf *(*bridge_input_p)(struct ifnet *, struct mbuf *);
 extern	int (*bridge_output_p)(struct ifnet *, struct mbuf *,
 		struct sockaddr *, struct rtentry *);
+extern	void (*bridge_dn_p)(struct mbuf *, struct ifnet *);
 
 int	bridge_rtable_prune_period = BRIDGE_RTABLE_PRUNE_PERIOD;
 
@@ -351,6 +351,7 @@
 		LIST_INIT(&bridge_list);
 		bridge_input_p = bridge_input;
 		bridge_output_p = bridge_output;
+		bridge_dn_p = bridge_dummynet;
 		bstp_linkstate_p = bstp_linkstate;
 		break;
 	case MOD_UNLOAD:
@@ -360,6 +361,7 @@
 		uma_zdestroy(bridge_rtnode_zone);
 		bridge_input_p = NULL;
 		bridge_output_p = NULL;
+		bridge_dn_p = NULL;
 		bstp_linkstate_p = NULL;
 		mtx_destroy(&bridge_list_mtx);
 		break;
@@ -1271,6 +1273,33 @@
 }
 
 /*
+ * bridge_dummynet:
+ *
+ * 	Receive a queued packet from dummynet and pass it on to the output
+ * 	interface.
+ *
+ *	The mbuf has the Ethernet header already attached.
+ */
+void
+bridge_dummynet(struct mbuf *m, struct ifnet *ifp)
+{
+	struct bridge_softc *sc;
+
+	sc = ifp->if_bridge;
+
+	/*
+	 * The packet didnt originate from a member interface. This should only
+	 * ever happen if a member interface is removed while packets are
+	 * queued for it.
+	 */
+	if (sc == NULL)
+		m_freem(m);
+		return;
+
+	bridge_enqueue(sc, ifp, m, 1);
+}
+
+/*
  * bridge_output:
  *
  *	Send output from a bridge member interface.  This
@@ -2195,7 +2224,7 @@
 # endif /* INET6 */
 			break;
 		default:
-			/* 
+			/*
 			 * ipfw allows layer2 protocol filtering using
 			 * 'mac-type' so we will let the packet past, if
 			 * ipfw is disabled then drop it.
@@ -2214,6 +2243,43 @@
 		m_adj(*mp, sizeof(struct llc));
 	}
 
+	if (IPFW_LOADED && pfil_ipfw != 0 && dir == PFIL_OUT) {
+		args.rule = ip_dn_claim_rule(*mp);
+		if (args.rule != NULL && fw_one_pass)
+			goto ipfwpass; /* packet already partially processed */
+
+		args.m = *mp;
+		args.oif = ifp;
+		args.next_hop = NULL;
+		args.eh = &eh2;
+		i = ip_fw_chk_ptr(&args);
+		*mp = args.m;
+
+		if (*mp == NULL)
+			return error;
+
+		if (DUMMYNET_LOADED && (i == IP_FW_DUMMYNET)) {
+
+			/* put the Ethernet header back on */
+			M_PREPEND(*mp, ETHER_HDR_LEN, M_DONTWAIT);
+			if (*mp == NULL)
+				return error;
+			bcopy(&eh2, mtod(*mp, caddr_t), ETHER_HDR_LEN);
+
+			/*
+			 * Pass the pkt to dummynet, which consumes it. The
+			 * packet will return to us via bridge_dummynet().
+			 */
+			args.oif = ifp;
+			ip_dn_io_ptr(*mp, DN_TO_IFB_FWD, &args);
+			return error;
+		}
+
+		if (i != IP_FW_PASS) /* drop */
+			goto bad;
+	}
+
+ipfwpass:
 	/*
 	 * Check basic packet sanity and run pfil through pfil.
 	 */
@@ -2246,10 +2312,16 @@
 			error = pfil_run_hooks(&inet_pfil_hook, mp, bifp,
 					dir, NULL);
 
+		if (*mp == NULL) /* filter may consume */
+			break;
+
 		if (error == 0 && pfil_member)
 			error = pfil_run_hooks(&inet_pfil_hook, mp, ifp,
 					dir, NULL);
 
+		if (*mp == NULL) /* filter may consume */
+			break;
+
 		if (error == 0 && pfil_bridge && dir == PFIL_IN)
 			error = pfil_run_hooks(&inet_pfil_hook, mp, bifp,
 					dir, NULL);
@@ -2270,10 +2342,16 @@
 			error = pfil_run_hooks(&inet6_pfil_hook, mp, bifp,
 					dir, NULL);
 
+		if (*mp == NULL) /* filter may consume */
+			break;
+
 		if (error == 0 && pfil_member)
 			error = pfil_run_hooks(&inet6_pfil_hook, mp, ifp,
 					dir, NULL);
 
+		if (*mp == NULL) /* filter may consume */
+			break;
+
 		if (error == 0 && pfil_bridge && dir == PFIL_IN)
 			error = pfil_run_hooks(&inet6_pfil_hook, mp, bifp,
 					dir, NULL);
@@ -2291,22 +2369,6 @@
 
 	error = -1;
 
-	if (IPFW_LOADED && pfil_ipfw != 0) {
-		args.m = *mp;
-		args.oif = NULL;
-		args.next_hop = NULL;
-		args.rule = NULL;

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506100517.j5A5HNhC013330>