svn commit: r223435 - in projects/largeSMP: bin/realpath contrib/top etc/rc.d lib/libc/stdlib libexec/ulog-helper sbin/geom/class/part sbin/growfs sbin/ipfw sbin/newfs sbin/tunefs share/mk sys/amd6...

Attilio Rao attilio at FreeBSD.org
Wed Jun 22 19:42:33 UTC 2011


Author: attilio
Date: Wed Jun 22 19:42:32 2011
New Revision: 223435
URL: http://svn.freebsd.org/changeset/base/223435

Log:
  MFC

Modified:
  projects/largeSMP/bin/realpath/realpath.1
  projects/largeSMP/bin/realpath/realpath.c
  projects/largeSMP/etc/rc.d/netwait
  projects/largeSMP/lib/libc/stdlib/malloc.c
  projects/largeSMP/libexec/ulog-helper/Makefile
  projects/largeSMP/libexec/ulog-helper/ulog-helper.c
  projects/largeSMP/sbin/geom/class/part/geom_part.c
  projects/largeSMP/sbin/growfs/growfs.8
  projects/largeSMP/sbin/growfs/growfs.c
  projects/largeSMP/sbin/ipfw/nat.c
  projects/largeSMP/sbin/newfs/newfs.8
  projects/largeSMP/sbin/tunefs/tunefs.8
  projects/largeSMP/sys/amd64/include/pci_cfgreg.h
  projects/largeSMP/sys/amd64/pci/pci_bus.c
  projects/largeSMP/sys/dev/acpica/acpi_cpu.c
  projects/largeSMP/sys/dev/acpica/acpi_pcib_acpi.c
  projects/largeSMP/sys/dev/acpica/acpi_resource.c
  projects/largeSMP/sys/dev/acpica/acpivar.h
  projects/largeSMP/sys/dev/cardbus/cardbus_cis.c
  projects/largeSMP/sys/dev/dc/if_dc.c
  projects/largeSMP/sys/dev/pci/pci.c
  projects/largeSMP/sys/dev/vr/if_vr.c
  projects/largeSMP/sys/dev/vr/if_vrreg.h
  projects/largeSMP/sys/dev/xl/if_xl.c
  projects/largeSMP/sys/fs/nfsserver/nfs_nfsdserv.c
  projects/largeSMP/sys/i386/include/pci_cfgreg.h
  projects/largeSMP/sys/i386/pci/pci_bus.c
  projects/largeSMP/sys/ia64/conf/NOTES
  projects/largeSMP/sys/kern/kern_clocksource.c
  projects/largeSMP/sys/netinet/libalias/libalias.3
  projects/largeSMP/sys/powerpc/ps3/ps3bus.c
  projects/largeSMP/sys/sparc64/include/tsb.h
  projects/largeSMP/sys/sparc64/include/vmparam.h
  projects/largeSMP/sys/sparc64/sparc64/pmap.c
  projects/largeSMP/sys/sys/systm.h
  projects/largeSMP/sys/x86/x86/tsc.c
  projects/largeSMP/usr.bin/cmp/regular.c
  projects/largeSMP/usr.bin/cmp/special.c
  projects/largeSMP/usr.bin/finger/net.c
  projects/largeSMP/usr.bin/lastcomm/lastcomm.c
  projects/largeSMP/usr.bin/lastcomm/readrec.c
  projects/largeSMP/usr.sbin/nfsuserd/nfsuserd.c
Directory Properties:
  projects/largeSMP/   (props changed)
  projects/largeSMP/cddl/contrib/opensolaris/   (props changed)
  projects/largeSMP/contrib/bind9/   (props changed)
  projects/largeSMP/contrib/binutils/   (props changed)
  projects/largeSMP/contrib/bzip2/   (props changed)
  projects/largeSMP/contrib/compiler-rt/   (props changed)
  projects/largeSMP/contrib/dialog/   (props changed)
  projects/largeSMP/contrib/ee/   (props changed)
  projects/largeSMP/contrib/expat/   (props changed)
  projects/largeSMP/contrib/file/   (props changed)
  projects/largeSMP/contrib/gcc/   (props changed)
  projects/largeSMP/contrib/gdb/   (props changed)
  projects/largeSMP/contrib/gdtoa/   (props changed)
  projects/largeSMP/contrib/gnu-sort/   (props changed)
  projects/largeSMP/contrib/groff/   (props changed)
  projects/largeSMP/contrib/less/   (props changed)
  projects/largeSMP/contrib/libpcap/   (props changed)
  projects/largeSMP/contrib/libstdc++/   (props changed)
  projects/largeSMP/contrib/llvm/   (props changed)
  projects/largeSMP/contrib/llvm/tools/clang/   (props changed)
  projects/largeSMP/contrib/ncurses/   (props changed)
  projects/largeSMP/contrib/netcat/   (props changed)
  projects/largeSMP/contrib/ntp/   (props changed)
  projects/largeSMP/contrib/one-true-awk/   (props changed)
  projects/largeSMP/contrib/openbsm/   (props changed)
  projects/largeSMP/contrib/openpam/   (props changed)
  projects/largeSMP/contrib/pf/   (props changed)
  projects/largeSMP/contrib/sendmail/   (props changed)
  projects/largeSMP/contrib/tcpdump/   (props changed)
  projects/largeSMP/contrib/tcsh/   (props changed)
  projects/largeSMP/contrib/tnftp/   (props changed)
  projects/largeSMP/contrib/top/   (props changed)
  projects/largeSMP/contrib/top/install-sh   (props changed)
  projects/largeSMP/contrib/tzcode/stdtime/   (props changed)
  projects/largeSMP/contrib/tzcode/zic/   (props changed)
  projects/largeSMP/contrib/tzdata/   (props changed)
  projects/largeSMP/contrib/wpa/   (props changed)
  projects/largeSMP/contrib/xz/   (props changed)
  projects/largeSMP/crypto/openssh/   (props changed)
  projects/largeSMP/crypto/openssl/   (props changed)
  projects/largeSMP/gnu/lib/   (props changed)
  projects/largeSMP/gnu/usr.bin/binutils/   (props changed)
  projects/largeSMP/gnu/usr.bin/cc/cc_tools/   (props changed)
  projects/largeSMP/gnu/usr.bin/gdb/   (props changed)
  projects/largeSMP/lib/libc/   (props changed)
  projects/largeSMP/lib/libc/stdtime/   (props changed)
  projects/largeSMP/lib/libutil/   (props changed)
  projects/largeSMP/lib/libz/   (props changed)
  projects/largeSMP/sbin/   (props changed)
  projects/largeSMP/sbin/ipfw/   (props changed)
  projects/largeSMP/share/mk/bsd.arch.inc.mk   (props changed)
  projects/largeSMP/share/zoneinfo/   (props changed)
  projects/largeSMP/sys/   (props changed)
  projects/largeSMP/sys/amd64/include/xen/   (props changed)
  projects/largeSMP/sys/boot/   (props changed)
  projects/largeSMP/sys/boot/i386/efi/   (props changed)
  projects/largeSMP/sys/boot/ia64/efi/   (props changed)
  projects/largeSMP/sys/boot/ia64/ski/   (props changed)
  projects/largeSMP/sys/boot/powerpc/boot1.chrp/   (props changed)
  projects/largeSMP/sys/boot/powerpc/ofw/   (props changed)
  projects/largeSMP/sys/cddl/contrib/opensolaris/   (props changed)
  projects/largeSMP/sys/conf/   (props changed)
  projects/largeSMP/sys/contrib/dev/acpica/   (props changed)
  projects/largeSMP/sys/contrib/octeon-sdk/   (props changed)
  projects/largeSMP/sys/contrib/pf/   (props changed)
  projects/largeSMP/sys/contrib/x86emu/   (props changed)
  projects/largeSMP/usr.bin/calendar/   (props changed)
  projects/largeSMP/usr.bin/csup/   (props changed)
  projects/largeSMP/usr.bin/procstat/   (props changed)
  projects/largeSMP/usr.sbin/ndiscvt/   (props changed)
  projects/largeSMP/usr.sbin/zic/   (props changed)

Modified: projects/largeSMP/bin/realpath/realpath.1
==============================================================================
--- projects/largeSMP/bin/realpath/realpath.1	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/bin/realpath/realpath.1	Wed Jun 22 19:42:32 2011	(r223435)
@@ -33,7 +33,7 @@
 .\" From: src/bin/pwd/pwd.1,v 1.11 2000/11/20 11:39:39 ru Exp
 .\" $FreeBSD$
 .\"
-.Dd November 24, 2000
+.Dd June 21, 2011
 .Dt REALPATH 1
 .Os
 .Sh NAME
@@ -42,8 +42,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl q
-.Ar path
-.Op Ar ...
+.Op Ar path ...
 .Sh DESCRIPTION
 The
 .Nm
@@ -57,6 +56,11 @@ and
 .Pa /../
 in
 .Ar path .
+If
+.Ar path
+is absent, the current working directory
+.Pq Sq Pa .\&
+is assumed.
 .Pp
 If
 .Fl q

Modified: projects/largeSMP/bin/realpath/realpath.c
==============================================================================
--- projects/largeSMP/bin/realpath/realpath.c	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/bin/realpath/realpath.c	Wed Jun 22 19:42:32 2011	(r223435)
@@ -44,7 +44,8 @@ main(int argc, char *argv[])
 {
 	char buf[PATH_MAX];
 	char *p;
-	int ch, i, qflag, rval;
+	const char *path;
+	int ch, qflag, rval;
 
 	qflag = 0;
 	while ((ch = getopt(argc, argv, "q")) != -1) {
@@ -59,17 +60,16 @@ main(int argc, char *argv[])
 	}
 	argc -= optind;
 	argv += optind;
-	if (argc < 1)
-		usage();
+	path = *argv != NULL ? *argv++ : ".";
 	rval  = 0;
-	for (i = 0; i < argc; i++) {
-		if ((p = realpath(argv[i], buf)) == NULL) {
+	do {
+		if ((p = realpath(path, buf)) == NULL) {
 			if (!qflag)
-				warn("%s", argv[i]);
+				warn("%s", path);
 			rval = 1;
 		} else
 			(void)printf("%s\n", p);
-	}
+	} while ((path = *argv++) != NULL);
 	exit(rval);
 }
 
@@ -77,6 +77,6 @@ static void
 usage(void)
 {
 
-	(void)fprintf(stderr, "usage: realpath [-q] path [...]\n");
+	(void)fprintf(stderr, "usage: realpath [-q] [path ...]\n");
   	exit(1);
 }

Modified: projects/largeSMP/etc/rc.d/netwait
==============================================================================
--- projects/largeSMP/etc/rc.d/netwait	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/etc/rc.d/netwait	Wed Jun 22 19:42:32 2011	(r223435)
@@ -14,7 +14,8 @@
 . /etc/rc.subr
 
 name="netwait"
-rc_var=`set_rcvar`
+rcvar=`set_rcvar`
+
 start_cmd="${name}_start"
 stop_cmd=":"
 

Modified: projects/largeSMP/lib/libc/stdlib/malloc.c
==============================================================================
--- projects/largeSMP/lib/libc/stdlib/malloc.c	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/lib/libc/stdlib/malloc.c	Wed Jun 22 19:42:32 2011	(r223435)
@@ -234,7 +234,7 @@ __FBSDID("$FreeBSD$");
 #ifdef __sparc64__
 #  define LG_QUANTUM		4
 #  define LG_SIZEOF_PTR		3
-#  define TLS_MODEL		/* default */
+#  define TLS_MODEL		__attribute__((tls_model("initial-exec")))
 #endif
 #ifdef __amd64__
 #  define LG_QUANTUM		4

Modified: projects/largeSMP/libexec/ulog-helper/Makefile
==============================================================================
--- projects/largeSMP/libexec/ulog-helper/Makefile	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/libexec/ulog-helper/Makefile	Wed Jun 22 19:42:32 2011	(r223435)
@@ -5,7 +5,7 @@ BINOWN=	root
 BINMODE=4555
 NO_MAN=
 
-DPADD=	${LIBULOG} ${LIBMD}
-LDADD=	-lulog -lmd
+DPADD=	${LIBULOG}
+LDADD=	-lulog
 
 .include <bsd.prog.mk>

Modified: projects/largeSMP/libexec/ulog-helper/ulog-helper.c
==============================================================================
--- projects/largeSMP/libexec/ulog-helper/ulog-helper.c	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/libexec/ulog-helper/ulog-helper.c	Wed Jun 22 19:42:32 2011	(r223435)
@@ -36,11 +36,11 @@ __FBSDID("$FreeBSD$");
 
 /*
  * This setuid helper utility writes user login records to disk.
- * Unprivileged processes are not capable of writing records to utmp,
- * wtmp and lastlog, but we do want to allow this for pseudo-terminals.
- * Because a file descriptor to a pseudo-terminal master device can only
- * be obtained by processes using the pseudo-terminal, we expect such a
- * descriptor on stdin.
+ * Unprivileged processes are not capable of writing records to utmpx,
+ * but we do want to allow this for pseudo-terminals.  Because a file
+ * descriptor to a pseudo-terminal master device can only be obtained by
+ * processes using the pseudo-terminal, we expect such a descriptor on
+ * stdin.
  *
  * It uses the real user ID of the calling process to determine the
  * username.  It does allow users to log arbitrary hostnames.
@@ -49,26 +49,22 @@ __FBSDID("$FreeBSD$");
 int
 main(int argc, char *argv[])
 {
-	const char *line;
+	const char *line, *user, *host;
 
 	/* Device line name. */
 	if ((line = ptsname(STDIN_FILENO)) == NULL)
 		return (EX_USAGE);
 
 	if ((argc == 2 || argc == 3) && strcmp(argv[1], "login") == 0) {
-		struct passwd *pwd;
-		const char *host = NULL;
-
 		/* Username. */
-		pwd = getpwuid(getuid());
-		if (pwd == NULL)
+		user = user_from_uid(getuid(), 1);
+		if (user == NULL)
 			return (EX_OSERR);
 
 		/* Hostname. */
-		if (argc == 3)
-			host = argv[2];
+		host = argc == 3 ? argv[2] : NULL;
 
-		ulog_login(line, pwd->pw_name, host);
+		ulog_login(line, user, host);
 		return (EX_OK);
 	} else if (argc == 2 && strcmp(argv[1], "logout") == 0) {
 		ulog_logout(line);

Modified: projects/largeSMP/sbin/geom/class/part/geom_part.c
==============================================================================
--- projects/largeSMP/sbin/geom/class/part/geom_part.c	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sbin/geom/class/part/geom_part.c	Wed Jun 22 19:42:32 2011	(r223435)
@@ -1208,8 +1208,11 @@ gpart_bootcode(struct gctl_req *req, uns
 			if (idx == 0)
 				errx(EXIT_FAILURE, "missing -i option");
 			gpart_write_partcode(gp, idx, partcode, partsize);
-		} else
+		} else {
+			if (partsize != VTOC_BOOTSIZE)
+				errx(EXIT_FAILURE, "invalid bootcode");
 			gpart_write_partcode_vtoc8(gp, idx, partcode);
+		}
 	} else
 		if (bootcode == NULL)
 			errx(EXIT_FAILURE, "no -b nor -p");

Modified: projects/largeSMP/sbin/growfs/growfs.8
==============================================================================
--- projects/largeSMP/sbin/growfs/growfs.8	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sbin/growfs/growfs.8	Wed Jun 22 19:42:32 2011	(r223435)
@@ -37,12 +37,12 @@
 .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $
 .\" $FreeBSD$
 .\"
-.Dd May 8, 2011
+.Dd June 22, 2011
 .Dt GROWFS 8
 .Os
 .Sh NAME
 .Nm growfs
-.Nd grow size of an existing UFS file system
+.Nd expand an existing UFS filesystem
 .Sh SYNOPSIS
 .Nm
 .Op Fl Ny
@@ -58,26 +58,26 @@ Before starting
 .Nm
 the disk must be labeled to a bigger size using
 .Xr bsdlabel 8 .
-If you wish to grow a file system beyond the boundary of
-the slice it resides in, you must re-size the slice using
-.Xr fdisk 8
+If you wish to grow a filesystem beyond the boundary of
+the slice it resides in, you must resize the slice using
+.Xr gpart 8
 before running
 .Nm .
 If you are using volumes you must enlarge them by using
-.Xr vinum 8 .
+.Xr gvinum 8 .
 The
 .Nm
-utility extends the size of the file system on the specified special file.
+utility extends the size of the filesystem on the specified special file.
 Currently
 .Nm
-can only enlarge unmounted file systems.
-Do not try enlarging a mounted file system, your system may panic and you will
-not be able to use the file system any longer.
+can only enlarge unmounted filesystems.
+Do not try enlarging a mounted filesystem, your system may panic and you will
+not be able to use the filesystem any longer.
 Most of the
 .Xr newfs 8
 options cannot be changed by
 .Nm .
-In fact, you can only increase the size of the file system.
+In fact, you can only increase the size of the filesystem.
 Use
 .Xr tunefs 8
 for other changes.
@@ -86,8 +86,8 @@ The following options are available:
 .Bl -tag -width indent
 .It Fl N
 .Dq Test mode .
-Causes the new file system parameters to be printed out without actually
-enlarging the file system.
+Causes the new filesystem parameters to be printed out without actually
+enlarging the filesystem.
 .It Fl y
 .Dq Expert mode .
 Usually
@@ -102,12 +102,12 @@ So use this option with great care!
 .It Fl s Ar size
 Determines the
 .Ar size
-of the file system after enlarging in sectors.
+of the filesystem after enlarging in sectors.
 This value defaults to the size of the raw partition specified in
 .Ar special
 (in other words,
 .Nm
-will enlarge the file system to the size of the entire partition).
+will enlarge the filesystem to the size of the entire partition).
 .El
 .Sh EXAMPLES
 .Dl growfs -s 4194304 /dev/vinum/testvol
@@ -119,12 +119,12 @@ up to 2GB if there is enough space in
 .Sh SEE ALSO
 .Xr bsdlabel 8 ,
 .Xr dumpfs 8 ,
-.Xr fdisk 8 ,
 .Xr ffsinfo 8 ,
 .Xr fsck 8 ,
+.Xr gpart 8 ,
 .Xr newfs 8 ,
 .Xr tunefs 8 ,
-.Xr vinum 8
+.Xr gvinum 8
 .Sh HISTORY
 The
 .Nm
@@ -144,12 +144,12 @@ There may be cases on
 .Fx
 3.x only, when
 .Nm
-does not recognize properly whether or not the file system is mounted and
+does not recognize properly whether or not the filesystem is mounted and
 exits with an error message.
 Then please use
 .Nm
 .Fl y
-if you are sure that the file system is not mounted.
+if you are sure that the filesystem is not mounted.
 It is also recommended to always use
 .Xr fsck 8
 after enlarging (just to be on the safe side).
@@ -183,8 +183,8 @@ on the first cylinder group to verify th
 in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP
 .Em cgr0
 has enough blocks.
-As a rule of thumb for default file system parameters one block is needed for
-every 2 GB of total file system size.
+As a rule of thumb for default filesystem parameters one block is needed for
+every 2 GB of total filesystem size.
 .Pp
 Normally
 .Nm

Modified: projects/largeSMP/sbin/growfs/growfs.c
==============================================================================
--- projects/largeSMP/sbin/growfs/growfs.c	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sbin/growfs/growfs.c	Wed Jun 22 19:42:32 2011	(r223435)
@@ -160,7 +160,7 @@ static void	get_dev_size(int, int *);
 
 /* ************************************************************ growfs ***** */
 /*
- * Here we actually start growing the file system. We basically read the
+ * Here we actually start growing the filesystem. We basically read the
  * cylinder summary from the first cylinder group as we want to update
  * this on the fly during our various operations. First we handle the
  * changes in the former last cylinder group. Afterwards we create all new
@@ -231,7 +231,7 @@ growfs(int fsi, int fso, unsigned int Nf
 	updjcg(osblock.fs_ncg-1, modtime, fsi, fso, Nflag);
 
 	/*
-	 * Dump out summary information about file system.
+	 * Dump out summary information about filesystem.
 	 */
 #	define B2MBFACTOR (1 / (1024.0 * 1024.0))
 	printf("growfs: %.1fMB (%jd sectors) block size %d, fragment size %d\n",
@@ -435,7 +435,7 @@ initcg(int cylno, time_t modtime, int fs
 	if (acg.cg_nextfreeoff > (unsigned)sblock.fs_cgsize) {
 		/*
 		 * This should never happen as we would have had that panic
-		 * already on file system creation
+		 * already on filesystem creation
 		 */
 		errx(37, "panic: cylinder group too big");
 	}
@@ -446,7 +446,7 @@ initcg(int cylno, time_t modtime, int fs
 			acg.cg_cs.cs_nifree--;
 		}
 	/*
-	 * For the old file system, we have to initialize all the inodes.
+	 * For the old filesystem, we have to initialize all the inodes.
 	 */
 	if (sblock.fs_magic == FS_UFS1_MAGIC) {
 		bzero(iobuf, sblock.fs_bsize);
@@ -670,7 +670,7 @@ cond_bl_upd(ufs2_daddr_t *block, struct 
 /* ************************************************************ updjcg ***** */
 /*
  * Here we do all needed work for the former last cylinder group. It has to be
- * changed in any case, even if the file system ended exactly on the end of
+ * changed in any case, even if the filesystem ended exactly on the end of
  * this group, as there is some slightly inconsistent handling of the number
  * of cylinders in the cylinder group. We start again by reading the cylinder
  * group from disk. If the last block was not fully available, we first handle
@@ -780,7 +780,7 @@ updjcg(int cylno, time_t modtime, int fs
 	 * the rotational layout tables and the cluster summary.  This is
 	 * also done per fragment for the first new block if the old file
 	 * system end was not on a block boundary, per fragment for the new
-	 * last block if the new file system end is not on a block boundary,
+	 * last block if the new filesystem end is not on a block boundary,
 	 * and per block for all space in between.
 	 *
 	 * Handle the first new block here if it was partially available
@@ -804,7 +804,7 @@ updjcg(int cylno, time_t modtime, int fs
 			/*
 			 * Check if the fragment just created could join an
 			 * already existing fragment at the former end of the
-			 * file system.
+			 * filesystem.
 			 */
 			if(isblock(&sblock, cg_blksfree(&acg),
 			    ((osblock.fs_size - cgbase(&sblock, cylno))/
@@ -931,7 +931,7 @@ updjcg(int cylno, time_t modtime, int fs
  * Option (1) is considered to be less intrusive to the structure of the file-
  * system. So we try to stick to that whenever possible. If there is not enough
  * space in the cylinder group containing the cylinder summary we have to use
- * method (2). In case of active snapshots in the file system we probably can
+ * method (2). In case of active snapshots in the filesystem we probably can
  * completely avoid implementing copy on write if we stick to method (2) only.
  */
 static void
@@ -1287,7 +1287,7 @@ updcsloc(time_t modtime, int fsi, int fs
 		/*
 		 * No cluster handling is needed here, as there was at least
 		 * one fragment in use by the cylinder summary in the old
-		 * file system.
+		 * filesystem.
 		 * No block-free counter handling here as this block was not
 		 * a free block.
 		 */
@@ -1597,7 +1597,7 @@ wtfs(ufs2_daddr_t bno, size_t size, void
 /*
  * Here we allocate a free block in the current cylinder group. It is assumed,
  * that acg contains the current cylinder group. As we may take a block from
- * somewhere in the file system we have to handle cluster summary here.
+ * somewhere in the filesystem we have to handle cluster summary here.
  */
 static ufs2_daddr_t
 alloc(void)
@@ -1939,9 +1939,9 @@ get_dev_size(int fd, int *size)
 /* ************************************************************** main ***** */
 /*
  * growfs(8)  is a utility which allows to increase the size of an existing
- * ufs file system. Currently this can only be done on unmounted file system.
+ * ufs filesystem. Currently this can only be done on unmounted filesystem.
  * It recognizes some command line options to specify the new desired size,
- * and it does some basic checkings. The old file system size is determined
+ * and it does some basic checkings. The old filesystem size is determined
  * and after some more checks like we can really access the new last block
  * on the disk etc. we calculate the new parameters for the superblock. After
  * having done this we just call growfs() which will do the work.  Before
@@ -1953,11 +1953,11 @@ get_dev_size(int fd, int *size)
  * are lucky, then we only have to handle our blocks to be relocated in that
  * way.
  * Also we have to consider in what order we actually update the critical
- * data structures of the file system to make sure, that in case of a disaster
+ * data structures of the filesystem to make sure, that in case of a disaster
  * fsck(8) is still able to restore any lost data.
  * The foreseen last step then will be to provide for growing even mounted
- * file systems. There we have to extend the mount() system call to provide
- * userland access to the file system locking facility.
+ * filesystems. There we have to extend the mount() system call to provide
+ * userland access to the filesystem locking facility.
  */
 int
 main(int argc, char **argv)
@@ -2088,7 +2088,7 @@ main(int argc, char **argv)
     }
 
 	/*
-	 * Check if that partition is suitable for growing a file system.
+	 * Check if that partition is suitable for growing a filesystem.
 	 */
 	if (p_size < 1) {
 		errx(1, "partition is unavailable");
@@ -2146,8 +2146,8 @@ main(int argc, char **argv)
 	if(ExpertFlag == 0) {
 		for(j=0; j<FSMAXSNAP; j++) {
 			if(sblock.fs_snapinum[j]) {
-				errx(1, "active snapshot found in file system\n"
-				    "	please remove all snapshots before "
+				errx(1, "active snapshot found in filesystem; "
+				    "please remove all snapshots before "
 				    "using growfs");
 			}
 			if(!sblock.fs_snapinum[j]) { /* list is dense */
@@ -2159,19 +2159,19 @@ main(int argc, char **argv)
 
 	if (ExpertFlag == 0 && Nflag == 0) {
 		printf("We strongly recommend you to make a backup "
-		    "before growing the Filesystem\n\n"
-		    " Did you backup your data (Yes/No) ? ");
+		    "before growing the filesystem.\n"
+		    "Did you backup your data (Yes/No)? ");
 		fgets(reply, (int)sizeof(reply), stdin);
 		if (strcmp(reply, "Yes\n")){
-			printf("\n Nothing done \n");
+			printf("\nNothing done\n");
 			exit (0);
 		}
 	}
 
-	printf("new file systemsize is: %jd frags\n", (intmax_t)sblock.fs_size);
+	printf("New filesystem size is %jd frags\n", (intmax_t)sblock.fs_size);
 
 	/*
-	 * Try to access our new last block in the file system. Even if we
+	 * Try to access our new last block in the filesystem. Even if we
 	 * later on realize we have to abort our operation, on that block
 	 * there should be no data, so we can't destroy something yet.
 	 */
@@ -2180,7 +2180,7 @@ main(int argc, char **argv)
 
 	/*
 	 * Now calculate new superblock values and check for reasonable
-	 * bound for new file system size:
+	 * bound for new filesystem size:
 	 *     fs_size:    is derived from label or user input
 	 *     fs_dsize:   should get updated in the routines creating or
 	 *                 updating the cylinder groups on the fly
@@ -2189,7 +2189,7 @@ main(int argc, char **argv)
 	 */
 
 	/*
-	 * Update the number of cylinders and cylinder groups in the file system.
+	 * Update the number of cylinders and cylinder groups in the filesystem.
 	 */
 	if (sblock.fs_magic == FS_UFS1_MAGIC) {
 		sblock.fs_old_ncyl =

Modified: projects/largeSMP/sbin/ipfw/nat.c
==============================================================================
--- projects/largeSMP/sbin/ipfw/nat.c	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sbin/ipfw/nat.c	Wed Jun 22 19:42:32 2011	(r223435)
@@ -785,8 +785,9 @@ ipfw_config_nat(int ac, char **av)
 			len += estimate_redir_port(&ac1, &av1);
 			av1 += 2; ac1 -= 2;
 			/* Skip optional remoteIP/port */
-			if (ac1 != 0 && isdigit(**av1))
+			if (ac1 != 0 && isdigit(**av1)) {
 				av1++; ac1--;
+			}
 			break;
 		case TOK_REDIR_PROTO:
 			if (ac1 < 2)
@@ -795,10 +796,12 @@ ipfw_config_nat(int ac, char **av)
 			len += sizeof(struct cfg_redir);
 			av1 += 2; ac1 -= 2;
 			/* Skip optional remoteIP/port */
-			if (ac1 != 0 && isdigit(**av1))
+			if (ac1 != 0 && isdigit(**av1)) {
 				av1++; ac1--;
-			if (ac1 != 0 && isdigit(**av1))
+			}
+			if (ac1 != 0 && isdigit(**av1)) {
 				av1++; ac1--;
+			}
 			break;
 		default:
 			errx(EX_DATAERR, "unrecognised option ``%s''", av1[-1]);

Modified: projects/largeSMP/sbin/newfs/newfs.8
==============================================================================
--- projects/largeSMP/sbin/newfs/newfs.8	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sbin/newfs/newfs.8	Wed Jun 22 19:42:32 2011	(r223435)
@@ -28,7 +28,7 @@
 .\"     @(#)newfs.8	8.6 (Berkeley) 5/3/95
 .\" $FreeBSD$
 .\"
-.Dd May 25, 2011
+.Dd June 22, 2011
 .Dt NEWFS 8
 .Os
 .Sh NAME
@@ -297,6 +297,7 @@ on file systems that contain many small 
 .Xr dumpfs 8 ,
 .Xr fsck 8 ,
 .Xr gjournal 8 ,
+.Xr growfs 8 ,
 .Xr makefs 8 ,
 .Xr mount 8 ,
 .Xr tunefs 8 ,

Modified: projects/largeSMP/sbin/tunefs/tunefs.8
==============================================================================
--- projects/largeSMP/sbin/tunefs/tunefs.8	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sbin/tunefs/tunefs.8	Wed Jun 22 19:42:32 2011	(r223435)
@@ -28,7 +28,7 @@
 .\"     @(#)tunefs.8	8.2 (Berkeley) 12/11/93
 .\" $FreeBSD$
 .\"
-.Dd May 8, 2011
+.Dd June 22, 2011
 .Dt TUNEFS 8
 .Os
 .Sh NAME
@@ -165,6 +165,7 @@ specified mount point.
 .Xr fs 5 ,
 .Xr dumpfs 8 ,
 .Xr gjournal 8 ,
+.Xr growfs 8 ,
 .Xr newfs 8
 .Rs
 .%A M. McKusick

Modified: projects/largeSMP/sys/amd64/include/pci_cfgreg.h
==============================================================================
--- projects/largeSMP/sys/amd64/include/pci_cfgreg.h	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sys/amd64/include/pci_cfgreg.h	Wed Jun 22 19:42:32 2011	(r223435)
@@ -37,6 +37,7 @@
 #define CONF1_ENABLE_MSK1  0x80000001ul
 #define CONF1_ENABLE_RES1  0x80000000ul
 
+u_long		hostb_alloc_start(int type, u_long start, u_long end, u_long count);
 int		pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
 int		pci_cfgregopen(void);
 u_int32_t	pci_cfgregread(int bus, int slot, int func, int reg, int bytes);

Modified: projects/largeSMP/sys/amd64/pci/pci_bus.c
==============================================================================
--- projects/largeSMP/sys/amd64/pci/pci_bus.c	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sys/amd64/pci/pci_bus.c	Wed Jun 22 19:42:32 2011	(r223435)
@@ -135,7 +135,7 @@ static void
 legacy_pcib_identify(driver_t *driver, device_t parent)
 {
 	int bus, slot, func;
-	u_int8_t  hdrtype;
+	uint8_t  hdrtype;
 	int found = 0;
 	int pcifunchigh;
 	int found824xx = 0;
@@ -178,8 +178,8 @@ legacy_pcib_identify(driver_t *driver, d
 			/*
 			 * Read the IDs and class from the device.
 			 */
-			u_int32_t id;
-			u_int8_t class, subclass, busnum;
+			uint32_t id;
+			uint8_t class, subclass, busnum;
 			const char *s;
 			device_t *devs;
 			int ndevs, i;
@@ -302,35 +302,45 @@ legacy_pcib_write_ivar(device_t dev, dev
 	return ENOENT;
 }
 
+/*
+ * Helper routine for x86 Host-PCI bridge driver resource allocation.
+ * This is used to adjust the start address of wildcard allocation
+ * requests to avoid low addresses that are known to be problematic.
+ *
+ * If no memory preference is given, use upper 32MB slot most BIOSes
+ * use for their memory window.  This is typically only used on older
+ * laptops that don't have PCI busses behind a PCI bridge, so assuming
+ * > 32MB is likely OK.
+ *	
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
 SYSCTL_DECL(_hw_pci);
 
-static unsigned long legacy_host_mem_start = 0x80000000;
-TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start);
-SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
-    &legacy_host_mem_start, 0x80000000,
-    "Limit the host bridge memory to being above this address.  Must be\n\
-set at boot via a tunable.");
+static unsigned long host_mem_start = 0x80000000;
+TUNABLE_ULONG("hw.pci.host_mem_start", &host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, &host_mem_start,
+    0, "Limit the host bridge memory to being above this address.");
+
+u_long
+hostb_alloc_start(int type, u_long start, u_long end, u_long count)
+{
+
+	if (start + count - 1 != end) {
+		if (type == SYS_RES_MEMORY && start < host_mem_start)
+			start = host_mem_start;
+		if (type == SYS_RES_IOPORT && start < 0x1000)
+			start = 0x1000;
+	}
+	return (start);
+}
 
 struct resource *
 legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
     u_long start, u_long end, u_long count, u_int flags)
 {
-    /*
-     * If no memory preference is given, use upper 32MB slot most
-     * bioses use for their memory window.  Typically other bridges
-     * before us get in the way to assert their preferences on memory.
-     * Hardcoding like this sucks, so a more MD/MI way needs to be
-     * found to do it.  This is typically only used on older laptops
-     * that don't have pci busses behind pci bridge, so assuming > 32MB
-     * is liekly OK.
-     *
-     * However, this can cause problems for other chipsets, so we make
-     * this tunable by hw.pci.host_mem_start.
-     */
-    if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
-	start = legacy_host_mem_start;
-    if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
-	start = 0x1000;
+
+    start = hostb_alloc_start(type, start, end, count);
     return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
 	count, flags));
 }

Modified: projects/largeSMP/sys/dev/acpica/acpi_cpu.c
==============================================================================
--- projects/largeSMP/sys/dev/acpica/acpi_cpu.c	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sys/dev/acpica/acpi_cpu.c	Wed Jun 22 19:42:32 2011	(r223435)
@@ -856,6 +856,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc *
 	sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat);
 	if (sc->cpu_cx_states[i].type < ACPI_STATE_C3)
 	    sc->cpu_non_c3 = i;
+	else
+	    cpu_can_deep_sleep = 1;
     }
     sbuf_trim(&sb);
     sbuf_finish(&sb);

Modified: projects/largeSMP/sys/dev/acpica/acpi_pcib_acpi.c
==============================================================================
--- projects/largeSMP/sys/dev/acpica/acpi_pcib_acpi.c	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sys/dev/acpica/acpi_pcib_acpi.c	Wed Jun 22 19:42:32 2011	(r223435)
@@ -357,32 +357,14 @@ acpi_pcib_map_msi(device_t pcib, device_
 	return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
 }
 
-static u_long acpi_host_mem_start = 0x80000000;
-TUNABLE_ULONG("hw.acpi.host_mem_start", &acpi_host_mem_start);
-
 struct resource *
 acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid,
     u_long start, u_long end, u_long count, u_int flags)
 {
-    /*
-     * If no memory preference is given, use upper 32MB slot most
-     * bioses use for their memory window.  Typically other bridges
-     * before us get in the way to assert their preferences on memory.
-     * Hardcoding like this sucks, so a more MD/MI way needs to be
-     * found to do it.  This is typically only used on older laptops
-     * that don't have pci busses behind pci bridge, so assuming > 32MB
-     * is likely OK.
-     *
-     * PCI-PCI bridges may allocate smaller ranges for their windows,
-     * but the heuristics here should apply to those, so we allow
-     * several different end addresses.
-     */
-    if (type == SYS_RES_MEMORY && start == 0UL && (end == ~0UL ||
-	end == 0xffffffff))
-	start = acpi_host_mem_start;
-    if (type == SYS_RES_IOPORT && start == 0UL && (end == ~0UL ||
-	end == 0xffff || end == 0xffffffff))
-	start = 0x1000;
+
+#if defined(__i386__) || defined(__amd64__)
+    start = hostb_alloc_start(type, start, end, count);
+#endif
     return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
 	count, flags));
 }

Modified: projects/largeSMP/sys/dev/acpica/acpi_resource.c
==============================================================================
--- projects/largeSMP/sys/dev/acpica/acpi_resource.c	Wed Jun 22 19:14:49 2011	(r223434)
+++ projects/largeSMP/sys/dev/acpica/acpi_resource.c	Wed Jun 22 19:42:32 2011	(r223435)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/bus.h>
+#include <sys/limits.h>
 #include <sys/malloc.h>
 #include <sys/module.h>
 
@@ -139,6 +140,249 @@ acpi_config_intr(device_t dev, ACPI_RESO
 	INTR_POLARITY_HIGH : INTR_POLARITY_LOW);
 }
 
+struct acpi_resource_context {
+    struct acpi_parse_resource_set *set;
+    device_t	dev;
+    void	*context;
+};
+
+#ifdef ACPI_DEBUG_OUTPUT
+static const char *
+acpi_address_range_name(UINT8 ResourceType)
+{
+    static char buf[16];
+
+    switch (ResourceType) {
+    case ACPI_MEMORY_RANGE:
+	    return ("Memory");
+    case ACPI_IO_RANGE:
+	    return ("IO");
+    case ACPI_BUS_NUMBER_RANGE:
+	    return ("Bus Number");
+    default:
+	    snprintf(buf, sizeof(buf), "type %u", ResourceType);
+	    return (buf);
+    }
+}
+#endif
+	    
+static ACPI_STATUS
+acpi_parse_resource(ACPI_RESOURCE *res, void *context)
+{
+    struct acpi_parse_resource_set *set;
+    struct acpi_resource_context *arc;
+    UINT64 min, max, length, gran;
+    const char *name;
+    device_t dev;
+
+    arc = context;
+    dev = arc->dev;
+    set = arc->set;
+
+    switch (res->Type) {
+    case ACPI_RESOURCE_TYPE_END_TAG:
+	ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "EndTag\n"));
+	break;
+    case ACPI_RESOURCE_TYPE_FIXED_IO:
+	if (res->Data.FixedIo.AddressLength <= 0)
+	    break;
+	ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedIo 0x%x/%d\n",
+	    res->Data.FixedIo.Address, res->Data.FixedIo.AddressLength));
+	set->set_ioport(dev, arc->context, res->Data.FixedIo.Address,
+	    res->Data.FixedIo.AddressLength);
+	break;
+    case ACPI_RESOURCE_TYPE_IO:
+	if (res->Data.Io.AddressLength <= 0)
+	    break;
+	if (res->Data.Io.Minimum == res->Data.Io.Maximum) {
+	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x/%d\n",
+		res->Data.Io.Minimum, res->Data.Io.AddressLength));
+	    set->set_ioport(dev, arc->context, res->Data.Io.Minimum,
+		res->Data.Io.AddressLength);
+	} else {
+	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x-0x%x/%d\n",
+		res->Data.Io.Minimum, res->Data.Io.Maximum,
+		res->Data.Io.AddressLength));
+	    set->set_iorange(dev, arc->context, res->Data.Io.Minimum,
+		res->Data.Io.Maximum, res->Data.Io.AddressLength,
+		res->Data.Io.Alignment);
+	}
+	break;
+    case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
+	if (res->Data.FixedMemory32.AddressLength <= 0)
+	    break;
+	ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedMemory32 0x%x/%d\n",
+	    res->Data.FixedMemory32.Address,
+	    res->Data.FixedMemory32.AddressLength));
+	set->set_memory(dev, arc->context, res->Data.FixedMemory32.Address, 
+	    res->Data.FixedMemory32.AddressLength);
+	break;
+    case ACPI_RESOURCE_TYPE_MEMORY32:
+	if (res->Data.Memory32.AddressLength <= 0)
+	    break;
+	if (res->Data.Memory32.Minimum == res->Data.Memory32.Maximum) {
+	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x/%d\n",
+		res->Data.Memory32.Minimum, res->Data.Memory32.AddressLength));
+	    set->set_memory(dev, arc->context, res->Data.Memory32.Minimum,
+		res->Data.Memory32.AddressLength);
+	} else {
+	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x-0x%x/%d\n",
+		res->Data.Memory32.Minimum, res->Data.Memory32.Maximum,
+		res->Data.Memory32.AddressLength));
+	    set->set_memoryrange(dev, arc->context, res->Data.Memory32.Minimum,
+		res->Data.Memory32.Maximum, res->Data.Memory32.AddressLength,
+		res->Data.Memory32.Alignment);
+	}
+	break;
+    case ACPI_RESOURCE_TYPE_MEMORY24:
+	if (res->Data.Memory24.AddressLength <= 0)
+	    break;
+	if (res->Data.Memory24.Minimum == res->Data.Memory24.Maximum) {
+	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x/%d\n",
+		res->Data.Memory24.Minimum, res->Data.Memory24.AddressLength));
+	    set->set_memory(dev, arc->context, res->Data.Memory24.Minimum,
+		res->Data.Memory24.AddressLength);
+	} else {
+	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x-0x%x/%d\n",
+		res->Data.Memory24.Minimum, res->Data.Memory24.Maximum,
+		res->Data.Memory24.AddressLength));
+	    set->set_memoryrange(dev, arc->context, res->Data.Memory24.Minimum,
+		res->Data.Memory24.Maximum, res->Data.Memory24.AddressLength,
+		res->Data.Memory24.Alignment);
+	}
+	break;
+    case ACPI_RESOURCE_TYPE_IRQ:
+	/*
+	 * from 1.0b 6.4.2 
+	 * "This structure is repeated for each separate interrupt
+	 * required"
+	 */
+	set->set_irq(dev, arc->context, res->Data.Irq.Interrupts,
+	    res->Data.Irq.InterruptCount, res->Data.Irq.Triggering,
+	    res->Data.Irq.Polarity);
+	break;
+    case ACPI_RESOURCE_TYPE_DMA:
+	/*
+	 * from 1.0b 6.4.3 
+	 * "This structure is repeated for each separate DMA channel
+	 * required"
+	 */
+	set->set_drq(dev, arc->context, res->Data.Dma.Channels,
+	    res->Data.Dma.ChannelCount);
+	break;
+    case ACPI_RESOURCE_TYPE_START_DEPENDENT:
+	ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "start dependent functions\n"));
+	set->set_start_dependent(dev, arc->context,
+	    res->Data.StartDpf.CompatibilityPriority);
+	break;
+    case ACPI_RESOURCE_TYPE_END_DEPENDENT:
+	ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "end dependent functions\n"));
+	set->set_end_dependent(dev, arc->context);
+	break;
+    case ACPI_RESOURCE_TYPE_ADDRESS16:
+    case ACPI_RESOURCE_TYPE_ADDRESS32:
+    case ACPI_RESOURCE_TYPE_ADDRESS64:
+    case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
+	switch (res->Type) {
+	case ACPI_RESOURCE_TYPE_ADDRESS16:
+	    gran = res->Data.Address16.Granularity;
+	    min = res->Data.Address16.Minimum;
+	    max = res->Data.Address16.Maximum;
+	    length = res->Data.Address16.AddressLength;
+	    name = "Address16";
+	    break;
+	case ACPI_RESOURCE_TYPE_ADDRESS32:
+	    gran = res->Data.Address32.Granularity;
+	    min = res->Data.Address32.Minimum;
+	    max = res->Data.Address32.Maximum;
+	    length = res->Data.Address32.AddressLength;
+	    name = "Address32";
+	    break;
+	case ACPI_RESOURCE_TYPE_ADDRESS64:
+	    gran = res->Data.Address64.Granularity;
+	    min = res->Data.Address64.Minimum;
+	    max = res->Data.Address64.Maximum;
+	    length = res->Data.Address64.AddressLength;
+	    name = "Address64";
+	    break;
+	default:
+	    KASSERT(res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64,
+		("should never happen"));
+	    gran = res->Data.ExtAddress64.Granularity;
+	    min = res->Data.ExtAddress64.Minimum;
+	    max = res->Data.ExtAddress64.Maximum;
+	    length = res->Data.ExtAddress64.AddressLength;
+	    name = "ExtAddress64";
+	    break;
+	}
+	if (length <= 0)
+	    break;
+	if (res->Data.Address.ProducerConsumer != ACPI_CONSUMER) {
+	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
+		"ignored %s %s producer\n", name,
+		acpi_address_range_name(res->Data.Address.ResourceType)));
+	    break;
+	}
+	if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE &&
+	    res->Data.Address.ResourceType != ACPI_IO_RANGE) {
+	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
+		"ignored %s for non-memory, non-I/O\n", name));
+	    break;
+	}
+
+#ifdef __i386__
+	if (min > ULONG_MAX || (res->Data.Address.MaxAddressFixed && max >
+	    ULONG_MAX)) {
+	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored %s above 4G\n",
+		name));
+	    break;
+	}
+	if (max > ULONG_MAX)
+		max = ULONG_MAX;
+#endif
+	if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED &&
+	    res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) {
+	    if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) {
+		ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%jx/%ju\n",
+		    name, (uintmax_t)min, (uintmax_t)length));
+		set->set_memory(dev, arc->context, min, length);
+	    } else {
+		ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx/%ju\n", name,
+		    (uintmax_t)min, (uintmax_t)length));
+		set->set_ioport(dev, arc->context, min, length);
+	    }
+	} else {
+	    if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) {
+		ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
+		    "%s/Memory 0x%jx-0x%jx/%ju\n", name, (uintmax_t)min,
+		    (uintmax_t)max, (uintmax_t)length));
+		set->set_memoryrange(dev, arc->context, min, max, length, gran);
+	    } else {
+		ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx-0x%jx/%ju\n",
+		    name, (uintmax_t)min, (uintmax_t)max, (uintmax_t)length));
+		set->set_iorange(dev, arc->context, min, max, length, gran);
+	    }
+	}		    
+	break;
+    case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+	if (res->Data.ExtendedIrq.ProducerConsumer != ACPI_CONSUMER) {
+	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored ExtIRQ producer\n"));
+	    break;
+	}
+	set->set_ext_irq(dev, arc->context, res->Data.ExtendedIrq.Interrupts,
+	    res->Data.ExtendedIrq.InterruptCount,
+	    res->Data.ExtendedIrq.Triggering, res->Data.ExtendedIrq.Polarity);
+	break;
+    case ACPI_RESOURCE_TYPE_VENDOR:
+	ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
+	    "unimplemented VendorSpecific resource\n"));
+	break;
+    default:
+	break;
+    }
+    return (AE_OK);
+}
+
 /*
  * Fetch a device's resources and associate them with the device.
  *
@@ -153,318 +397,21 @@ ACPI_STATUS
 acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
 		     struct acpi_parse_resource_set *set, void *arg)
 {
-    ACPI_BUFFER		buf;
-    ACPI_RESOURCE	*res;
-    char		*curr, *last;
+    struct acpi_resource_context arc;
     ACPI_STATUS		status;
-    void		*context;
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
-    /*
-     * Special-case some devices that abuse _PRS/_CRS to mean
-     * something other than "I consume this resource".
-     *
-     * XXX do we really need this?  It's only relevant once
-     *     we start always-allocating these resources, and even
-     *     then, the only special-cased device is likely to be
-     *     the PCI interrupt link.
-     */
-
-    /* Fetch the device's current resources. */
-    buf.Length = ACPI_ALLOCATE_BUFFER;
-    if (ACPI_FAILURE((status = AcpiGetCurrentResources(handle, &buf)))) {
-	if (status != AE_NOT_FOUND && status != AE_TYPE)
-	    printf("can't fetch resources for %s - %s\n",
-		   acpi_name(handle), AcpiFormatException(status));
+    set->set_init(dev, arg, &arc.context);
+    arc.set = set;
+    arc.dev = dev;
+    status = AcpiWalkResources(handle, "_CRS", acpi_parse_resource, &arc);
+    if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
+	printf("can't fetch resources for %s - %s\n",
+	    acpi_name(handle), AcpiFormatException(status));
 	return_ACPI_STATUS (status);
     }
-    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s - got %ld bytes of resources\n",
-		     acpi_name(handle), (long)buf.Length));
-    set->set_init(dev, arg, &context);
-
-    /* Iterate through the resources */
-    curr = buf.Pointer;
-    last = (char *)buf.Pointer + buf.Length;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-projects mailing list