Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 May 2011 21:22:44 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r222548 - in projects/largeSMP: contrib/top sbin/ifconfig sbin/umount share/mk sys/contrib/dev/acpica sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/include sys/contrib/dev/acpi...
Message-ID:  <201105312122.p4VLMi9L040681@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Tue May 31 21:22:44 2011
New Revision: 222548
URL: http://svn.freebsd.org/changeset/base/222548

Log:
  MFC

Modified:
  projects/largeSMP/contrib/top/commands.c
  projects/largeSMP/contrib/top/machine.h
  projects/largeSMP/contrib/top/top.X
  projects/largeSMP/contrib/top/top.c
  projects/largeSMP/sbin/ifconfig/Makefile
  projects/largeSMP/sbin/ifconfig/af_inet.c
  projects/largeSMP/sbin/ifconfig/af_inet6.c
  projects/largeSMP/sbin/ifconfig/af_nd6.c
  projects/largeSMP/sbin/ifconfig/ifconfig.8
  projects/largeSMP/sbin/ifconfig/ifconfig.c
  projects/largeSMP/sbin/umount/umount.8
  projects/largeSMP/sys/contrib/dev/acpica/changes.txt
  projects/largeSMP/sys/contrib/dev/acpica/debugger/dbexec.c
  projects/largeSMP/sys/contrib/dev/acpica/debugger/dbinput.c
  projects/largeSMP/sys/contrib/dev/acpica/debugger/dbutils.c
  projects/largeSMP/sys/contrib/dev/acpica/debugger/dbxface.c
  projects/largeSMP/sys/contrib/dev/acpica/include/acconfig.h
  projects/largeSMP/sys/contrib/dev/acpica/include/acdebug.h
  projects/largeSMP/sys/contrib/dev/acpica/include/acglobal.h
  projects/largeSMP/sys/contrib/dev/acpica/include/aclocal.h
  projects/largeSMP/sys/contrib/dev/acpica/include/acpiosxf.h
  projects/largeSMP/sys/contrib/dev/acpica/include/acpixf.h
  projects/largeSMP/sys/contrib/dev/acpica/include/acpredef.h
  projects/largeSMP/sys/contrib/dev/acpica/osunixxf.c
  projects/largeSMP/sys/contrib/dev/acpica/tables/tbinstal.c
  projects/largeSMP/sys/contrib/pf/net/pf.c
  projects/largeSMP/sys/contrib/pf/net/pf_ioctl.c
  projects/largeSMP/sys/contrib/pf/net/pf_norm.c
  projects/largeSMP/sys/dev/acpica/Osd/OsdDebug.c
  projects/largeSMP/sys/dev/ipw/if_ipw.c
  projects/largeSMP/sys/dev/iwi/if_iwi.c
  projects/largeSMP/sys/dev/iwn/if_iwn.c
  projects/largeSMP/sys/dev/nfe/if_nfe.c
  projects/largeSMP/sys/dev/wpi/if_wpi.c
  projects/largeSMP/sys/fs/nfsclient/nfs_clvnops.c
  projects/largeSMP/sys/i386/pci/pci_cfgreg.c
  projects/largeSMP/sys/ia64/ia64/machdep.c
  projects/largeSMP/sys/ia64/ia64/mp_machdep.c
  projects/largeSMP/sys/ia64/ia64/pmap.c
  projects/largeSMP/sys/kern/kern_idle.c
  projects/largeSMP/sys/kern/sched_4bsd.c
  projects/largeSMP/sys/kern/subr_kdb.c
  projects/largeSMP/sys/kern/subr_msgbuf.c
  projects/largeSMP/sys/kern/subr_pcpu.c
  projects/largeSMP/sys/kern/subr_prf.c
  projects/largeSMP/sys/mips/mips/mp_machdep.c
  projects/largeSMP/sys/net/netisr.c
  projects/largeSMP/sys/powerpc/booke/pmap.c
  projects/largeSMP/sys/powerpc/powerpc/mp_machdep.c
  projects/largeSMP/sys/sparc64/sparc64/mp_machdep.c
  projects/largeSMP/sys/sparc64/sparc64/pmap.c
  projects/largeSMP/sys/sys/msgbuf.h
  projects/largeSMP/sys/sys/pcpu.h
  projects/largeSMP/tools/tools/nanobsd/nanobsd.sh
  projects/largeSMP/usr.bin/tftp/main.c
  projects/largeSMP/usr.bin/top/machine.c
  projects/largeSMP/usr.bin/top/top.local.1
  projects/largeSMP/usr.sbin/pc-sysinstall/backend-query/enable-net.sh
  projects/largeSMP/usr.sbin/pc-sysinstall/backend-query/test-netup.sh
  projects/largeSMP/usr.sbin/pc-sysinstall/backend/functions-networking.sh
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/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/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/contrib/top/commands.c
==============================================================================
--- projects/largeSMP/contrib/top/commands.c	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/contrib/top/commands.c	Tue May 31 21:22:44 2011	(r222548)
@@ -94,6 +94,7 @@ S       - toggle the displaying of syste
 a       - toggle the displaying of process titles\n\
 t       - toggle the display of this process\n\
 u       - display processes for only one user (+ selects all users)\n\
+z       - toggle the displaying of the system idle process\n\
 \n\
 \n", stdout);
     }

Modified: projects/largeSMP/contrib/top/machine.h
==============================================================================
--- projects/largeSMP/contrib/top/machine.h	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/contrib/top/machine.h	Tue May 31 21:22:44 2011	(r222548)
@@ -65,6 +65,7 @@ struct process_select
     int uid;		/* only this uid (unless uid == -1) */
     int wcpu;		/* show weighted cpu */
     int jail;		/* show jail ID */
+    int kidle;		/* show per-CPU idle threads */
     char *command;	/* only this command (unless == NULL) */
 };
 

Modified: projects/largeSMP/contrib/top/top.X
==============================================================================
--- projects/largeSMP/contrib/top/top.X	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/contrib/top/top.X	Tue May 31 21:22:44 2011	(r222548)
@@ -10,7 +10,7 @@ top \- display and update information ab
 .SH SYNOPSIS
 .B top
 [
-.B \-abCHIijnPqStuv
+.B \-abCHIijnPqStuvz
 ] [
 .BI \-d count
 ] [
@@ -89,6 +89,10 @@ Use \*(lqbatch\*(rq mode.  In this mode,
 ignored.  Interrupt characters (such as ^C and ^\e) still have an effect.
 This is the default on a dumb terminal, or when the output is not a terminal.
 .TP
+.B \-H
+Display each thread for a multithreaded process individually.
+By default a single summary line is displayed for each process.
+.TP
 .B \-i
 Use \*(lqinteractive\*(rq mode.  In this mode, any input is immediately
 read for processing.  See the section on \*(lqInteractive Mode\*(rq
@@ -142,6 +146,9 @@ Write version number information to stde
 No other processing takes place when this option is used.  To see current
 revision information while top is running, use the help command \*(lq?\*(rq.
 .TP
+.B \-z
+Do not display the system idle process.
+.TP
 .BI \-d count
 Show only
 .I count
@@ -289,6 +296,9 @@ or
 .BR r enice
 command.
 .TP
+.B H
+Toggle the display of threads.
+.TP
 .B i
 (or
 .BR I )
@@ -303,6 +313,9 @@ ID.
 Toggle the display of the
 .I top
 process.
+.TP
+.B z
+Toggle the display of the system idle process.
 .SH "THE DISPLAY"
 The actual display varies depending on the specific variant of Unix
 that the machine is running.  This description may not exactly match
@@ -352,8 +365,11 @@ the order of the processes, and
 COMMAND is the name of the command that the process is currently running
 (if the process is swapped out, this column is marked \*(lq<swapped>\*(rq).
 .SH NOTES
-The \*(lqABANDONED\*(rq state (known in the kernel as \*(lqSWAIT\*(rq) was
-abandoned, thus the name.  A process should never end up in this state.
+If a process is in the \*(lqSLEEP\*(rq or \*(lqLOCK\*(rq state,
+the state column will report the name of the event or lock on which the
+process is waiting.
+Lock names are prefixed with an asterisk \*(lq*\*(rq while sleep events
+are not.
 .SH AUTHOR
 William LeFebvre, EECS Department, Northwestern University
 .SH ENVIRONMENT

Modified: projects/largeSMP/contrib/top/top.c
==============================================================================
--- projects/largeSMP/contrib/top/top.c	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/contrib/top/top.c	Tue May 31 21:22:44 2011	(r222548)
@@ -196,9 +196,9 @@ char *argv[];
     fd_set readfds;
 
 #ifdef ORDER
-    static char command_chars[] = "\f qh?en#sdkriIutHmSCajo";
+    static char command_chars[] = "\f qh?en#sdkriIutHmSCajzo";
 #else
-    static char command_chars[] = "\f qh?en#sdkriIutHmSCaj";
+    static char command_chars[] = "\f qh?en#sdkriIutHmSCajz";
 #endif
 /* these defines enumerate the "strchr"s of the commands in command_chars */
 #define CMD_redraw	0
@@ -224,8 +224,9 @@ char *argv[];
 #define	CMD_wcputog	19
 #define	CMD_showargs	20
 #define	CMD_jidtog	21
+#define CMD_kidletog	22
 #ifdef ORDER
-#define CMD_order       22
+#define CMD_order       23
 #endif
 
     /* set the buffer for stdout */
@@ -258,6 +259,7 @@ char *argv[];
     ps.thread  = No;
     ps.wcpu    = 1;
     ps.jail    = No;
+    ps.kidle   = Yes;
     ps.command = NULL;
 
     /* get preset options from the environment */
@@ -283,7 +285,7 @@ char *argv[];
 	    optind = 1;
 	}
 
-	while ((i = getopt(ac, av, "CSIHPabijnquvs:d:U:m:o:t")) != EOF)
+	while ((i = getopt(ac, av, "CSIHPabijnquvzs:d:U:m:o:t")) != EOF)
 	{
 	    switch(i)
 	    {
@@ -412,10 +414,14 @@ char *argv[];
 		pcpu_stats = Yes;
 		break;
 
+	      case 'z':
+		ps.kidle = !ps.kidle;
+		break;
+
 	      default:
 		fprintf(stderr,
 "Top version %s\n"
-"Usage: %s [-abCHIijnPqStuv] [-d count] [-m io | cpu] [-o field] [-s time]\n"
+"Usage: %s [-abCHIijnPqStuvz] [-d count] [-m io | cpu] [-o field] [-s time]\n"
 "       [-U username] [number]\n",
 			version_string(), myname);
 		exit(1);
@@ -1075,7 +1081,13 @@ restart:
 				reset_display();
 				putchar('\r');
 				break;
-	    
+			    case CMD_kidletog:
+				ps.kidle = !ps.kidle;
+				new_message(MT_standout | MT_delayed,
+				    " %sisplaying system idle process.",
+				    ps.kidle ? "D" : "Not d");
+				putchar('\r');
+				break;
 			    default:
 				new_message(MT_standout, " BAD CASE IN SWITCH!");
 				putchar('\r');

Modified: projects/largeSMP/sbin/ifconfig/Makefile
==============================================================================
--- projects/largeSMP/sbin/ifconfig/Makefile	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/sbin/ifconfig/Makefile	Tue May 31 21:22:44 2011	(r222548)
@@ -15,10 +15,16 @@ SRCS=	ifconfig.c		# base support
 #     of the toolchain.
 #
 SRCS+=	af_link.c		# LLC support
+.if ${MK_INET_SUPPORT} != "no"
 SRCS+=	af_inet.c		# IPv4 support
+.endif
+.if ${MK_INET6_SUPPORT} != "no"
 SRCS+=	af_inet6.c		# IPv6 support
+.endif
 SRCS+=	af_atalk.c		# AppleTalk support
+.if ${MK_INET6_SUPPORT} != "no"
 SRCS+=	af_nd6.c		# ND6 support
+.endif
 
 SRCS+=	ifclone.c		# clone device support
 SRCS+=	ifmac.c			# MAC support
@@ -38,6 +44,12 @@ SRCS+=	ifpfsync.c		# pfsync(4) support
 SRCS+=	ifbridge.c		# bridge support
 SRCS+=	iflagg.c		# lagg support
 
+.if ${MK_INET6_SUPPORT} != "no"
+CFLAGS+= -DINET6
+.endif
+.if ${MK_INET_SUPPORT} != "no"
+CFLAGS+= -DINET
+.endif
 .if ${MK_IPX_SUPPORT} != "no" && !defined(RELEASE_CRUNCH)
 SRCS+=	af_ipx.c		# IPX support
 DPADD+=	${LIBIPX}

Modified: projects/largeSMP/sbin/ifconfig/af_inet.c
==============================================================================
--- projects/largeSMP/sbin/ifconfig/af_inet.c	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/sbin/ifconfig/af_inet.c	Tue May 31 21:22:44 2011	(r222548)
@@ -200,5 +200,7 @@ static struct afswtch af_inet = {
 static __constructor void
 inet_ctor(void)
 {
+	if (!feature_present("inet"))
+		return;
 	af_register(&af_inet);
 }

Modified: projects/largeSMP/sbin/ifconfig/af_inet6.c
==============================================================================
--- projects/largeSMP/sbin/ifconfig/af_inet6.c	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/sbin/ifconfig/af_inet6.c	Tue May 31 21:22:44 2011	(r222548)
@@ -541,6 +541,9 @@ inet6_ctor(void)
 #define	N(a)	(sizeof(a) / sizeof(a[0]))
 	size_t i;
 
+	if (!feature_present("inet6"))
+		return;
+
 	for (i = 0; i < N(inet6_cmds);  i++)
 		cmd_register(&inet6_cmds[i]);
 	af_register(&af_inet6);

Modified: projects/largeSMP/sbin/ifconfig/af_nd6.c
==============================================================================
--- projects/largeSMP/sbin/ifconfig/af_nd6.c	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/sbin/ifconfig/af_nd6.c	Tue May 31 21:22:44 2011	(r222548)
@@ -225,5 +225,9 @@ static struct afswtch af_nd6 = {
 static __constructor void
 nd6_ctor(void)
 {
+
+	if (!feature_present("inet6"))
+		return;
+
 	af_register(&af_nd6);
 }

Modified: projects/largeSMP/sbin/ifconfig/ifconfig.8
==============================================================================
--- projects/largeSMP/sbin/ifconfig/ifconfig.8	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/sbin/ifconfig/ifconfig.8	Tue May 31 21:22:44 2011	(r222548)
@@ -28,7 +28,7 @@
 .\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd March 20, 2011
+.Dd May 31, 2011
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -42,7 +42,7 @@
 .Op Fl n
 .Ar interface
 .Op Cm create
-.Op Ar address_family
+.Ar address_family
 .Oo
 .Ar address
 .Op Ar dest_address
@@ -165,8 +165,10 @@ and
 .Dq link .
 .\" and
 .\" .Dq ns .
-The default is
-.Dq inet .
+The default if available is
+.Dq inet
+or otherwise
+.Dq link .
 .Dq ether
 and
 .Dq lladdr

Modified: projects/largeSMP/sbin/ifconfig/ifconfig.c
==============================================================================
--- projects/largeSMP/sbin/ifconfig/ifconfig.c	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/sbin/ifconfig/ifconfig.c	Tue May 31 21:22:44 2011	(r222548)
@@ -220,8 +220,10 @@ main(int argc, char *argv[])
 		ifindex = 0;
 		if (argc == 1) {
 			afp = af_getbyname(*argv);
-			if (afp == NULL)
+			if (afp == NULL) {
+				warnx("Address family '%s' unknown.", *argv);
 				usage();
+			}
 			if (afp->af_name != NULL)
 				argc--, argv++;
 			/* leave with afp non-zero */
@@ -484,7 +486,28 @@ ifconfig(int argc, char *const *argv, in
 	int s;
 
 	strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name);
-	afp = uafp != NULL ? uafp : af_getbyname("inet");
+	afp = NULL;
+	if (uafp != NULL)
+		afp = uafp;
+	/*
+	 * This is the historical "accident" allowing users to configure IPv4
+	 * addresses without the "inet" keyword which while a nice feature has
+	 * proven to complicate other things.  We cannot remove this but only
+	 * make sure we will never have a similar implicit default for IPv6 or
+	 * any other address familiy.  We need a fallback though for
+	 * ifconfig IF up/down etc. to work without INET support as people
+	 * never used ifconfig IF link up/down, etc. either.
+	 */
+#ifdef INET
+	if (afp == NULL && feature_present("inet"))
+		afp = af_getbyname("inet");
+#endif
+	if (afp == NULL)
+		afp = af_getbyname("link");
+	if (afp == NULL) {
+		warnx("Please specify an address_family.");
+		usage();
+	}
 top:
 	ifr.ifr_addr.sa_family =
 		afp->af_af == AF_LINK || afp->af_af == AF_UNSPEC ?

Modified: projects/largeSMP/sbin/umount/umount.8
==============================================================================
--- projects/largeSMP/sbin/umount/umount.8	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/sbin/umount/umount.8	Tue May 31 21:22:44 2011	(r222548)
@@ -28,7 +28,7 @@
 .\"     @(#)umount.8	8.2 (Berkeley) 5/8/95
 .\" $FreeBSD$
 .\"
-.Dd July 18, 2003
+.Dd May 31, 2011
 .Dt UMOUNT 8
 .Os
 .Sh NAME
@@ -78,6 +78,9 @@ The file system is forcibly unmounted.
 Active special devices continue to work,
 but all other files return errors if further accesses are attempted.
 The root file system cannot be forcibly unmounted.
+For NFS, a forced dismount can take up to 1 minute or more to
+complete against an unresponsive server and may throw away
+data not yet written to the server for this case.
 .It Fl h Ar host
 Only file systems mounted from the specified host will be
 unmounted.

Modified: projects/largeSMP/sys/contrib/dev/acpica/changes.txt
==============================================================================
--- projects/largeSMP/sys/contrib/dev/acpica/changes.txt	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/sys/contrib/dev/acpica/changes.txt	Tue May 31 21:22:44 2011	(r222548)
@@ -1,31 +1,99 @@
 ----------------------------------------
+27 May 2011. Summary of changes for version 20110527:
+
+This release is available at www.acpica.org/downloads
+
+1) ACPI CA Core Subsystem:
+
+ASL Load() operator: Reinstate most restrictions on the incoming ACPI table 
+signature. Now, only allow SSDT, OEMx, and a null signature. History:
+    1) Originally, we checked the table signature for "SSDT" or "PSDT".
+       (PSDT is now obsolete.)
+    2) We added support for OEMx tables, signature "OEM" plus a fourth
+       "don't care" character.
+    3) Valid tables were encountered with a null signature, so we just
+       gave up on validating the signature, (05/2008).
+    4) We encountered non-AML tables such as the MADT, which caused
+       interpreter errors and kernel faults. So now, we once again allow
+       only SSDT, OEMx, and now, also a null signature. (05/2011).
+
+Added the missing _TDL predefined name to the global name list in order to 
+enable validation. Affects both the core ACPICA code and the iASL compiler.
+
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug 
+version of the code includes the debug output trace mechanism and has a much 
+larger code and data size.
+
+  Previous Release (VC 9.0):
+    Non-Debug Version:  90.0K Code, 23.8K Data, 113.8K Total
+    Debug Version:     164.5K Code, 68.0K Data, 232.5K Total
+  Current Release (VC 9.0):
+    Non-Debug Version:  90.1K Code, 23.9K Data, 114.0K Total
+    Debug Version:     165.6K Code, 68.4K Data, 234.0K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+Debugger/AcpiExec: Implemented support for "complex" method arguments on the 
+debugger command line. This adds support beyond simple integers -- including 
+Strings, Buffers, and Packages. Includes support for nested packages. 
+Increased the default command line buffer size to accommodate these arguments. 
+See the ACPICA reference for details and syntax. ACPICA BZ 917.
+ 
+Debugger/AcpiExec: Implemented support for "default" method arguments for the 
+Execute/Debug command. Now, the debugger will always invoke a control method 
+with the required number of arguments -- even if the command line specifies 
+none or insufficient arguments. It uses default integer values for any missing 
+arguments. Also fixes a bug where only six method arguments maximum were 
+supported instead of the required seven.
+
+Debugger/AcpiExec: Add a maximum buffer length parameter to AcpiOsGetLine and 
+also return status in order to prevent buffer overruns. See the ACPICA 
+reference for details and syntax. ACPICA BZ 921
+
+iASL: Cleaned up support for Berkeley yacc. A general cleanup of code and 
+makefiles to simplify support for the two different but similar parser 
+generators, bison and yacc.
+
+Updated the generic unix makefile for gcc 4. The default gcc version is now 
+expected to be 4 or greater, since options specific to gcc 4 are used.
+
+----------------------------------------
 13 April 2011. Summary of changes for version 20110413:
 
 1) ACPI CA Core Subsystem:
 
 Implemented support to execute a so-called "orphan" _REG method under the EC 
-device. This change will force the execution of a _REG method underneath the EC 
+device. This change will force the execution of a _REG method underneath the 
+EC 
 device even if there is no corresponding operation region of type 
 EmbeddedControl. Fixes a problem seen on some machines and apparently is 
 compatible with Windows behavior. ACPICA BZ 875.
 
 Added more predefined methods that are eligible for automatic NULL package 
-element removal. This change adds another group of predefined names to the list 
+element removal. This change adds another group of predefined names to the 
+list 
 of names that can be repaired by having NULL package elements dynamically 
 removed. This group are those methods that return a single variable-length 
 package containing simple data types such as integers, buffers, strings. This 
-includes: _ALx, _BCL, _CID,_ DOD, _EDL, _FIX, _PCL, _PLD, _PMD, _PRx, _PSL, _Sx, 
+includes: _ALx, _BCL, _CID,_ DOD, _EDL, _FIX, _PCL, _PLD, _PMD, _PRx, _PSL, 
+_Sx, 
 and _TZD. ACPICA BZ 914.
 
-Split and segregated all internal global lock functions to a new file, evglock.c.
+Split and segregated all internal global lock functions to a new file, 
+evglock.c.
 
-Updated internal address SpaceID for DataTable regions. Moved this internal space 
-id in preparation for ACPI 5.0 changes that will include some new space IDs. This 
+Updated internal address SpaceID for DataTable regions. Moved this internal 
+space 
+id in preparation for ACPI 5.0 changes that will include some new space IDs. 
+This 
 change should not affect user/host code.
 
-Example Code and Data Size: These are the sizes for the OS-independent acpica.lib 
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib 
 produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of 
-the code includes the debug output trace mechanism and has a much larger code and 
+the code includes the debug output trace mechanism and has a much larger code 
+and 
 data size.
 
   Previous Release (VC 9.0):
@@ -40,34 +108,44 @@ data size.
 iASL/DTC: Major update for new grammar features. Allow generic data types in 
 custom ACPI tables. Field names are now optional. Any line can be split to 
 multiple lines using the continuation char (\). Large buffers now use line-
-continuation character(s) and no colon on the continuation lines. See the grammar 
+continuation character(s) and no colon on the continuation lines. See the 
+grammar 
 update in the iASL compiler reference. ACPI BZ 910,911. Lin Ming, Bob Moore.
 
 iASL: Mark ASL "Return()" and the simple "Return" as "Null" return statements. 
-Since the parser stuffs a "zero" as the return value for these statements (due to 
+Since the parser stuffs a "zero" as the return value for these statements (due 
+to 
 the underlying AML grammar), they were seen as "return with value" by the iASL 
 semantic checking. They are now seen correctly as "null" return statements.
 
 iASL: Check if a_REG declaration has a corresponding Operation Region. Adds a 
 check for each _REG to ensure that there is in fact a corresponding operation 
-region declaration in the same scope. If not, the _REG method is not very useful 
+region declaration in the same scope. If not, the _REG method is not very 
+useful 
 since it probably won't be executed. ACPICA BZ 915.
 
-iASL/DTC: Finish support for expression evaluation. Added a new expression parser 
-that implements c-style operator precedence and parenthesization. ACPICA bugzilla 
+iASL/DTC: Finish support for expression evaluation. Added a new expression 
+parser 
+that implements c-style operator precedence and parenthesization. ACPICA 
+bugzilla 
 908.
 
-Disassembler/DTC: Remove support for () and <> style comments in data tables. Now 
-that DTC has full expression support, we don't want to have comment strings that 
-start with a parentheses or a less-than symbol. Now, only the standard /* and // 
+Disassembler/DTC: Remove support for () and <> style comments in data tables. 
+Now 
+that DTC has full expression support, we don't want to have comment strings 
+that 
+start with a parentheses or a less-than symbol. Now, only the standard /* and 
+// 
 comments are supported, as well as the bracket [] comments.
 
-AcpiXtract: Fix for RSDP and dynamic SSDT extraction. These tables have "unusual" 
+AcpiXtract: Fix for RSDP and dynamic SSDT extraction. These tables have 
+"unusual" 
 headers in the acpidump file. Update the header validation to support these 
 tables. Problem introduced in previous AcpiXtract version in the change to 
 support "wrong checksum" error messages emitted by acpidump utility.
 
-iASL: Add a * option to generate all template files (as a synonym for ALL) as in 
+iASL: Add a * option to generate all template files (as a synonym for ALL) as 
+in 
 "iasl -T *" or "iasl -T ALL".
 
 iASL/DTC: Do not abort compiler on fatal errors. We do not want to completely 
@@ -81,7 +159,8 @@ invocation.
 1) ACPI CA Core Subsystem:
 
 Fixed a problem caused by a _PRW method appearing at the namespace root scope 
-during the setup of wake GPEs. A fault could occur if a _PRW directly under the 
+during the setup of wake GPEs. A fault could occur if a _PRW directly under 
+the 
 root object was passed to the AcpiSetupGpeForWake interface. Lin Ming.
 
 Implemented support for "spurious" Global Lock interrupts. On some systems, a 
@@ -89,9 +168,11 @@ global lock interrupt can occur without 
 interrupt, we now ensure that a thread is actually waiting for the lock before 
 signaling GL availability. Rafael Wysocki, Bob Moore.
 
-Example Code and Data Size: These are the sizes for the OS-independent acpica.lib 
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib 
 produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of 
-the code includes the debug output trace mechanism and has a much larger code and 
+the code includes the debug output trace mechanism and has a much larger code 
+and 
 data size.
 
   Previous Release (VC 9.0):
@@ -108,14 +189,16 @@ header files, disassembler, table compil
 Lin Ming.
 
 AcpiXtract: Correctly handle embedded comments and messages from AcpiDump. 
-Apparently some or all versions of acpidump will occasionally emit a comment like 
+Apparently some or all versions of acpidump will occasionally emit a comment 
+like 
 "Wrong checksum", etc., into the dump file. This was causing problems for 
 AcpiXtract. ACPICA BZ 905.
 
 iASL: Fix the Linux makefile by removing an inadvertent double file inclusion. 
 ACPICA BZ 913.
 
-AcpiExec: Update installation of operation region handlers. Install one handler 
+AcpiExec: Update installation of operation region handlers. Install one 
+handler 
 for a user-defined address space. This is used by the ASL test suite (ASLTS).
 
 ----------------------------------------

Modified: projects/largeSMP/sys/contrib/dev/acpica/debugger/dbexec.c
==============================================================================
--- projects/largeSMP/sys/contrib/dev/acpica/debugger/dbexec.c	Tue May 31 20:59:53 2011	(r222547)
+++ projects/largeSMP/sys/contrib/dev/acpica/debugger/dbexec.c	Tue May 31 21:22:44 2011	(r222548)
@@ -53,7 +53,8 @@
         ACPI_MODULE_NAME    ("dbexec")
 
 
-static ACPI_DB_METHOD_INFO  AcpiGbl_DbMethodInfo;
+static ACPI_DB_METHOD_INFO          AcpiGbl_DbMethodInfo;
+#define DB_DEFAULT_PKG_ELEMENTS     33
 
 /* Local prototypes */
 
@@ -81,6 +82,348 @@ AcpiDbExecutionWalk (
     void                    *Context,
     void                    **ReturnValue);
 
+static ACPI_STATUS
+AcpiDbHexCharToValue (
+    int                     HexChar,
+    UINT8                   *ReturnValue);
+
+static ACPI_STATUS
+AcpiDbConvertToPackage (
+    char                    *String,
+    ACPI_OBJECT             *Object);
+
+static ACPI_STATUS
+AcpiDbConvertToObject (
+    ACPI_OBJECT_TYPE        Type,
+    char                    *String,
+    ACPI_OBJECT             *Object);
+
+static void
+AcpiDbDeleteObjects (
+    UINT32                  Count,
+    ACPI_OBJECT             *Objects);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbHexCharToValue
+ *
+ * PARAMETERS:  HexChar             - Ascii Hex digit, 0-9|a-f|A-F
+ *              ReturnValue         - Where the converted value is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert a single hex character to a 4-bit number (0-16).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbHexCharToValue (
+    int                     HexChar,
+    UINT8                   *ReturnValue)
+{
+    UINT8                   Value;
+
+
+    /* Digit must be ascii [0-9a-fA-F] */
+
+    if (!ACPI_IS_XDIGIT (HexChar))
+    {
+        return (AE_BAD_HEX_CONSTANT);
+    }
+
+    if (HexChar <= 0x39)
+    {
+        Value = (UINT8) (HexChar - 0x30);
+    }
+    else
+    {
+        Value = (UINT8) (ACPI_TOUPPER (HexChar) - 0x37);
+    }
+
+    *ReturnValue = Value;
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbHexByteToBinary
+ *
+ * PARAMETERS:  HexByte             - Double hex digit (0x00 - 0xFF) in format:
+ *                                    HiByte then LoByte.
+ *              ReturnValue         - Where the converted value is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert two hex characters to an 8 bit number (0 - 255).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbHexByteToBinary (
+    char                    *HexByte,
+    UINT8                   *ReturnValue)
+{
+    UINT8                   Local0;
+    UINT8                   Local1;
+    ACPI_STATUS             Status;
+
+
+    /* High byte */
+
+    Status = AcpiDbHexCharToValue (HexByte[0], &Local0);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    /* Low byte */
+
+    Status = AcpiDbHexCharToValue (HexByte[1], &Local1);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    *ReturnValue = (UINT8) ((Local0 << 4) | Local1);
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbConvertToBuffer
+ *
+ * PARAMETERS:  String              - Input string to be converted
+ *              Object              - Where the buffer object is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert a string to a buffer object. String is treated a list
+ *              of buffer elements, each separated by a space or comma.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbConvertToBuffer (
+    char                    *String,
+    ACPI_OBJECT             *Object)
+{
+    UINT32                  i;
+    UINT32                  j;
+    UINT32                  Length;
+    UINT8                   *Buffer;
+    ACPI_STATUS             Status;
+
+
+    /* Generate the final buffer length */
+
+    for (i = 0, Length = 0; String[i];)
+    {
+        i+=2;
+        Length++;
+
+        while (String[i] &&
+              ((String[i] == ',') || (String[i] == ' ')))
+        {
+            i++;
+        }
+    }
+
+    Buffer = ACPI_ALLOCATE (Length);
+    if (!Buffer)
+    {
+        return (AE_NO_MEMORY);
+    }
+
+    /* Convert the command line bytes to the buffer */
+
+    for (i = 0, j = 0; String[i];)
+    {
+        Status = AcpiDbHexByteToBinary (&String[i], &Buffer[j]);
+        if (ACPI_FAILURE (Status))
+        {
+            ACPI_FREE (Buffer);
+            return (Status);
+        }
+
+        j++;
+        i+=2;
+        while (String[i] &&
+              ((String[i] == ',') || (String[i] == ' ')))
+        {
+            i++;
+        }
+    }
+
+    Object->Type = ACPI_TYPE_BUFFER;
+    Object->Buffer.Pointer = Buffer;
+    Object->Buffer.Length = Length;
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbConvertToPackage
+ *
+ * PARAMETERS:  String              - Input string to be converted
+ *              Object              - Where the package object is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert a string to a package object. Handles nested packages
+ *              via recursion with AcpiDbConvertToObject.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbConvertToPackage (
+    char                    *String,
+    ACPI_OBJECT             *Object)
+{
+    char                    *This;
+    char                    *Next;
+    UINT32                  i;
+    ACPI_OBJECT_TYPE        Type;
+    ACPI_OBJECT             *Elements;
+    ACPI_STATUS             Status;
+
+
+    Elements = ACPI_ALLOCATE_ZEROED (
+        DB_DEFAULT_PKG_ELEMENTS * sizeof (ACPI_OBJECT));
+
+    This = String;
+    for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++)
+    {
+        This = AcpiDbGetNextToken (This, &Next, &Type);
+        if (!This)
+        {
+            break;
+        }
+
+        /* Recursive call to convert each package element */
+
+        Status = AcpiDbConvertToObject (Type, This, &Elements[i]);
+        if (ACPI_FAILURE (Status))
+        {
+            AcpiDbDeleteObjects (i + 1, Elements);
+            ACPI_FREE (Elements);
+            return (Status);
+        }
+
+        This = Next;
+    }
+
+    Object->Type = ACPI_TYPE_PACKAGE;
+    Object->Package.Count = i;
+    Object->Package.Elements = Elements;
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbConvertToObject
+ *
+ * PARAMETERS:  Type                - Object type as determined by parser
+ *              String              - Input string to be converted
+ *              Object              - Where the new object is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert a typed and tokenized string to an ACPI_OBJECT. Typing:
+ *              1) String objects were surrounded by quotes.
+ *              2) Buffer objects were surrounded by parentheses.
+ *              3) Package objects were surrounded by brackets "[]".
+ *              4) All standalone tokens are treated as integers.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbConvertToObject (
+    ACPI_OBJECT_TYPE        Type,
+    char                    *String,
+    ACPI_OBJECT             *Object)
+{
+    ACPI_STATUS             Status = AE_OK;
+
+
+    switch (Type)
+    {
+    case ACPI_TYPE_STRING:
+        Object->Type = ACPI_TYPE_STRING;
+        Object->String.Pointer = String;
+        Object->String.Length = (UINT32) ACPI_STRLEN (String);
+        break;
+
+    case ACPI_TYPE_BUFFER:
+        Status = AcpiDbConvertToBuffer (String, Object);
+        break;
+
+    case ACPI_TYPE_PACKAGE:
+        Status = AcpiDbConvertToPackage (String, Object);
+        break;
+
+    default:
+        Object->Type = ACPI_TYPE_INTEGER;
+        Status = AcpiUtStrtoul64 (String, 16, &Object->Integer.Value);
+        break;
+    }
+
+    return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbDeleteObjects
+ *
+ * PARAMETERS:  Count               - Count of objects in the list
+ *              Objects             - Array of ACPI_OBJECTs to be deleted
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Delete a list of ACPI_OBJECTS. Handles packages and nested
+ *              packages via recursion.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDbDeleteObjects (
+    UINT32                  Count,
+    ACPI_OBJECT             *Objects)
+{
+    UINT32                  i;
+
+
+    for (i = 0; i < Count; i++)
+    {
+        switch (Objects[i].Type)
+        {
+        case ACPI_TYPE_BUFFER:
+            ACPI_FREE (Objects[i].Buffer.Pointer);
+            break;
+
+        case ACPI_TYPE_PACKAGE:
+
+            /* Recursive call to delete package elements */
+
+            AcpiDbDeleteObjects (Objects[i].Package.Count,
+                Objects[i].Package.Elements);
+
+            /* Free the elements array */
+
+            ACPI_FREE (Objects[i].Package.Elements);
+            break;
+
+        default:
+            break;
+        }
+    }
+}
+
 
 /*******************************************************************************
  *
@@ -104,8 +447,8 @@ AcpiDbExecuteMethod (
     ACPI_OBJECT_LIST        ParamObjects;
     ACPI_OBJECT             Params[ACPI_METHOD_NUM_ARGS];
     ACPI_HANDLE             Handle;
-    UINT32                  i;
     ACPI_DEVICE_INFO        *ObjInfo;
+    UINT32                  i;
 
 
     ACPI_FUNCTION_TRACE (DbExecuteMethod);
@@ -139,25 +482,37 @@ AcpiDbExecuteMethod (
     {
         /* Are there arguments to the method? */
 
+        i = 0;
         if (Info->Args && Info->Args[0])
         {
-            for (i = 0; Info->Args[i] &&
+            /* Get arguments passed on the command line */
+
+            for (; Info->Args[i] &&
                 (i < ACPI_METHOD_NUM_ARGS) &&
                 (i < ObjInfo->ParamCount);
                 i++)
             {
-                Params[i].Type          = ACPI_TYPE_INTEGER;
-                Params[i].Integer.Value = ACPI_STRTOUL (Info->Args[i], NULL, 16);
-            }
+                /* Convert input string (token) to an actual ACPI_OBJECT */
 
-            ParamObjects.Pointer = Params;
-            ParamObjects.Count   = i;
+                Status = AcpiDbConvertToObject (Info->Types[i],
+                    Info->Args[i], &Params[i]);
+                if (ACPI_FAILURE (Status))
+                {
+                    ACPI_EXCEPTION ((AE_INFO, Status,
+                        "While parsing method arguments"));
+                    goto Cleanup;
+                }
+            }
         }
-        else
+
+        /* Create additional "default" parameters as needed */
+
+        if (i < ObjInfo->ParamCount)
         {
-            /* Setup default parameters */
+            AcpiOsPrintf ("Adding %u arguments containing default values\n",
+                ObjInfo->ParamCount - i);
 
-            for (i = 0; i < ObjInfo->ParamCount; i++)
+            for (; i < ObjInfo->ParamCount; i++)
             {
                 switch (i)
                 {
@@ -181,13 +536,11 @@ AcpiDbExecuteMethod (
                     break;
                 }
             }
-
-            ParamObjects.Pointer     = Params;
-            ParamObjects.Count       = ObjInfo->ParamCount;
         }
-    }
 
-    ACPI_FREE (ObjInfo);
+        ParamObjects.Count = ObjInfo->ParamCount;
+        ParamObjects.Pointer = Params;
+    }
 
     /* Prepare for a return object of arbitrary size */
 
@@ -198,7 +551,7 @@ AcpiDbExecuteMethod (
 
     AcpiGbl_MethodExecuting = TRUE;
     Status = AcpiEvaluateObject (NULL,
-                Info->Pathname, &ParamObjects, ReturnObj);
+        Info->Pathname, &ParamObjects, ReturnObj);
 
     AcpiGbl_CmSingleStep = FALSE;
     AcpiGbl_MethodExecuting = FALSE;
@@ -206,16 +559,20 @@ AcpiDbExecuteMethod (
     if (ACPI_FAILURE (Status))
     {
         ACPI_EXCEPTION ((AE_INFO, Status,
-        "while executing %s from debugger", Info->Pathname));
+            "while executing %s from debugger", Info->Pathname));
 
         if (Status == AE_BUFFER_OVERFLOW)
         {
             ACPI_ERROR ((AE_INFO,
-            "Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)",
+                "Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)",
                 ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
         }
     }
 
+Cleanup:
+    AcpiDbDeleteObjects (ObjInfo->ParamCount, Params);
+    ACPI_FREE (ObjInfo);
+
     return_ACPI_STATUS (Status);
 }
 
@@ -380,6 +737,7 @@ void
 AcpiDbExecute (

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



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