PERFORCE change 103050 for review

John Baldwin jhb at FreeBSD.org
Wed Aug 2 18:10:41 UTC 2006


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

Change 103050 by jhb at jhb_mutex on 2006/08/02 18:10:24

	IFC @103046.

Affected files ...

.. //depot/projects/smpng/sys/amd64/amd64/pmap.c#65 integrate
.. //depot/projects/smpng/sys/amd64/include/pmap.h#23 integrate
.. //depot/projects/smpng/sys/arm/arm/pmap.c#32 integrate
.. //depot/projects/smpng/sys/conf/files.powerpc#31 integrate
.. //depot/projects/smpng/sys/ddb/db_ps.c#36 integrate
.. //depot/projects/smpng/sys/dev/dc/dcphy.c#4 integrate
.. //depot/projects/smpng/sys/dev/dc/pnphy.c#3 integrate
.. //depot/projects/smpng/sys/dev/powermac_nvram/powermac_nvram.c#1 branch
.. //depot/projects/smpng/sys/dev/powermac_nvram/powermac_nvramvar.h#1 branch
.. //depot/projects/smpng/sys/dev/ral/rt2560.c#5 integrate
.. //depot/projects/smpng/sys/dev/sk/if_sk.c#6 integrate
.. //depot/projects/smpng/sys/dev/ubsec/ubsec.c#21 integrate
.. //depot/projects/smpng/sys/dev/usb/if_ural.c#18 integrate
.. //depot/projects/smpng/sys/geom/mirror/g_mirror.c#32 integrate
.. //depot/projects/smpng/sys/geom/raid3/g_raid3.c#33 integrate
.. //depot/projects/smpng/sys/i386/i386/pmap.c#105 integrate
.. //depot/projects/smpng/sys/ia64/ia64/pmap.c#80 integrate
.. //depot/projects/smpng/sys/kern/init_sysent.c#73 integrate
.. //depot/projects/smpng/sys/kern/kern_time.c#43 integrate
.. //depot/projects/smpng/sys/kern/makesyscalls.sh#20 integrate
.. //depot/projects/smpng/sys/kern/syscalls.c#73 integrate
.. //depot/projects/smpng/sys/kern/uipc_sockbuf.c#3 integrate
.. //depot/projects/smpng/sys/kern/uipc_socket.c#90 integrate
.. //depot/projects/smpng/sys/kern/uipc_socket2.c#57 integrate
.. //depot/projects/smpng/sys/kern/uipc_usrreq.c#65 integrate
.. //depot/projects/smpng/sys/kern/vfs_syscalls.c#115 integrate
.. //depot/projects/smpng/sys/modules/Makefile#127 integrate
.. //depot/projects/smpng/sys/modules/powermac_nvram/Makefile#1 branch
.. //depot/projects/smpng/sys/net/bridgestp.c#10 integrate
.. //depot/projects/smpng/sys/net/bridgestp.h#3 integrate
.. //depot/projects/smpng/sys/net/if_bridge.c#36 integrate
.. //depot/projects/smpng/sys/netatalk/ddp_pcb.c#8 integrate
.. //depot/projects/smpng/sys/netinet/ip_fw2.c#75 integrate
.. //depot/projects/smpng/sys/netinet/tcp_subr.c#81 integrate
.. //depot/projects/smpng/sys/powerpc/conf/GENERIC#37 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/intr_machdep.c#8 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/mmu_if.m#6 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/mmu_oea.c#7 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/pmap_dispatch.c#6 integrate
.. //depot/projects/smpng/sys/sparc64/sparc64/pmap.c#66 integrate
.. //depot/projects/smpng/sys/sys/syscall.h#72 integrate
.. //depot/projects/smpng/sys/sys/syscall.mk#72 integrate
.. //depot/projects/smpng/sys/sys/sysproto.h#75 integrate
.. //depot/projects/smpng/sys/vm/pmap.h#33 integrate
.. //depot/projects/smpng/sys/vm/vm_object.c#83 integrate
.. //depot/projects/smpng/sys/vm/vm_page.c#80 integrate
.. //depot/projects/smpng/sys/vm/vm_pageout.c#58 integrate

Differences ...

==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#65 (text+ko) ====

@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.567 2006/07/20 17:48:40 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.568 2006/08/01 19:06:04 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -2972,7 +2972,7 @@
  * Clear the write and modified bits in each of the given page's mappings.
  */
 void
-pmap_clear_write(vm_page_t m)
+pmap_remove_write(vm_page_t m)
 {
 	pv_entry_t pv;
 	pmap_t pmap;
@@ -3002,23 +3002,6 @@
 }
 
 /*
- *      pmap_page_protect:
- *
- *      Lower the permission for all mappings to a given page.
- */
-void
-pmap_page_protect(vm_page_t m, vm_prot_t prot)
-{
-	if ((prot & VM_PROT_WRITE) == 0) {
-		if (prot & (VM_PROT_READ | VM_PROT_EXECUTE)) {
-			pmap_clear_write(m);
-		} else {
-			pmap_remove_all(m);
-		}
-	}
-}
-
-/*
  *	pmap_ts_referenced:
  *
  *	Return a count of reference bits for a page, clearing those bits.

==== //depot/projects/smpng/sys/amd64/include/pmap.h#23 (text+ko) ====

@@ -39,7 +39,7 @@
  *
  *	from: hp300: @(#)pmap.h	7.2 (Berkeley) 12/16/90
  *	from: @(#)pmap.h	7.4 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.132 2006/05/01 22:07:00 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.133 2006/08/02 16:24:23 alc Exp $
  */
 
 #ifndef _MACHINE_PMAP_H_
@@ -81,6 +81,8 @@
 #define PGEX_P		0x01	/* Protection violation vs. not present */
 #define PGEX_W		0x02	/* during a Write cycle */
 #define PGEX_U		0x04	/* access from User mode (UPL) */
+#define PGEX_RSV	0x08	/* reserved PTE field is non-zero */
+#define PGEX_I		0x10	/* during an instruction fetch */
 
 /*
  * Pte related macros.  This is complicated by having to deal with

==== //depot/projects/smpng/sys/arm/arm/pmap.c#32 (text+ko) ====

@@ -147,7 +147,7 @@
 #include "opt_vm.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.66 2006/07/20 23:26:22 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.67 2006/08/01 19:06:04 alc Exp $");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
@@ -2759,32 +2759,6 @@
 
 
 /*
- *      pmap_page_protect:
- *
- *      Lower the permission for all mappings to a given page.
- */
-void
-pmap_page_protect(vm_page_t m, vm_prot_t prot)
-{
-	switch(prot) {
-	case VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE:
-	case VM_PROT_READ|VM_PROT_WRITE:
-		return;
-
-	case VM_PROT_READ:
-	case VM_PROT_READ|VM_PROT_EXECUTE:
-		pmap_clearbit(m, PVF_WRITE);
-		break;
-
-	default:
-		pmap_remove_all(m);
-		break;
-	}
-
-}
-
-
-/*
  * Remove all pages from specified address space
  * this aids process exit speeds.  Also, this code
  * is special cased for current process only, but
@@ -4464,7 +4438,7 @@
  * Clear the write and modified bits in each of the given page's mappings.
  */
 void
-pmap_clear_write(vm_page_t m)
+pmap_remove_write(vm_page_t m)
 {
 
 	if (m->md.pvh_attrs & PVF_WRITE)

==== //depot/projects/smpng/sys/conf/files.powerpc#31 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.powerpc,v 1.56 2006/07/26 19:44:42 marcel Exp $
+# $FreeBSD: src/sys/conf/files.powerpc,v 1.57 2006/08/01 22:19:01 sobomax Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -128,3 +128,5 @@
 powerpc/psim/uart_iobus.c	optional uart psim
 
 dev/scc/scc_bfe_macio.c		optional	scc powermac
+
+dev/powermac_nvram/powermac_nvram.c optional	powermac powermac_nvram

==== //depot/projects/smpng/sys/ddb/db_ps.c#36 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ddb/db_ps.c,v 1.62 2006/08/01 15:29:46 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/ddb/db_ps.c,v 1.63 2006/08/01 22:30:55 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/cons.h>
@@ -57,10 +57,10 @@
  *
  *          1         2         3         4         5         6         7
  * 1234567890123456789012345678901234567890123456789012345678901234567890
- *   pid  ppid  pgrp   uid  state   wmesg      wchan    cmd
- * <pid> <ppi> <pgi> <uid> <stat> < wmesg > <  wchan  > <name>
- * <pid> <ppi> <pgi> <uid> <stat>  (threaded)           <command>
- *  <tid    >              <stat> < wmesg > <  wchan  > <name>
+ *   pid  ppid  pgrp   uid   state   wmesg     wchan    cmd
+ * <pid> <ppi> <pgi> <uid>  <stat> < wmesg > < wchan  > <name>
+ * <pid> <ppi> <pgi> <uid>  <stat>  (threaded)          <command>
+ * <tid >                   <stat> < wmesg > < wchan  > <name>
  *
  * For machines with 64-bit pointers, we expand the wchan field 8 more
  * characters.
@@ -83,9 +83,9 @@
 		p = &proc0;
 
 #ifdef __LP64__
-	db_printf("  pid  ppid  pgrp   uid  state   wmesg          wchan        cmd\n");
+	db_printf("  pid  ppid  pgrp   uid   state   wmesg         wchan        cmd\n");
 #else
-	db_printf("  pid  ppid  pgrp   uid  state   wmesg      wchan    cmd\n");
+	db_printf("  pid  ppid  pgrp   uid   state   wmesg     wchan    cmd\n");
 #endif
 	while (--np >= 0 && !db_pager_quit) {
 		if (p == NULL) {

==== //depot/projects/smpng/sys/dev/dc/dcphy.c#4 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/dc/dcphy.c,v 1.31 2006/06/03 20:37:56 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/dc/dcphy.c,v 1.32 2006/08/02 05:28:52 yongari Exp $");
 
 /*
  * Pseudo-driver for internal NWAY support on DEC 21143 and workalike
@@ -131,7 +131,7 @@
 
 	device_set_desc(dev, "Intel 21143 NWAY media interface");
 
-	return (0);
+	return (BUS_PROBE_DEFAULT);
 }
 
 static int

==== //depot/projects/smpng/sys/dev/dc/pnphy.c#3 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/dc/pnphy.c,v 1.20 2005/10/18 06:09:42 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/dc/pnphy.c,v 1.21 2006/08/02 05:28:52 yongari Exp $");
 
 /*
  * Pseudo-driver for media selection on the Lite-On PNIC 82c168
@@ -116,7 +116,7 @@
 
 	device_set_desc(dev, "PNIC 82c168 media interface");
 
-	return (0);
+	return (BUS_PROBE_DEFAULT);
 }
 
 static int

==== //depot/projects/smpng/sys/dev/ral/rt2560.c#5 (text) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/dev/ral/rt2560.c,v 1.6 2006/07/26 03:30:22 sam Exp $	*/
+/*	$FreeBSD: src/sys/dev/ral/rt2560.c,v 1.7 2006/08/02 04:54:14 sam Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ral/rt2560.c,v 1.6 2006/07/26 03:30:22 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ral/rt2560.c,v 1.7 2006/08/02 04:54:14 sam Exp $");
 
 /*-
  * Ralink Technology RT2560 chipset driver
@@ -2842,8 +2842,7 @@
 	return 0;
 bad:
 	ifp->if_oerrors++;
-	if (ni != NULL)
-		ieee80211_free_node(ni);
+	ieee80211_free_node(ni);
 	RAL_UNLOCK(sc);
 	return EIO;		/* XXX */
 }

==== //depot/projects/smpng/sys/dev/sk/if_sk.c#6 (text) ====

@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/sk/if_sk.c,v 1.128 2006/07/27 05:06:43 yongari Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/sk/if_sk.c,v 1.129 2006/08/02 02:36:59 yongari Exp $");
 
 /*
  * SysKonnect SK-NET gigabit ethernet driver for FreeBSD. Supports
@@ -140,7 +140,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-  "$FreeBSD: src/sys/dev/sk/if_sk.c,v 1.128 2006/07/27 05:06:43 yongari Exp $";
+  "$FreeBSD: src/sys/dev/sk/if_sk.c,v 1.129 2006/08/02 02:36:59 yongari Exp $";
 #endif
 
 static struct sk_type sk_devs[] = {
@@ -793,13 +793,11 @@
 
 	for (i = 0; i < SK_TIMEOUT; i++) {
 		DELAY(1);
-		if (SK_YU_READ_2(sc_if, YUKON_SMICR) & YU_SMICR_BUSY)
+		if ((SK_YU_READ_2(sc_if, YUKON_SMICR) & YU_SMICR_BUSY) == 0)
 			break;
 	}
-	if (i == SK_TIMEOUT) {
+	if (i == SK_TIMEOUT)
 		if_printf(sc_if->sk_ifp, "phy write timeout\n");
-		return (0);
-	}
 
 	return(0);
 }

==== //depot/projects/smpng/sys/dev/ubsec/ubsec.c#21 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.44 2006/06/06 13:58:12 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.45 2006/08/02 17:41:58 jhb Exp $");
 
 /*
  * uBsec 5[56]01, 58xx hardware crypto accelerator
@@ -1369,57 +1369,46 @@
 
 				ubsecstats.hst_unaligned++;
 				totlen = q->q_src_mapsize;
-				if (q->q_src_m->m_flags & M_PKTHDR) {
+				if (totlen >= MINCLSIZE) {
+					m = m_getcl(M_DONTWAIT, MT_DATA,
+					    q->q_src_m->m_flags & M_PKTHDR);
+					len = MCLBYTES;
+				} else if (q->q_src_m->m_flags & M_PKTHDR) {
+					m = m_gethdr(M_DONTWAIT, MT_DATA);
 					len = MHLEN;
-					MGETHDR(m, M_DONTWAIT, MT_DATA);
-					if (m && !m_dup_pkthdr(m, q->q_src_m, M_DONTWAIT)) {
-						m_free(m);
-						m = NULL;
-					}
 				} else {
+					m = m_get(M_DONTWAIT, MT_DATA);
 					len = MLEN;
-					MGET(m, M_DONTWAIT, MT_DATA);
+				}
+				if (m && q->q_src_m->m_flags & M_PKTHDR &&
+				    !m_dup_pkthdr(m, q->q_src_m, M_DONTWAIT)) {
+					m_free(m);
+					m = NULL;
 				}
 				if (m == NULL) {
 					ubsecstats.hst_nombuf++;
 					err = sc->sc_nqueue ? ERESTART : ENOMEM;
 					goto errout;
 				}
-				if (totlen >= MINCLSIZE) {
-					MCLGET(m, M_DONTWAIT);
-					if ((m->m_flags & M_EXT) == 0) {
-						m_free(m);
-						ubsecstats.hst_nomcl++;
-						err = sc->sc_nqueue ? ERESTART : ENOMEM;
-						goto errout;
-					}
-					len = MCLBYTES;
-				}
-				m->m_len = len;
-				top = NULL;
+				m->m_len = len = min(totlen, len);
+				totlen -= len;
+				top = m;
 				mp = &top;
 
 				while (totlen > 0) {
-					if (top) {
-						MGET(m, M_DONTWAIT, MT_DATA);
-						if (m == NULL) {
-							m_freem(top);
-							ubsecstats.hst_nombuf++;
-							err = sc->sc_nqueue ? ERESTART : ENOMEM;
-							goto errout;
-						}
+					if (totlen >= MINCLSIZE) {
+						m = m_getcl(M_DONTWAIT,
+						    MT_DATA, 0);
+						len = MCLBYTES;
+					} else {
+						m = m_get(M_DONTWAIT, MT_DATA);
 						len = MLEN;
 					}
-					if (top && totlen >= MINCLSIZE) {
-						MCLGET(m, M_DONTWAIT);
-						if ((m->m_flags & M_EXT) == 0) {
-							*mp = m;
-							m_freem(top);
-							ubsecstats.hst_nomcl++;
-							err = sc->sc_nqueue ? ERESTART : ENOMEM;
-							goto errout;
-						}
-						len = MCLBYTES;
+					if (m == NULL) {
+						m_freem(top);
+						ubsecstats.hst_nombuf++;
+						err = sc->sc_nqueue ? ERESTART : ENOMEM;
+						goto errout;
 					}
 					m->m_len = len = min(totlen, len);
 					totlen -= len;

==== //depot/projects/smpng/sys/dev/usb/if_ural.c#18 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/dev/usb/if_ural.c,v 1.42 2006/07/26 03:30:50 sam Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/if_ural.c,v 1.43 2006/08/02 04:55:04 sam Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/if_ural.c,v 1.42 2006/07/26 03:30:50 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/if_ural.c,v 1.43 2006/08/02 04:55:04 sam Exp $");
 
 /*-
  * Ralink Technology RT2500USB chipset driver
@@ -2361,8 +2361,7 @@
 	return 0;
 bad:
 	ifp->if_oerrors++;
-	if (ni != NULL)
-		ieee80211_free_node(ni);
+	ieee80211_free_node(ni);
 	return EIO;		/* XXX */
 }
 

==== //depot/projects/smpng/sys/geom/mirror/g_mirror.c#32 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/mirror/g_mirror.c,v 1.85 2006/07/10 21:18:00 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/mirror/g_mirror.c,v 1.86 2006/08/01 23:17:33 pjd Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2077,7 +2077,7 @@
 		 * Not good, NOT GOOD!
 		 * It means that mirror was started on stale disks
 		 * and more fresh disk just arrive.
-		 * If there were writes, mirror is fucked up, sorry.
+		 * If there were writes, mirror is broken, sorry.
 		 * I think the best choice here is don't touch
 		 * this disk and inform the user laudly.
 		 */

==== //depot/projects/smpng/sys/geom/raid3/g_raid3.c#33 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/raid3/g_raid3.c,v 1.69 2006/07/10 21:18:00 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/raid3/g_raid3.c,v 1.70 2006/08/01 23:17:33 pjd Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2351,7 +2351,7 @@
 		 * Not good, NOT GOOD!
 		 * It means that device was started on stale disks
 		 * and more fresh disk just arrive.
-		 * If there were writes, device is fucked up, sorry.
+		 * If there were writes, device is broken, sorry.
 		 * I think the best choice here is don't touch
 		 * this disk and inform the user laudly.
 		 */

==== //depot/projects/smpng/sys/i386/i386/pmap.c#105 (text+ko) ====

@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.571 2006/07/20 17:48:40 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.572 2006/08/01 19:06:05 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -3066,7 +3066,7 @@
  * Clear the write and modified bits in each of the given page's mappings.
  */
 void
-pmap_clear_write(vm_page_t m)
+pmap_remove_write(vm_page_t m)
 {
 	pv_entry_t pv;
 	pmap_t pmap;
@@ -3103,23 +3103,6 @@
 }
 
 /*
- *      pmap_page_protect:
- *
- *      Lower the permission for all mappings to a given page.
- */
-void
-pmap_page_protect(vm_page_t m, vm_prot_t prot)
-{
-	if ((prot & VM_PROT_WRITE) == 0) {
-		if (prot & (VM_PROT_READ | VM_PROT_EXECUTE)) {
-			pmap_clear_write(m);
-		} else {
-			pmap_remove_all(m);
-		}
-	}
-}
-
-/*
  *	pmap_ts_referenced:
  *
  *	Return a count of reference bits for a page, clearing those bits.

==== //depot/projects/smpng/sys/ia64/ia64/pmap.c#80 (text+ko) ====

@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.177 2006/06/27 05:05:05 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.178 2006/08/01 19:06:05 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -1939,40 +1939,6 @@
 }
 
 /*
- *      pmap_page_protect:
- *
- *      Lower the permission for all mappings to a given page.
- */
-void
-pmap_page_protect(vm_page_t m, vm_prot_t prot)
-{
-	struct ia64_lpte *pte;
-	pmap_t oldpmap, pmap;
-	pv_entry_t pv;
-
-	if ((prot & VM_PROT_WRITE) != 0)
-		return;
-	if (prot & (VM_PROT_READ | VM_PROT_EXECUTE)) {
-		if ((m->flags & PG_WRITEABLE) == 0)
-			return;
-		TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
-			pmap = pv->pv_pmap;
-			PMAP_LOCK(pmap);
-			oldpmap = pmap_install(pmap);
-			pte = pmap_find_vhpt(pv->pv_va);
-			KASSERT(pte != NULL, ("pte"));
-			pmap_pte_prot(pmap, pte, prot);
-			pmap_invalidate_page(pmap, pv->pv_va);
-			pmap_install(oldpmap);
-			PMAP_UNLOCK(pmap);
-		}
-		vm_page_flag_clear(m, PG_WRITEABLE);
-	} else {
-		pmap_remove_all(m);
-	}
-}
-
-/*
  *	pmap_ts_referenced:
  *
  *	Return a count of reference bits for a page, clearing those bits.
@@ -2119,6 +2085,43 @@
 }
 
 /*
+ * Clear the write and modified bits in each of the given page's mappings.
+ */
+void
+pmap_remove_write(vm_page_t m)
+{
+	struct ia64_lpte *pte;
+	pmap_t oldpmap, pmap;
+	pv_entry_t pv;
+	vm_prot_t prot;
+
+	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	if ((m->flags & PG_FICTITIOUS) != 0 ||
+	    (m->flags & PG_WRITEABLE) == 0)
+		return;
+	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
+		pmap = pv->pv_pmap;
+		PMAP_LOCK(pmap);
+		oldpmap = pmap_install(pmap);
+		pte = pmap_find_vhpt(pv->pv_va);
+		KASSERT(pte != NULL, ("pte"));
+		prot = pmap_prot(pte);
+		if ((prot & VM_PROT_WRITE) != 0) {
+			if (pmap_dirty(pte)) {
+				vm_page_dirty(m);
+				pmap_clear_dirty(pte);
+			}
+			prot &= ~VM_PROT_WRITE;
+			pmap_pte_prot(pmap, pte, prot);
+			pmap_invalidate_page(pmap, pv->pv_va);
+		}
+		pmap_install(oldpmap);
+		PMAP_UNLOCK(pmap);
+	}
+	vm_page_flag_clear(m, PG_WRITEABLE);
+}
+
+/*
  * Map a set of physical memory pages into the kernel virtual
  * address space. Return a pointer to where it is mapped. This
  * routine is intended to be used for mapping device memory,

==== //depot/projects/smpng/sys/kern/init_sysent.c#73 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/init_sysent.c,v 1.215 2006/07/28 19:08:36 jhb Exp $
+ * $FreeBSD: src/sys/kern/init_sysent.c,v 1.216 2006/08/02 08:14:01 davidxu Exp $
  * created from FreeBSD: src/sys/kern/syscalls.master,v 1.221 2006/07/28 19:05:28 jhb Exp 
  */
 

==== //depot/projects/smpng/sys/kern/kern_time.c#43 (text+ko) ====

@@ -30,12 +30,13 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_time.c,v 1.129 2006/03/01 06:29:34 davidxu Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_time.c,v 1.130 2006/08/02 07:34:51 davidxu Exp $");
 
 #include "opt_mac.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/limits.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
 #include <sys/sysproto.h>

==== //depot/projects/smpng/sys/kern/makesyscalls.sh#20 (text+ko) ====

@@ -1,6 +1,6 @@
 #! /bin/sh -
 #	@(#)makesyscalls.sh	8.1 (Berkeley) 6/10/93
-# $FreeBSD: src/sys/kern/makesyscalls.sh,v 1.63 2006/07/28 19:05:28 jhb Exp $
+# $FreeBSD: src/sys/kern/makesyscalls.sh,v 1.64 2006/08/02 08:09:24 davidxu Exp $
 
 set -e
 
@@ -119,9 +119,7 @@
 		printf "#define\t%s\n\n", sysproto_h > sysarg
 		printf "#include <sys/signal.h>\n" > sysarg
 		printf "#include <sys/acl.h>\n" > sysarg
-		printf "#include <sys/thr.h>\n" > sysarg
-		printf "#include <sys/umtx.h>\n" > sysarg
-		printf "#include <posix4/_semaphore.h>\n\n" > sysarg
+		printf "#include <posix4/_semaphore.h>\n" > sysarg
 		printf "#include <sys/ucontext.h>\n\n" > sysarg
 		printf "#include <bsm/audit_kevents.h>\n\n" > sysarg
 		printf "struct proc;\n\n" > sysarg

==== //depot/projects/smpng/sys/kern/syscalls.c#73 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/syscalls.c,v 1.199 2006/07/28 19:08:37 jhb Exp $
+ * $FreeBSD: src/sys/kern/syscalls.c,v 1.200 2006/08/02 08:14:01 davidxu Exp $
  * created from FreeBSD: src/sys/kern/syscalls.master,v 1.221 2006/07/28 19:05:28 jhb Exp 
  */
 

==== //depot/projects/smpng/sys/kern/uipc_sockbuf.c#3 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/uipc_sockbuf.c,v 1.163 2006/08/01 10:30:26 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/uipc_sockbuf.c,v 1.164 2006/08/02 13:01:58 rwatson Exp $");
 
 #include "opt_param.h"
 
@@ -64,22 +64,21 @@
 
 static	u_long sb_efficiency = 8;	/* parameter for sbreserve() */
 
-static void	sbdrop_internal(register struct sockbuf *sb, register int len);
-static void	sbflush_internal(register struct sockbuf *sb);
+static void	sbdrop_internal(struct sockbuf *sb, int len);
+static void	sbflush_internal(struct sockbuf *sb);
 static void	sbrelease_internal(struct sockbuf *sb, struct socket *so);
 
 /*
- * Socantsendmore indicates that no more data will be sent on the
- * socket; it would normally be applied to a socket when the user
- * informs the system that no more data is to be sent, by the protocol
- * code (in case PRU_SHUTDOWN).  Socantrcvmore indicates that no more data
- * will be received, and will normally be applied to the socket by a
- * protocol when it detects that the peer will send no more data.
- * Data queued for reading in the socket may yet be read.
+ * Socantsendmore indicates that no more data will be sent on the socket; it
+ * would normally be applied to a socket when the user informs the system
+ * that no more data is to be sent, by the protocol code (in case
+ * PRU_SHUTDOWN).  Socantrcvmore indicates that no more data will be
+ * received, and will normally be applied to the socket by a protocol when it
+ * detects that the peer will send no more data.  Data queued for reading in
+ * the socket may yet be read.
  */
 void
-socantsendmore_locked(so)
-	struct socket *so;
+socantsendmore_locked(struct socket *so)
 {
 
 	SOCKBUF_LOCK_ASSERT(&so->so_snd);
@@ -90,8 +89,7 @@
 }
 
 void
-socantsendmore(so)
-	struct socket *so;
+socantsendmore(struct socket *so)
 {
 
 	SOCKBUF_LOCK(&so->so_snd);
@@ -100,8 +98,7 @@
 }
 
 void
-socantrcvmore_locked(so)
-	struct socket *so;
+socantrcvmore_locked(struct socket *so)
 {
 
 	SOCKBUF_LOCK_ASSERT(&so->so_rcv);
@@ -112,8 +109,7 @@
 }
 
 void
-socantrcvmore(so)
-	struct socket *so;
+socantrcvmore(struct socket *so)
 {
 
 	SOCKBUF_LOCK(&so->so_rcv);
@@ -125,8 +121,7 @@
  * Wait for data to arrive at/drain from a socket buffer.
  */
 int
-sbwait(sb)
-	struct sockbuf *sb;
+sbwait(struct sockbuf *sb)
 {
 
 	SOCKBUF_LOCK_ASSERT(sb);
@@ -138,12 +133,11 @@
 }
 
 /*
- * Lock a sockbuf already known to be locked;
- * return any error returned from sleep (EINTR).
+ * Lock a sockbuf already known to be locked; return any error returned from
+ * sleep (EINTR).
  */
 int
-sb_lock(sb)
-	register struct sockbuf *sb;
+sb_lock(struct sockbuf *sb)
 {
 	int error;
 
@@ -162,8 +156,8 @@
 }
 
 /*
- * Wakeup processes waiting on a socket buffer.  Do asynchronous
- * notification via SIGIO if the socket has the SS_ASYNC flag set.
+ * Wakeup processes waiting on a socket buffer.  Do asynchronous notification
+ * via SIGIO if the socket has the SS_ASYNC flag set.
  *
  * Called with the socket buffer lock held; will release the lock by the end
  * of the function.  This allows the caller to acquire the socket buffer lock
@@ -174,9 +168,7 @@
  * correct.
  */
 void
-sowakeup(so, sb)
-	register struct socket *so;
-	register struct sockbuf *sb;
+sowakeup(struct socket *so, struct sockbuf *sb)
 {
 
 	SOCKBUF_LOCK_ASSERT(sb);
@@ -201,39 +193,36 @@
 /*
  * Socket buffer (struct sockbuf) utility routines.
  *
- * Each socket contains two socket buffers: one for sending data and
- * one for receiving data.  Each buffer contains a queue of mbufs,
- * information about the number of mbufs and amount of data in the
- * queue, and other fields allowing select() statements and notification
- * on data availability to be implemented.
+ * Each socket contains two socket buffers: one for sending data and one for
+ * receiving data.  Each buffer contains a queue of mbufs, information about
+ * the number of mbufs and amount of data in the queue, and other fields
+ * allowing select() statements and notification on data availability to be
+ * implemented.
  *
- * Data stored in a socket buffer is maintained as a list of records.
- * Each record is a list of mbufs chained together with the m_next
- * field.  Records are chained together with the m_nextpkt field. The upper
- * level routine soreceive() expects the following conventions to be
- * observed when placing information in the receive buffer:
+ * Data stored in a socket buffer is maintained as a list of records.  Each
+ * record is a list of mbufs chained together with the m_next field.  Records
+ * are chained together with the m_nextpkt field. The upper level routine
+ * soreceive() expects the following conventions to be observed when placing
+ * information in the receive buffer:
  *
- * 1. If the protocol requires each message be preceded by the sender's
- *    name, then a record containing that name must be present before
- *    any associated data (mbuf's must be of type MT_SONAME).
- * 2. If the protocol supports the exchange of ``access rights'' (really
- *    just additional data associated with the message), and there are
- *    ``rights'' to be received, then a record containing this data
- *    should be present (mbuf's must be of type MT_RIGHTS).
- * 3. If a name or rights record exists, then it must be followed by
- *    a data record, perhaps of zero length.
+ * 1. If the protocol requires each message be preceded by the sender's name,
+ *    then a record containing that name must be present before any
+ *    associated data (mbuf's must be of type MT_SONAME).
+ * 2. If the protocol supports the exchange of ``access rights'' (really just
+ *    additional data associated with the message), and there are ``rights''
+ *    to be received, then a record containing this data should be present
+ *    (mbuf's must be of type MT_RIGHTS).
+ * 3. If a name or rights record exists, then it must be followed by a data
+ *    record, perhaps of zero length.
  *
  * Before using a new socket structure it is first necessary to reserve
  * buffer space to the socket, by calling sbreserve().  This should commit
  * some of the available buffer space in the system buffer pool for the
- * socket (currently, it does nothing but enforce limits).  The space
- * should be released by calling sbrelease() when the socket is destroyed.
+ * socket (currently, it does nothing but enforce limits).  The space should
+ * be released by calling sbrelease() when the socket is destroyed.
  */
-
 int
-soreserve(so, sndcc, rcvcc)
-	register struct socket *so;
-	u_long sndcc, rcvcc;
+soreserve(struct socket *so, u_long sndcc, u_long rcvcc)
 {
 	struct thread *td = curthread;
 
@@ -281,24 +270,22 @@
 }
 	
 /*
- * Allot mbufs to a sockbuf.
- * Attempt to scale mbmax so that mbcnt doesn't become limiting
- * if buffering efficiency is near the normal case.
+ * Allot mbufs to a sockbuf.  Attempt to scale mbmax so that mbcnt doesn't
+ * become limiting if buffering efficiency is near the normal case.
  */
 int
-sbreserve_locked(sb, cc, so, td)
-	struct sockbuf *sb;
-	u_long cc;
-	struct socket *so;
-	struct thread *td;
+sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so,
+    struct thread *td)
 {
 	rlim_t sbsize_limit;
 
 	SOCKBUF_LOCK_ASSERT(sb);
 
 	/*
-	 * td will only be NULL when we're in an interrupt
-	 * (e.g. in tcp_input())
+	 * td will only be NULL when we're in an interrupt (e.g. in
+	 * tcp_input()).
+	 *
+	 * XXXRW: This comment needs updating, as might the code.
 	 */
 	if (cc > sb_max_adj)
 		return (0);
@@ -318,11 +305,8 @@
 }
 
 int
-sbreserve(sb, cc, so, td)
-	struct sockbuf *sb;
-	u_long cc;
-	struct socket *so;
-	struct thread *td;
+sbreserve(struct sockbuf *sb, u_long cc, struct socket *so, 
+    struct thread *td)
 {
 	int error;
 
@@ -336,9 +320,7 @@
  * Free mbufs held by a socket, and reserved mbuf space.
  */
 static void
-sbrelease_internal(sb, so)
-	struct sockbuf *sb;
-	struct socket *so;
+sbrelease_internal(struct sockbuf *sb, struct socket *so)
 {
 
 	sbflush_internal(sb);
@@ -348,9 +330,7 @@
 }
 
 void
-sbrelease_locked(sb, so)
-	struct sockbuf *sb;
-	struct socket *so;
+sbrelease_locked(struct sockbuf *sb, struct socket *so)
 {
 
 	SOCKBUF_LOCK_ASSERT(sb);
@@ -359,9 +339,7 @@
 }
 
 void
-sbrelease(sb, so)
-	struct sockbuf *sb;
-	struct socket *so;
+sbrelease(struct sockbuf *sb, struct socket *so)
 {
 
 	SOCKBUF_LOCK(sb);
@@ -370,9 +348,7 @@
 }
 
 void
-sbdestroy(sb, so)
-	struct sockbuf *sb;
-	struct socket *so;
+sbdestroy(struct sockbuf *sb, struct socket *so)
 {
 
 	sbrelease_internal(sb, so);
@@ -380,30 +356,27 @@
 
 
 /*
- * Routines to add and remove
- * data from an mbuf queue.
+ * Routines to add and remove data from an mbuf queue.
  *
- * The routines sbappend() or sbappendrecord() are normally called to
- * append new mbufs to a socket buffer, after checking that adequate
- * space is available, comparing the function sbspace() with the amount
- * of data to be added.  sbappendrecord() differs from sbappend() in
- * that data supplied is treated as the beginning of a new record.

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


More information about the p4-projects mailing list