PERFORCE change 103745 for review

Warner Losh imp at FreeBSD.org
Sun Aug 13 04:17:33 UTC 2006


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

Change 103745 by imp at imp_paco-paco on 2006/08/13 04:17:00

	IFC @103744

Affected files ...

.. //depot/projects/arm/src/sbin/ifconfig/ifclone.c#2 integrate
.. //depot/projects/arm/src/sbin/sysctl/sysctl.c#3 integrate
.. //depot/projects/arm/src/share/man/man4/vlan.4#3 integrate
.. //depot/projects/arm/src/share/man/man9/sysctl.9#2 integrate
.. //depot/projects/arm/src/share/mk/bsd.cpu.mk#2 integrate
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/env_vars.c#13 integrate
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/env_vars.h#5 integrate
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/loader_prompt.c#14 integrate
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/loader_prompt.h#7 integrate
.. //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.c#15 integrate
.. //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.h#7 integrate
.. //depot/projects/arm/src/sys/conf/files#42 integrate
.. //depot/projects/arm/src/sys/contrib/dev/acpica/acfreebsd.h#3 integrate
.. //depot/projects/arm/src/sys/geom/label/g_label.c#6 integrate
.. //depot/projects/arm/src/sys/geom/label/g_label_msdosfs.c#4 integrate
.. //depot/projects/arm/src/sys/geom/label/g_label_msdosfs.h#1 branch
.. //depot/projects/arm/src/sys/kern/kern_subr.c#2 integrate
.. //depot/projects/arm/src/sys/libkern/strstr.c#1 branch
.. //depot/projects/arm/src/sys/net/bridgestp.c#8 integrate
.. //depot/projects/arm/src/sys/sys/libkern.h#4 integrate
.. //depot/projects/arm/src/sys/sys/sysctl.h#10 integrate
.. //depot/projects/arm/src/sys/vm/vm_fault.c#13 integrate
.. //depot/projects/arm/src/sys/vm/vm_object.c#13 integrate
.. //depot/projects/arm/src/sys/vm/vm_page.c#17 integrate
.. //depot/projects/arm/src/sys/vm/vm_page.h#6 integrate
.. //depot/projects/arm/src/usr.sbin/pkg_install/version/perform.c#2 integrate

Differences ...

==== //depot/projects/arm/src/sbin/ifconfig/ifclone.c#2 (text+ko) ====

@@ -29,7 +29,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-  "$FreeBSD: src/sbin/ifconfig/ifclone.c,v 1.2 2006/07/09 06:10:23 sam Exp $";
+  "$FreeBSD: src/sbin/ifconfig/ifclone.c,v 1.3 2006/08/12 18:07:17 yar Exp $";
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -145,6 +145,7 @@
 static struct cmd clone_cmds[] = {
 	DEF_CMD("create",	0,	clone_create),
 	DEF_CMD("destroy",	0,	clone_destroy),
+	DEF_CMD("plumb",	0,	clone_create),
 	DEF_CMD("unplumb",	0,	clone_destroy),
 };
 

==== //depot/projects/arm/src/sbin/sysctl/sysctl.c#3 (text+ko) ====

@@ -38,7 +38,7 @@
 static char sccsid[] = "@(#)from: sysctl.c	8.1 (Berkeley) 6/6/93";
 #endif
 static const char rcsid[] =
-  "$FreeBSD: src/sbin/sysctl/sysctl.c,v 1.71 2006/08/04 07:31:55 njl Exp $";
+  "$FreeBSD: src/sbin/sysctl/sysctl.c,v 1.72 2006/08/12 23:33:10 obrien Exp $";
 #endif /* not lint */
 
 #ifdef __i386__
@@ -578,7 +578,11 @@
 		while (len >= sizeof(int)) {
 			fputs(val, stdout);
 			if (*fmt == 'U')
-				printf(hflag ? "%'u" : "%u", *(unsigned int *)p);
+				printf(hflag ? "%'u" : "%u",
+				    *(unsigned int *)p);
+			else if (*fmt == 'X')
+				printf(hflag ? "%'#010x" : "%#010x",
+				    *(unsigned int *)p);
 			else if (*fmt == 'K') {
 				if (*(long *)p < 0)
 					printf("%ld", *(long *)p);
@@ -601,7 +605,11 @@
 		while (len >= sizeof(long)) {
 			fputs(val, stdout);
 			if (*fmt == 'U')
-				printf(hflag ? "%'lu" : "%lu", *(unsigned long *)p);
+				printf(hflag ? "%'lu" : "%lu",
+				    *(unsigned long *)p);
+			else if (*fmt == 'X')
+				printf(hflag ? "%'#018lx" : "%#018lx",
+				    *(unsigned long *)p);
 			else if (*fmt == 'K') {
 				if (*(long *)p < 0)
 					printf("%ld", *(long *)p);

==== //depot/projects/arm/src/share/man/man4/vlan.4#3 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/vlan.4,v 1.31 2006/08/11 17:09:27 yar Exp $
+.\" $FreeBSD: src/share/man/man4/vlan.4,v 1.32 2006/08/12 17:11:43 yar Exp $
 .\"
 .Dd August 11, 2006
 .Dt VLAN 4
@@ -84,7 +84,7 @@
 .Nm
 assumes the same minimum length for tagged and untagged frames.
 This mode is selected by the
-.Xr sysctl(8)
+.Xr sysctl 8
 variable
 .Va net.link.vlan.soft_pad
 set to 0 (default).

==== //depot/projects/arm/src/share/man/man9/sysctl.9#2 (text) ====

@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man9/sysctl.9,v 1.3 2006/04/28 23:21:36 keramida Exp $
+.\" $FreeBSD: src/share/man/man9/sysctl.9,v 1.5 2006/08/12 23:33:10 obrien Exp $
 .\"
 .Dd April 28, 2006
 .Dt SYSCTL 9
@@ -38,7 +38,9 @@
 .Nm SYSCTL_STRING ,
 .Nm SYSCTL_STRUCT ,
 .Nm SYSCTL_UINT ,
-.Nm SYSCTL_ULONG
+.Nm SYSCTL_ULONG ,
+.Nm SYSCTL_XINT ,
+.Nm SYSCTL_XLONG
 .Nd Static sysctl declaration functions
 .Sh SYNOPSIS
 .In sys/types.h
@@ -129,6 +131,24 @@
 .Fa "val"
 .Fa "descr"
 .Fc
+.Fo SYSCTL_XINT
+.Fa "parent"
+.Fa "nbr"
+.Fa "name"
+.Fa "access"
+.Fa "ptr"
+.Fa "val"
+.Fa "descr"
+.Fc
+.Fo SYSCTL_XLONG
+.Fa "parent"
+.Fa "nbr"
+.Fa "name"
+.Fa "access"
+.Fa "ptr"
+.Fa "val"
+.Fa "descr"
+.Fc
 .Sh DESCRIPTION
 The
 .Nm
@@ -153,8 +173,10 @@
 .Nm SYSCTL_STRING ,
 .Nm SYSCTL_STRUCT ,
 .Nm SYSCTL_UINT ,
+.Nm SYSCTL_ULONG ,
+.Nm SYSCTL_XINT ,
 and
-.Nm SYSCTL_ULONG .
+.Nm SYSCTL_XLONG .
 Each macro accepts a parent name, as declared using
 .Nm SYSCTL_DECL ,
 an OID number, typically
@@ -194,7 +216,7 @@
 .Bl -tag -width CTLFLAG_ANYBODY
 .It Dv CTLFLAG_RD
 This is a read-only sysctl.
-It Dv CTLFLAG_WR
+.It Dv CTLFLAG_WR
 This is a writable sysctl.
 .It Dv CTLFLAG_RW
 This sysctl is readable and writable.
@@ -271,6 +293,7 @@
  * Example of a constant integer value.  Notice that the control
  * flags are CTLFLAG_RD, the variable pointer is NULL, and the
  * value is declared.
+ * If sysctl(8) should print this value in hex, use 'SYSCTL_XINT'.
  */
 SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD, NULL,
     sizeof(struct bio), "sizeof(struct bio)");

==== //depot/projects/arm/src/share/mk/bsd.cpu.mk#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/share/mk/bsd.cpu.mk,v 1.54 2006/07/21 14:07:48 cognet Exp $
+# $FreeBSD: src/share/mk/bsd.cpu.mk,v 1.55 2006/08/12 09:46:43 des Exp $
 
 # Set default CPU compile flags and baseline CPUTYPE for each arch.  The
 # compile flags must support the minimum CPU type for each architecture but
@@ -133,7 +133,7 @@
 .  elif ${CPUTYPE} == "k5"
 MACHINE_CPU = k5 i586 i486 i386
 .  elif ${CPUTYPE} == "c3"
-MACHINE_CPU = 3dnow mmx i586 i486 i386
+MACHINE_CPU = mmx i586 i486 i386
 .  elif ${CPUTYPE} == "c3-2"
 MACHINE_CPU = sse mmx i586 i486 i386
 .  elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || ${CPUTYPE} == "pentium-m"

==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/env_vars.c#13 (text+ko) ====


==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/env_vars.h#5 (text+ko) ====


==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/loader_prompt.c#14 (text+ko) ====


==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/loader_prompt.h#7 (text+ko) ====


==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.c#15 (text+ko) ====


==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.h#7 (text+ko) ====


==== //depot/projects/arm/src/sys/conf/files#42 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1137 2006/08/07 12:02:42 rwatson Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1139 2006/08/12 18:29:49 pjd Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -1477,6 +1477,7 @@
 libkern/strncpy.c		standard
 libkern/strsep.c		standard
 libkern/strspn.c		standard
+libkern/strstr.c		standard
 libkern/strtol.c		standard
 libkern/strtoq.c		standard
 libkern/strtoul.c		standard

==== //depot/projects/arm/src/sys/contrib/dev/acpica/acfreebsd.h#3 (text+ko) ====

@@ -169,26 +169,4 @@
 /* Always use FreeBSD code over our local versions */
 #define ACPI_USE_SYSTEM_CLIBRARY
 
-#ifdef _KERNEL
-/* Or strstr (used in debugging mode, also move to libkern) */
-static __inline char *
-strstr(char *s, char *find)
-{
-    char c, sc;
-    size_t len;
-
-    if ((c = *find++) != 0) {
-    len = strlen(find);
-    do {
-        do {
-        if ((sc = *s++) == 0)
-            return (NULL);
-        } while (sc != c);
-    } while (strncmp(s, find, len) != 0);
-    s--;
-    }
-    return ((char *)s);
-}
-#endif /* _KERNEL */
-
 #endif /* __ACFREEBSD_H__ */

==== //depot/projects/arm/src/sys/geom/label/g_label.c#6 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/label/g_label.c,v 1.20 2006/02/18 11:24:00 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/label/g_label.c,v 1.21 2006/08/12 15:30:24 pjd Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -36,6 +36,7 @@
 #include <sys/bio.h>
 #include <sys/sysctl.h>
 #include <sys/malloc.h>
+#include <sys/libkern.h>
 #include <geom/geom.h>
 #include <geom/geom_slice.h>
 #include <geom/label/g_label.h>
@@ -116,6 +117,23 @@
 	g_slice_spoiled(cp);
 }
 
+static int
+g_label_is_name_ok(const char *label)
+{
+	const char *s;
+
+	/* Check is the label starts from ../ */
+	if (strncmp(label, "../", 3) == 0)
+		return (0);
+	/* Check is the label contains /../ */
+	if (strstr(label, "/../") != NULL)
+		return (0);
+	/* Check is the label ends at ../ */
+	if ((s = strstr(label, "/..")) != NULL && s[3] == '\0')
+		return (0);
+	return (1);
+}
+
 static struct g_geom *
 g_label_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp,
     const char *label, const char *dir, off_t mediasize)
@@ -127,6 +145,12 @@
 
 	g_topology_assert();
 
+	if (!g_label_is_name_ok(label)) {
+		G_LABEL_DEBUG(0, "%s contains suspicious label, skipping.",
+		    pp->name);
+		G_LABEL_DEBUG(1, "%s suspicious label is: %s", pp->name, label);
+		return (NULL);
+	}
 	gp = NULL;
 	cp = NULL;
 	snprintf(name, sizeof(name), "%s/%s", dir, label);

==== //depot/projects/arm/src/sys/geom/label/g_label_msdosfs.c#4 (text+ko) ====

@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2004 Pawel Jakub Dawidek <pjd at FreeBSD.org>
+ * Copyright (c) 2006 Tobias Reifenberger
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/label/g_label_msdosfs.c,v 1.4 2006/02/01 12:06:00 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/label/g_label_msdosfs.c,v 1.5 2006/08/12 15:34:15 pjd Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -34,57 +35,171 @@
 
 #include <geom/geom.h>
 #include <geom/label/g_label.h>
+#include <geom/label/g_label_msdosfs.h>
 
 #define G_LABEL_MSDOSFS_DIR	"msdosfs"
-
-#define	FAT12	"FAT12   "
-#define	FAT16	"FAT16   "
-#define	FAT32	"FAT32   "
-#define	VOLUME_LEN	11
-#define NO_NAME "NO NAME    "
-
+#define LABEL_NO_NAME		"NO NAME    "
 
 static void
 g_label_msdosfs_taste(struct g_consumer *cp, char *label, size_t size)
 {
 	struct g_provider *pp;
-	char *sector, *volume;
-	int i;
+	FAT_BSBPB *pfat_bsbpb;
+	FAT32_BSBPB *pfat32_bsbpb;
+	FAT_DES *pfat_entry;
+	uint8_t *sector0, *sector;
+	uint32_t i;
 
 	g_topology_assert_not();
 	pp = cp->provider;
-	label[0] = '\0';
+	sector0 = NULL;
+	sector = NULL;
+	bzero(label, size);
+
+	/* Check if the sector size of the medium is a valid FAT sector size. */
+	switch(pp->sectorsize) {
+	case 512:
+	case 1024:
+	case 2048:
+	case 4096:
+		break;
+	default:
+		G_LABEL_DEBUG(1, "MSDOSFS: %s: sector size %d not compatible.",
+		    pp->name, pp->sectorsize);
+		return;
+	}
 
-	sector = (char *)g_read_data(cp, 0, pp->sectorsize, NULL);
-	if (sector == NULL)
+	/* Load 1st sector with boot sector and boot parameter block. */
+	sector0 = (uint8_t *)g_read_data(cp, 0, pp->sectorsize, NULL);
+	if (sector0 == NULL)
 		return;
-	if (strncmp(sector + 0x36, FAT12, strlen(FAT12)) == 0) {
-		G_LABEL_DEBUG(1, "MSDOS (FAT12) file system detected on %s.",
+
+	/* Check for the FAT boot sector signature. */
+	if (sector0[510] != 0x55 || sector0[511] != 0xaa) {
+		G_LABEL_DEBUG(1, "MSDOSFS: %s: no FAT signature found.",
 		    pp->name);
-		volume = sector + 0x2b;
-	} else if (strncmp(sector + 0x36, FAT16, strlen(FAT16)) == 0) {
-		G_LABEL_DEBUG(1, "MSDOS (FAT16) file system detected on %s.",
+		goto error;
+	}
+
+
+	/*
+	 * Test if this is really a FAT volume and determine the FAT type.
+	 */
+
+	pfat_bsbpb = (FAT_BSBPB *)sector0;
+	pfat32_bsbpb = (FAT32_BSBPB *)sector0;
+
+	if (UINT16BYTES(pfat_bsbpb->BPB_FATSz16) != 0) {
+		/*
+		 * If the BPB_FATSz16 field is not zero and the string "FAT" is
+		 * at the right place, this should be a FAT12 or FAT16 volume.
+		 */
+		if (strncmp(pfat_bsbpb->BS_FilSysType, "FAT", 3) != 0) {
+			G_LABEL_DEBUG(1,
+			    "MSDOSFS: %s: FAT12/16 volume not valid.",
+			    pp->name);
+			goto error;
+		}
+		G_LABEL_DEBUG(1, "MSDOSFS: %s: FAT12/FAT16 volume detected.",
 		    pp->name);
-		volume = sector + 0x2b;
-	} else if (strncmp(sector + 0x52, FAT32, strlen(FAT32)) == 0) {
-		G_LABEL_DEBUG(1, "MSDOS (FAT32) file system detected on %s.",
+
+		/* A volume with no name should have "NO NAME    " as label. */
+		if (strncmp(pfat_bsbpb->BS_VolLab, LABEL_NO_NAME,
+		    sizeof(pfat_bsbpb->BS_VolLab)) == 0) {
+			G_LABEL_DEBUG(1,
+			    "MSDOSFS: %s: FAT12/16 volume has no name.",
+			    pp->name);
+			goto error;
+		}
+		strlcpy(label, pfat_bsbpb->BS_VolLab,
+		    MIN(size, sizeof(pfat_bsbpb->BS_VolLab) + 1));
+	} else if (UINT32BYTES(pfat32_bsbpb->BPB_FATSz32) != 0) {
+		uint32_t fat_FirstDataSector, fat_BytesPerSector, offset;
+
+		/*
+		 * If the BPB_FATSz32 field is not zero and the string "FAT" is
+		 * at the right place, this should be a FAT32 volume.
+		 */
+		if (strncmp(pfat32_bsbpb->BS_FilSysType, "FAT", 3) != 0) {
+			G_LABEL_DEBUG(1, "MSDOSFS: %s: FAT32 volume not valid.",
+			    pp->name);
+			goto error;
+		}
+		G_LABEL_DEBUG(1, "MSDOSFS: %s: FAT32 volume detected.",
 		    pp->name);
-		volume = sector + 0x47;
+
+		/*
+		 * If the volume label is not "NO NAME    " we're done.
+		 */
+		if (strncmp(pfat32_bsbpb->BS_VolLab, LABEL_NO_NAME,
+		    sizeof(pfat32_bsbpb->BS_VolLab)) != 0) {
+			strlcpy(label, pfat32_bsbpb->BS_VolLab,
+			    MIN(size, sizeof(pfat32_bsbpb->BS_VolLab) + 1));
+			goto endofchecks;
+		}
+
+		/*
+		 * If the volume label "NO NAME    " is in the boot sector, the
+		 * label of FAT32 volumes may be stored as a special entry in
+		 * the root directory.
+		 */
+		fat_FirstDataSector =
+		    UINT16BYTES(pfat32_bsbpb->BPB_RsvdSecCnt) +
+		    (pfat32_bsbpb->BPB_NumFATs *
+		     UINT32BYTES(pfat32_bsbpb->BPB_FATSz32));
+		fat_BytesPerSector = UINT16BYTES(pfat32_bsbpb->BPB_BytsPerSec);
+			
+		G_LABEL_DEBUG(2,
+		    "MSDOSFS: FAT_FirstDataSector=0x%x, FAT_BytesPerSector=%d",
+		    fat_FirstDataSector, fat_BytesPerSector);
+
+		for (offset = fat_BytesPerSector * fat_FirstDataSector;;
+		    offset += fat_BytesPerSector) {
+			sector = (uint8_t *)g_read_data(cp, offset,
+			    fat_BytesPerSector, NULL);
+			if (sector == NULL)
+				goto error;
+
+			pfat_entry = (FAT_DES *)sector;
+			do {
+				/* No more entries available. */
+				if (pfat_entry->DIR_Name[0] == 0) {
+					G_LABEL_DEBUG(1, "MSDOSFS: %s: "
+					    "FAT32 volume has no name.",
+					    pp->name);
+					goto error;
+				}
+
+				/* Skip empty or long name entries. */
+				if (pfat_entry->DIR_Name[0] == 0xe5 ||
+				    (pfat_entry->DIR_Attr &
+				     FAT_DES_ATTR_LONG_NAME) ==
+				    FAT_DES_ATTR_LONG_NAME) {
+					continue;
+				}
+
+				/*
+				 * The name of the entry is the volume label if
+				 * ATTR_VOLUME_ID is set.
+				 */
+				if (pfat_entry->DIR_Attr &
+				    FAT_DES_ATTR_VOLUME_ID) {
+					strlcpy(label, pfat_entry->DIR_Name,
+					    MIN(size,
+					    sizeof(pfat_bsbpb->BS_VolLab) + 1));
+					goto endofchecks;
+				}
+			} while((uint8_t *)(++pfat_entry) <
+			    (uint8_t *)(sector + fat_BytesPerSector));
+			g_free(sector);
+		}
 	} else {
-		g_free(sector);
-		return;
+		G_LABEL_DEBUG(1, "MSDOSFS: %s: no FAT volume detected.",
+		    pp->name);
+		goto error;
 	}
-	if (strncmp(volume, NO_NAME, VOLUME_LEN) == 0) {
-		g_free(sector);
-		return;
-	}
-	if (volume[0] == '\0') {
-		g_free(sector);
-		return;
-	}
-	bzero(label, size);
-	strlcpy(label, volume, MIN(size, VOLUME_LEN));
-	g_free(sector);
+
+endofchecks:
 	for (i = size - 1; i > 0; i--) {
 		if (label[i] == '\0')
 			continue;
@@ -93,6 +208,12 @@
 		else
 			break;
 	}
+
+error:
+	if (sector0 != NULL)
+		g_free(sector0);
+	if (sector != NULL)
+		g_free(sector);
 }
 
 const struct g_label_desc g_label_msdosfs = {

==== //depot/projects/arm/src/sys/kern/kern_subr.c#2 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_subr.c,v 1.96 2005/01/06 23:35:39 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_subr.c,v 1.97 2006/08/12 19:47:49 alc Exp $");
 
 #include "opt_zero.h"
 
@@ -105,9 +105,9 @@
 	VM_OBJECT_LOCK(uobject);
 retry:
 	if ((user_pg = vm_page_lookup(uobject, upindex)) != NULL) {
+		if (vm_page_sleep_if_busy(user_pg, TRUE, "vm_pgmoveco"))
+			goto retry;
 		vm_page_lock_queues();
-		if (vm_page_sleep_if_busy(user_pg, 1, "vm_pgmoveco"))
-			goto retry;
 		pmap_remove_all(user_pg);
 		vm_page_free(user_pg);
 	} else {

==== //depot/projects/arm/src/sys/net/bridgestp.c#8 (text+ko) ====

@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/net/bridgestp.c,v 1.18 2006/08/02 02:51:42 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/net/bridgestp.c,v 1.19 2006/08/12 20:30:58 thompsa Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -929,6 +929,7 @@
 };
 
 DECLARE_MODULE(bridgestp, bstp_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
+MODULE_VERSION(bridgestp, 1);
 
 void
 bstp_attach(struct bstp_state *bs, bstp_state_cb_t state_callback)

==== //depot/projects/arm/src/sys/sys/libkern.h#4 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)libkern.h	8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/sys/libkern.h,v 1.53 2006/07/17 09:05:21 phk Exp $
+ * $FreeBSD: src/sys/sys/libkern.h,v 1.54 2006/08/12 15:28:39 pjd Exp $
  */
 
 #ifndef _SYS_LIBKERN_H_
@@ -108,6 +108,7 @@
 char	*strncpy(char * __restrict, const char * __restrict, size_t);
 char	*strsep(char **, const char *delim);
 size_t	 strspn(const char *, const char *);
+char	*strstr(const char *, const char *);
 int	 strvalid(const char *, size_t);
 
 extern uint32_t crc32_tab[];

==== //depot/projects/arm/src/sys/sys/sysctl.h#10 (text+ko) ====

@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)sysctl.h	8.1 (Berkeley) 6/2/93
- * $FreeBSD: src/sys/sys/sysctl.h,v 1.142 2006/07/18 17:00:51 imp Exp $
+ * $FreeBSD: src/sys/sys/sysctl.h,v 1.143 2006/08/12 23:33:10 obrien Exp $
  */
 
 #ifndef _SYS_SYSCTL_H_
@@ -259,6 +259,14 @@
 	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|(access),	    \
 	ptr, val, sysctl_handle_int, "IU", __DESCR(descr))
 
+#define SYSCTL_XINT(parent, nbr, name, access, ptr, val, descr) \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|(access), \
+		ptr, val, sysctl_handle_int, "IX", descr)
+
+#define SYSCTL_ADD_XINT(ctx, parent, nbr, name, access, ptr, val, descr)    \
+	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|(access),	    \
+	ptr, val, sysctl_handle_int, "IX", __DESCR(descr))
+
 /* Oid for a long.  The pointer must be non NULL. */
 #define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
 	SYSCTL_OID(parent, nbr, name, CTLTYPE_LONG|(access), \
@@ -277,6 +285,14 @@
 	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|(access),	    \
 	ptr, 0, sysctl_handle_long, "LU", __DESCR(descr))
 
+#define SYSCTL_XLONG(parent, nbr, name, access, ptr, val, descr) \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|(access), \
+		ptr, val, sysctl_handle_long, "LX", __DESCR(descr))
+
+#define SYSCTL_ADD_XLONG(ctx, parent, nbr, name, access, ptr, descr)	    \
+	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|(access),	    \
+	ptr, 0, sysctl_handle_long, "LX", __DESCR(descr))
+
 /* Oid for an opaque object.  Specified by a pointer and a length. */
 #define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
 	SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \

==== //depot/projects/arm/src/sys/vm/vm_fault.c#13 (text+ko) ====

@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_fault.c,v 1.218 2006/08/06 00:17:17 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_fault.c,v 1.219 2006/08/13 00:11:09 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -842,14 +842,15 @@
 	if (prot & VM_PROT_WRITE) {
 		vm_page_lock_queues();
 		vm_page_flag_set(fs.m, PG_WRITEABLE);
-		vm_object_set_writeable_dirty(fs.m->object);
+		vm_page_unlock_queues();
+		vm_object_set_writeable_dirty(fs.object);
 
 		/*
 		 * If the fault is a write, we know that this page is being
 		 * written NOW so dirty it explicitly to save on 
 		 * pmap_is_modified() calls later.
 		 *
-		 * If this is a NOSYNC mmap we do not want to set PG_NOSYNC
+		 * If this is a NOSYNC mmap we do not want to set VPO_NOSYNC
 		 * if the page is already dirty to prevent data written with
 		 * the expectation of being synced from not being synced.
 		 * Likewise if this entry does not request NOSYNC then make
@@ -861,11 +862,10 @@
 		 */
 		if (fs.entry->eflags & MAP_ENTRY_NOSYNC) {
 			if (fs.m->dirty == 0)
-				vm_page_flag_set(fs.m, PG_NOSYNC);
+				fs.m->oflags |= VPO_NOSYNC;
 		} else {
-			vm_page_flag_clear(fs.m, PG_NOSYNC);
+			fs.m->oflags &= ~VPO_NOSYNC;
 		}
-		vm_page_unlock_queues();
 		if (fault_flags & VM_FAULT_DIRTY) {
 			vm_page_dirty(fs.m);
 			vm_pager_page_unswapped(fs.m);

==== //depot/projects/arm/src/sys/vm/vm_object.c#13 (text+ko) ====

@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_object.c,v 1.365 2006/08/09 17:43:27 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_object.c,v 1.366 2006/08/13 00:11:09 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -687,7 +687,7 @@
  *
  *	Clean all dirty pages in the specified range of object.  Leaves page 
  * 	on whatever queue it is currently on.   If NOSYNC is set then do not
- *	write out pages with PG_NOSYNC set (originally comes from MAP_NOSYNC),
+ *	write out pages with VPO_NOSYNC set (originally comes from MAP_NOSYNC),
  *	leaving the object dirty.
  *
  *	When stuffing pages asynchronously, allow clustering.  XXX we need a
@@ -765,7 +765,7 @@
 			 * If we have been asked to skip nosync pages and 
 			 * this is a nosync page, we can't continue.
 			 */
-			if ((flags & OBJPC_NOSYNC) && (p->flags & PG_NOSYNC)) {
+			if ((flags & OBJPC_NOSYNC) && (p->oflags & VPO_NOSYNC)) {
 				if (--scanlimit == 0)
 					break;
 				++tscan;
@@ -805,7 +805,7 @@
 	clearobjflags = 1;
 	TAILQ_FOREACH(p, &object->memq, listq) {
 		vm_page_flag_set(p, PG_CLEANCHK);
-		if ((flags & OBJPC_NOSYNC) && (p->flags & PG_NOSYNC))
+		if ((flags & OBJPC_NOSYNC) && (p->oflags & VPO_NOSYNC))
 			clearobjflags = 0;
 		else
 			pmap_remove_write(p);
@@ -853,7 +853,7 @@
 		 * nosync page, skip it.  Note that the object flags were
 		 * not cleared in this case so we do not have to set them.
 		 */
-		if ((flags & OBJPC_NOSYNC) && (p->flags & PG_NOSYNC)) {
+		if ((flags & OBJPC_NOSYNC) && (p->oflags & VPO_NOSYNC)) {
 			vm_page_flag_clear(p, PG_CLEANCHK);
 			continue;
 		}

==== //depot/projects/arm/src/sys/vm/vm_page.c#17 (text+ko) ====

@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_page.c,v 1.324 2006/08/11 17:18:58 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_page.c,v 1.325 2006/08/13 00:11:09 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1580,7 +1580,7 @@
 	/*
 	 * Set valid, clear dirty bits.  If validating the entire
 	 * page we can safely clear the pmap modify bit.  We also
-	 * use this opportunity to clear the PG_NOSYNC flag.  If a process
+	 * use this opportunity to clear the VPO_NOSYNC flag.  If a process
 	 * takes a write fault on a MAP_NOSYNC memory area the flag will
 	 * be set again.
 	 *
@@ -1603,7 +1603,7 @@
 	m->dirty &= ~pagebits;
 	if (base == 0 && size == PAGE_SIZE) {
 		pmap_clear_modify(m);
-		vm_page_flag_clear(m, PG_NOSYNC);
+		m->oflags &= ~VPO_NOSYNC;
 	}
 }
 

==== //depot/projects/arm/src/sys/vm/vm_page.h#6 (text+ko) ====

@@ -57,7 +57,7 @@
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
  *
- * $FreeBSD: src/sys/vm/vm_page.h,v 1.140 2006/08/09 17:43:27 alc Exp $
+ * $FreeBSD: src/sys/vm/vm_page.h,v 1.141 2006/08/13 00:11:09 alc Exp $
  */
 
 /*
@@ -144,6 +144,7 @@
  */
 #define	VPO_WANTED	0x0002	/* someone is waiting for page */
 #define	VPO_SWAPINPROG	0x0200	/* swap I/O in progress on page */
+#define	VPO_NOSYNC	0x0400	/* do not collect for syncer */
 
 /* Make sure that u_long is at least 64 bits when PAGE_SIZE is 32K. */
 #if PAGE_SIZE == 32768
@@ -226,7 +227,6 @@
 #define	PG_ZERO		0x0040		/* page is zeroed */
 #define PG_REFERENCED	0x0080		/* page has been referenced */
 #define PG_CLEANCHK	0x0100		/* page will be checked for cleaning */
-#define PG_NOSYNC	0x0400		/* do not collect for syncer */
 #define PG_UNMANAGED	0x0800		/* No PV management for page */
 #define PG_MARKER	0x1000		/* special queue marker page */
 #define	PG_SLAB		0x2000		/* object pointer is actually a slab */

==== //depot/projects/arm/src/usr.sbin/pkg_install/version/perform.c#2 (text+ko) ====

@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/pkg_install/version/perform.c,v 1.15 2006/02/12 16:09:33 krion Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/pkg_install/version/perform.c,v 1.16 2006/08/12 18:32:51 krion Exp $");
 
 #include "lib.h"
 #include "version.h"
@@ -259,7 +259,7 @@
 
     if (!plist.name || strlen(plist.name) == 0)
 	return;
-    if (ShowOrigin != FALSE)
+    if (ShowOrigin != FALSE && plist.origin != NULL)
 	strlcpy(tmp, plist.origin, PATH_MAX);
     else {
 	strlcpy(tmp, plist.name, PATH_MAX);


More information about the p4-projects mailing list