Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Feb 2008 06:59:25 GMT
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 136153 for review
Message-ID:  <200802250659.m1P6xPe6036736@repoman.freebsd.org>

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

Change 136153 by raj@raj_mimi on 2008/02/25 06:58:56

	IFC @136132

Affected files ...

.. //depot/projects/e500/bin/sh/cd.c#2 integrate
.. //depot/projects/e500/gnu/lib/libgcc/Makefile#5 integrate
.. //depot/projects/e500/lib/libc/powerpc/gen/flt_rounds.c#3 integrate
.. //depot/projects/e500/lib/libc/powerpc/gen/fpgetmask.c#3 integrate
.. //depot/projects/e500/lib/libc/powerpc/gen/fpgetround.c#3 integrate
.. //depot/projects/e500/lib/libc/powerpc/gen/fpgetsticky.c#3 integrate
.. //depot/projects/e500/lib/libc/powerpc/gen/fpsetmask.c#3 integrate
.. //depot/projects/e500/lib/libc/powerpc/gen/fpsetround.c#3 integrate
.. //depot/projects/e500/lib/msun/powerpc/fenv.h#3 integrate
.. //depot/projects/e500/sys/powerpc/include/float.h#3 integrate
.. //depot/projects/e500/sys/powerpc/include/hid.h#5 integrate
.. //depot/projects/e500/sys/powerpc/include/spr.h#3 integrate
.. //depot/projects/e500/sys/powerpc/powerpc/cpu.c#3 edit
.. //depot/projects/e500/sys/vm/vm_object.c#9 integrate
.. //depot/projects/e500/tools/regression/bin/sh/builtins/cd1.0#1 branch
.. //depot/projects/e500/usr.bin/ar/ar.c#2 integrate
.. //depot/projects/e500/usr.bin/ar/write.c#2 integrate
.. //depot/projects/e500/usr.bin/find/find.1#3 integrate

Differences ...

==== //depot/projects/e500/bin/sh/cd.c#2 (text+ko) ====

@@ -36,7 +36,7 @@
 #endif
 #endif /* not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/sh/cd.c,v 1.35 2006/06/12 21:06:00 stefanf Exp $");
+__FBSDID("$FreeBSD: src/bin/sh/cd.c,v 1.36 2008/02/24 16:50:55 stefanf Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -68,7 +68,9 @@
 STATIC int cdphysical(char *);
 STATIC int docd(char *, int, int);
 STATIC char *getcomponent(void);
-STATIC int updatepwd(char *);
+STATIC char *findcwd(char *);
+STATIC void updatepwd(char *);
+STATIC char *getpwd2(char *, size_t);
 
 STATIC char *curdir = NULL;	/* current working directory */
 STATIC char *prevdir;		/* previous working directory */
@@ -201,10 +203,11 @@
 	}
 
 	INTOFF;
-	if (updatepwd(badstat ? NULL : dest) < 0 || chdir(curdir) < 0) {
+	if ((p = findcwd(badstat ? NULL : dest)) == NULL || chdir(p) < 0) {
 		INTON;
 		return (-1);
 	}
+	updatepwd(p);
 	INTON;
 	return (0);
 }
@@ -212,12 +215,14 @@
 STATIC int
 cdphysical(char *dest)
 {
+	char *p;
 
 	INTOFF;
-	if (chdir(dest) < 0 || updatepwd(NULL) < 0) {
+	if (chdir(dest) < 0 || (p = findcwd(NULL)) == NULL) {
 		INTON;
 		return (-1);
 	}
+	updatepwd(p);
 	INTON;
 	return (0);
 }
@@ -247,38 +252,20 @@
 }
 
 
-/*
- * Update curdir (the name of the current directory) in response to a
- * cd command.  We also call hashcd to let the routines in exec.c know
- * that the current directory has changed.
- */
-STATIC int
-updatepwd(char *dir)
+STATIC char *
+findcwd(char *dir)
 {
 	char *new;
 	char *p;
 
-	hashcd();				/* update command hash table */
-
 	/*
 	 * If our argument is NULL, we don't know the current directory
 	 * any more because we traversed a symbolic link or something
 	 * we couldn't stat().
 	 */
 	if (dir == NULL || curdir == NULL)  {
-		if (prevdir)
-			ckfree(prevdir);
-		INTOFF;
-		prevdir = curdir;
-		curdir = NULL;
-		if (getpwd() == NULL) {
-			INTON;
-			return (-1);
-		}
-		setvar("PWD", curdir, VEXPORT);
-		setvar("OLDPWD", prevdir, VEXPORT);
-		INTON;
-		return (0);
+		p = stalloc(PATH_MAX);
+		return getpwd2(p, PATH_MAX);
 	}
 	cdcomppath = stalloc(strlen(dir) + 1);
 	scopy(dir, cdcomppath);
@@ -302,16 +289,25 @@
 	if (new == stackblock())
 		STPUTC('/', new);
 	STACKSTRNUL(new);
-	INTOFF;
+	return stackblock();
+}
+
+/*
+ * Update curdir (the name of the current directory) in response to a
+ * cd command.  We also call hashcd to let the routines in exec.c know
+ * that the current directory has changed.
+ */
+STATIC void
+updatepwd(char *dir)
+{
+	hashcd();				/* update command hash table */
+
 	if (prevdir)
 		ckfree(prevdir);
 	prevdir = curdir;
-	curdir = savestr(stackblock());
+	curdir = savestr(dir);
 	setvar("PWD", curdir, VEXPORT);
 	setvar("OLDPWD", prevdir, VEXPORT);
-	INTON;
-
-	return (0);
 }
 
 int
@@ -355,17 +351,31 @@
 }
 
 /*
- * Find out what the current directory is. If we already know the current
- * directory, this routine returns immediately.
+ * Get the current directory and cache the result in curdir.
  */
 char *
 getpwd(void)
 {
 	char buf[PATH_MAX];
+	char *p;
 
 	if (curdir)
 		return curdir;
-	if (getcwd(buf, sizeof(buf)) == NULL) {
+
+	p = getpwd2(buf, sizeof(buf));
+	if (p != NULL)
+		curdir = savestr(p);
+
+	return curdir;
+}
+
+/*
+ * Return the current directory.
+ */
+STATIC char *
+getpwd2(char *buf, size_t size)
+{
+	if (getcwd(buf, size) == NULL) {
 		char *pwd = getenv("PWD");
 		struct stat stdot, stpwd;
 
@@ -373,12 +383,9 @@
 		    stat(pwd, &stpwd) != -1 &&
 		    stdot.st_dev == stpwd.st_dev &&
 		    stdot.st_ino == stpwd.st_ino) {
-			curdir = savestr(pwd);
-			return curdir;
+			return pwd;
 		}
 		return NULL;
 	}
-	curdir = savestr(buf);
-
-	return curdir;
+	return buf;
 }

==== //depot/projects/e500/gnu/lib/libgcc/Makefile#5 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.58 2007/08/14 20:49:57 kan Exp $
+# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.59 2008/02/24 19:22:52 raj Exp $
 GCCDIR=	${.CURDIR}/../../../contrib/gcc
 GCCLIB=	${.CURDIR}/../../../contrib/gcclibs
 

==== //depot/projects/e500/lib/libc/powerpc/gen/flt_rounds.c#3 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/powerpc/gen/flt_rounds.c,v 1.1 2004/02/12 09:11:06 grehan Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/powerpc/gen/flt_rounds.c,v 1.2 2008/02/24 19:22:53 raj Exp $");
 
 #include <sys/types.h>
 #include <machine/float.h>

==== //depot/projects/e500/lib/libc/powerpc/gen/fpgetmask.c#3 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/powerpc/gen/fpgetmask.c,v 1.1 2004/02/12 09:11:06 grehan Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/powerpc/gen/fpgetmask.c,v 1.2 2008/02/24 19:22:53 raj Exp $");
 
 #include <sys/types.h>
 #include <ieeefp.h>

==== //depot/projects/e500/lib/libc/powerpc/gen/fpgetround.c#3 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/powerpc/gen/fpgetround.c,v 1.1 2004/02/12 09:11:06 grehan Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/powerpc/gen/fpgetround.c,v 1.2 2008/02/24 19:22:53 raj Exp $");
 
 #include <sys/types.h>
 #include <ieeefp.h>

==== //depot/projects/e500/lib/libc/powerpc/gen/fpgetsticky.c#3 (text+ko) ====

@@ -35,7 +35,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/powerpc/gen/fpgetsticky.c,v 1.1 2004/02/12 09:11:06 grehan Exp $
+ * $FreeBSD: src/lib/libc/powerpc/gen/fpgetsticky.c,v 1.2 2008/02/24 19:22:53 raj Exp $
  */
 
 #include <sys/cdefs.h>

==== //depot/projects/e500/lib/libc/powerpc/gen/fpsetmask.c#3 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/powerpc/gen/fpsetmask.c,v 1.1 2004/02/12 09:11:06 grehan Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/powerpc/gen/fpsetmask.c,v 1.2 2008/02/24 19:22:53 raj Exp $");
 
 #include <sys/types.h>
 #include <ieeefp.h>

==== //depot/projects/e500/lib/libc/powerpc/gen/fpsetround.c#3 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/powerpc/gen/fpsetround.c,v 1.1 2004/02/12 09:11:06 grehan Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/powerpc/gen/fpsetround.c,v 1.2 2008/02/24 19:22:53 raj Exp $");
 
 #include <sys/types.h>
 #include <ieeefp.h>

==== //depot/projects/e500/lib/msun/powerpc/fenv.h#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/lib/msun/powerpc/fenv.h,v 1.3 2005/03/16 19:03:45 das Exp $
+ * $FreeBSD: src/lib/msun/powerpc/fenv.h,v 1.4 2008/02/24 19:22:53 raj Exp $
  */
 
 #ifndef	_FENV_H_

==== //depot/projects/e500/sys/powerpc/include/float.h#3 (text+ko) ====

@@ -28,7 +28,7 @@
  *
  *	from: @(#)float.h	7.1 (Berkeley) 5/8/90
  *	from: FreeBSD: src/sys/i386/include/float.h,v 1.8 1999/08/28 00:44:11
- * $FreeBSD: src/sys/powerpc/include/float.h,v 1.8 2005/01/07 02:29:19 imp Exp $
+ * $FreeBSD: src/sys/powerpc/include/float.h,v 1.9 2008/02/24 19:22:52 raj Exp $
  */
 
 #ifndef _MACHINE_FLOAT_H_

==== //depot/projects/e500/sys/powerpc/include/hid.h#5 (text+ko) ====

@@ -24,7 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $NetBSD: hid.h,v 1.2 2001/08/22 21:05:25 matt Exp $
- * $FreeBSD: src/sys/powerpc/include/hid.h,v 1.3 2005/02/04 01:14:38 grehan Exp $
+ * $FreeBSD: src/sys/powerpc/include/hid.h,v 1.4 2008/02/25 00:09:23 raj Exp $
  */
 
 #ifndef _POWERPC_HID_H_

==== //depot/projects/e500/sys/powerpc/include/spr.h#3 (text+ko) ====

@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *
  * $NetBSD: spr.h,v 1.25 2002/08/14 15:38:40 matt Exp $
- * $FreeBSD: src/sys/powerpc/include/spr.h,v 1.6 2005/02/04 01:17:04 grehan Exp $
+ * $FreeBSD: src/sys/powerpc/include/spr.h,v 1.7 2008/02/25 00:09:23 raj Exp $
  */
 #ifndef _POWERPC_SPR_H_
 #define	_POWERPC_SPR_H_
@@ -126,8 +126,8 @@
 #define	  MPC7448		  0x8004
 #define	  MPC7410		  0x800c
 #define	  MPC8245		  0x8081
-#define	  BOOKE_E500v1		  0x8020
-#define	  BOOKE_E500v2		  0x8021
+#define	  FSL_E500v1		  0x8020
+#define	  FSL_E500v2		  0x8021
 
 #define	SPR_IBAT0U		0x210	/* .68 Instruction BAT Reg 0 Upper */
 #define	SPR_IBAT0U		0x210	/* .6. Instruction BAT Reg 0 Upper */

==== //depot/projects/e500/sys/powerpc/powerpc/cpu.c#3 (text+ko) ====

@@ -55,7 +55,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * from $NetBSD: cpu_subr.c,v 1.1 2003/02/03 17:10:09 matt Exp $
- * $FreeBSD: src/sys/powerpc/powerpc/cpu.c,v 1.9 2007/02/18 17:40:09 marcel Exp $
+ * $FreeBSD: src/sys/powerpc/powerpc/cpu.c,v 1.10 2008/02/25 00:09:23 raj Exp $
  */
 
 #include <sys/param.h>
@@ -97,8 +97,8 @@
         { "Motorola PowerPC 7447A",	MPC7447A,	REVFMT_MAJMIN },
         { "Motorola PowerPC 7448",	MPC7448,	REVFMT_MAJMIN },
         { "Motorola PowerPC 8240",	MPC8240,	REVFMT_MAJMIN },
-        { "Freescale e500v1 core",	BOOKE_E500v1,	REVFMT_MAJMIN },
-        { "Freescale e500v2 core",	BOOKE_E500v2,	REVFMT_MAJMIN },
+        { "Freescale e500v1 core",	FSL_E500v1,	REVFMT_MAJMIN },
+        { "Freescale e500v2 core",	FSL_E500v2,	REVFMT_MAJMIN },
         { "Unknown PowerPC CPU",	0,		REVFMT_HEX }
 };
 
@@ -130,8 +130,8 @@
 			min = (pvr >> 0) & 0xff;
 			maj = min <= 4 ? 1 : 2;
 			break;
-		case BOOKE_E500v1:
-		case BOOKE_E500v2:
+		case FSL_E500v1:
+		case FSL_E500v2:
 			maj = (pvr >>  4) & 0xf;
 			min = (pvr >>  0) & 0xf;
 			break;
@@ -229,8 +229,8 @@
 			hid0 |= HID0_EIEC;
 			break;
 
-		case BOOKE_E500v1:
-		case BOOKE_E500v2:
+		case FSL_E500v1:
+		case FSL_E500v2:
 			hid0 |= HID0_EMCP;
 			break;
 	}
@@ -245,8 +245,8 @@
 		case MPC7457:
 			bitmask = HID0_7450_BITMASK;
 			break;
-		case BOOKE_E500v1:
-		case BOOKE_E500v2:
+		case FSL_E500v1:
+		case FSL_E500v2:
 			bitmask = HID0_E500_BITMASK;
 			break;
 		default:
@@ -268,8 +268,8 @@
 			printf("\n");
 			cpu_config_l2cr(cpuid, vers);
 			break;
-		case BOOKE_E500v1:
-		case BOOKE_E500v2:
+		case FSL_E500v1:
+		case FSL_E500v2:
 #if 0
 			/*
 			 * Cache enable sequence according
@@ -285,7 +285,6 @@
 
 			/* Enable i-cache */
 			icache_enable();
-
 			printf("L1 CSR0 (d): 0x%08x\n", mfspr(SPR_L1CSR0));
 			printf("L1 CSR1 (i): 0x%08x\n", mfspr(SPR_L1CSR1));
 #endif
@@ -366,7 +365,7 @@
 	printf("cpu%d: ", cpuid);
 
 	if (l2cr & L2CR_L2E) {
-		if (vers == MPC7450 || 
+		if (vers == MPC7450 ||
 		    vers == MPC7455 ||
 		    vers == MPC7457) {
 			u_int l3cr;

==== //depot/projects/e500/sys/vm/vm_object.c#9 (text+ko) ====

@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_object.c,v 1.390 2008/01/13 14:44:15 attilio Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_object.c,v 1.391 2008/02/24 18:03:56 alc Exp $");
 
 #include "opt_vm.h"
 
@@ -500,7 +500,10 @@
 			VM_OBJECT_UNLOCK(object);
 			return;
 		} else if (object->ref_count == 1) {
-			if (object->shadow_count == 0) {
+			if (object->shadow_count == 0 &&
+			    object->handle == NULL &&
+			    (object->type == OBJT_DEFAULT ||
+			     object->type == OBJT_SWAP)) {
 				vm_object_set_flag(object, OBJ_ONEMAPPING);
 			} else if ((object->shadow_count == 1) &&
 			    (object->handle == NULL) &&

==== //depot/projects/e500/usr.bin/ar/ar.c#2 (text+ko) ====

@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/ar/ar.c,v 1.16 2008/02/21 10:52:31 kaiw Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/ar/ar.c,v 1.17 2008/02/24 18:07:46 kaiw Exp $");
 
 #include <sys/queue.h>
 #include <sys/types.h>
@@ -108,7 +108,8 @@
 	if ((bsdar->progname = getprogname()) == NULL)
 		bsdar->progname = "ar";
 
-	if (strcmp(bsdar->progname, "ranlib") == 0) {
+	if (strcmp(bsdar->progname, "ranlib") == 0 ||
+	    strcmp(bsdar->progname, "bsdranlib") == 0) {
 		while ((opt = getopt_long(argc, argv, "tV", longopts,
 		    NULL)) != -1) {
 			switch(opt) {

==== //depot/projects/e500/usr.bin/ar/write.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/ar/write.c,v 1.1 2008/02/21 10:52:31 kaiw Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/ar/write.c,v 1.3 2008/02/24 18:30:17 kaiw Exp $");
 
 #include <sys/endian.h>
 #include <sys/mman.h>
@@ -107,7 +107,7 @@
 	const char		*bname;
 
 	if (name == NULL)
-		return(NULL);
+		return (NULL);
 
 	obj = malloc(sizeof(struct ar_obj));
 	if (obj == NULL)
@@ -115,7 +115,7 @@
 	if ((obj->fd = open(name, O_RDONLY, 0)) < 0) {
 		bsdar_warnc(bsdar, errno, "can't open file: %s", name);
 		free(obj);
-		return(NULL);
+		return (NULL);
 	}
 
 	if ((bname = basename(name)) == NULL)
@@ -154,6 +154,12 @@
 	obj->mtime = sb.st_mtime;
 	obj->dev = sb.st_dev;
 	obj->ino = sb.st_ino;
+
+	if (obj->size == 0) {
+		obj->maddr = NULL;
+		return (obj);
+	}
+
 	if ((obj->maddr = mmap(NULL, obj->size, PROT_READ,
 	    MAP_PRIVATE, obj->fd, (off_t)0)) == MAP_FAILED) {
 		bsdar_warnc(bsdar, errno, "can't mmap file: %s", obj->name);
@@ -163,7 +169,7 @@
 		bsdar_errc(bsdar, EX_SOFTWARE, errno, "close failed: %s",
 		    obj->name);
 
-	return(obj);
+	return (obj);
 
 giveup:
 	if (close(obj->fd) < 0)
@@ -171,7 +177,7 @@
 		    obj->name);
 	free(obj->name);
 	free(obj);
-	return(NULL);
+	return (NULL);
 }
 
 /*
@@ -427,14 +433,14 @@
 	struct ar_obj		*obj, *obj_temp;
 
 	TAILQ_FOREACH_SAFE(obj, &bsdar->v_obj, objs, obj_temp) {
-		free(obj->name);
 		if (obj->fd == -1)
 			free(obj->maddr);
 		else
-			if (munmap(obj->maddr, obj->size))
+			if (obj->maddr != NULL && munmap(obj->maddr, obj->size))
 				bsdar_warnc(bsdar, errno,
 				    "can't munmap file: %s", obj->name);
 		TAILQ_REMOVE(&bsdar->v_obj, obj, objs);
+		free(obj->name);
 		free(obj);
 	}
 
@@ -478,7 +484,7 @@
 
 	/* Create archive symbol table and archive string table, if need. */
 	TAILQ_FOREACH(obj, &bsdar->v_obj, objs) {
-		if (!(bsdar->options & AR_SS))
+		if (!(bsdar->options & AR_SS) && obj->maddr != NULL)
 			create_symtab_entry(bsdar, obj->maddr, obj->size);
 		if (strlen(obj->name) > _MAXNAMELEN_SVR4)
 			add_to_ar_str_table(bsdar, obj->name);

==== //depot/projects/e500/usr.bin/find/find.1#3 (text+ko) ====

@@ -33,9 +33,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	@(#)find.1	8.7 (Berkeley) 5/9/95
-.\" $FreeBSD: src/usr.bin/find/find.1,v 1.83 2008/02/23 16:29:04 imp Exp $
+.\" $FreeBSD: src/usr.bin/find/find.1,v 1.85 2008/02/24 19:52:23 ceri Exp $
 .\"
-.Dd December 13, 2006
+.Dd February 24, 2008
 .Dt FIND 1
 .Os
 .Sh NAME
@@ -466,6 +466,7 @@
 Like
 .Ic -lname ,
 but the match is case insensitive.
+This is a GNU find extension.
 .It Ic -iname Ar pattern
 Like
 .Ic -name ,
@@ -492,7 +493,9 @@
 .It Ic -lname Ar pattern
 Like
 .Ic -name ,
-but the matched file must also be a symbolic link.
+but the contents of the symbolic link are matched instead of the file
+name.
+This is a GNU find extension.
 .It Ic -ls
 This primary always evaluates to true.
 The following information for the current file is written to standard output:



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