PERFORCE change 40248 for review

Robert Watson rwatson at FreeBSD.org
Thu Oct 23 02:41:59 GMT 2003


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

Change 40248 by rwatson at rwatson_paprika on 2003/10/22 19:41:21

	Integrate trustedbsd_sebsd usr.sbin tree forward to 39070, the
	last major integration of the trustedbsd_mac branch, which brings
	in many of the major changes in the last four months to the main
	FreeBSD tree.  This includes substantial lock pushdown, threading
	bug fixes, compiler upgrades, et al.  
	
	ACPI upgrade.  IPv6 upgrades.

Affected files ...

.. //depot/projects/trustedbsd/sebsd/usr.sbin/Makefile#6 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/Makefile#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/Makefile.inc#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpiconf/acpiconf.8#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpiconf/acpiconf.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidb/Makefile#1 branch
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidb/acpidb.8#1 branch
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidb/acpidb.c#1 branch
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidump/Makefile#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidump/acpi.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidump/acpi_user.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidump/acpidump.8#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidump/acpidump.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidump/acpidump.h#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidump/aml_dump.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidump/asl_dump.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/Makefile#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_amlmem.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_amlmem.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_common.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_common.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_env.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_evalobj.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_evalobj.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_memman.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_memman.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_name.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_name.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_obj.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_obj.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_parse.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_parse.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_region.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_region.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_status.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_store.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/aml/aml_store.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/amldb.8#4 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/amldb.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/debug.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/debug.h#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/amldb/region.c#2 delete
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/iasl/Makefile#1 branch
.. //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/iasl/iasl.8#1 branch
.. //depot/projects/trustedbsd/sebsd/usr.sbin/adduser/adduser.8#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/amd/include/config.h#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/ancontrol/ancontrol.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/asf/asf.8#3 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/asf/asf.c#3 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/boot0cfg/boot0cfg.8#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/cdcontrol/cdcontrol.1#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/cdcontrol/cdcontrol.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/chown/chown.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/config/config.8#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/crunch/crunchide/exec_elf32.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/ctm/mkCTM/mkctm.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/edquota/edquota.8#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/fwcontrol/fwcontrol.8#3 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/fwcontrol/fwcontrol.c#3 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/i4b/isdnd/isdnd.rc.5#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/i4b/isdndebug/isdndebug.8#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/lpr/lpd/lpd.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/lpr/lpd/printjob.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/lpr/lpd/recvjob.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/mptable/Makefile#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/mptable/mptable.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/mrouted/mrouted.8#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/mtree/mtree.8#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/newsyslog/Makefile#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/newsyslog/extern.h#1 branch
.. //depot/projects/trustedbsd/sebsd/usr.sbin/newsyslog/newsyslog.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/newsyslog/ptimes.c#1 branch
.. //depot/projects/trustedbsd/sebsd/usr.sbin/nghook/Makefile#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/nghook/main.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/nghook/nghook.8#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/pkg_install/create/pkg_create.1#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/ppp/command.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/ppp/nat_cmd.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/ppp/nat_cmd.h#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/ppp/ppp.8.m4#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/pw/pw.conf.5#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rarpd/rarpd.8#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rarpd/rarpd.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rmt/rmt.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/route6d/Makefile#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/route6d/route6d.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/route6d/route6d.h#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/Makefile#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/advcap.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/advcap.h#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/config.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/config.h#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/dump.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/if.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/if.h#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/rrenum.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/rtadvd.8#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/rtadvd.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/rtadvd.conf#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/rtadvd.conf.5#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/rtadvd.h#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/timer.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtadvd/timer.h#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtsold/Makefile#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtsold/dump.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtsold/if.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtsold/probe.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtsold/rtsock.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtsold/rtsol.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtsold/rtsold.8#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtsold/rtsold.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/rtsold/rtsold.h#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/Makefile#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/config.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/devices.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/disks.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/dispatch.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/dist.c#5 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/dist.h#5 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/dmenu.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/install.c#6 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/main.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/menus.c#6 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/modules.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/options.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/pccard.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/sysinstall/sysinstall.h#5 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/syslogd/syslogd.8#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/vidcontrol/vidcontrol.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/wicontrol/wicontrol.8#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/wicontrol/wicontrol.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/usr.sbin/zzz/zzz.8#3 integrate

Differences ...

==== //depot/projects/trustedbsd/sebsd/usr.sbin/Makefile#6 (text+ko) ====

@@ -1,5 +1,5 @@
 #	From: @(#)Makefile	5.20 (Berkeley) 6/12/93
-# $FreeBSD: src/usr.sbin/Makefile,v 1.266 2003/07/25 18:22:53 peter Exp $
+# $FreeBSD: src/usr.sbin/Makefile,v 1.273 2003/09/30 04:19:01 peter Exp $
 
 .if ${MACHINE_ARCH} != "powerpc"
 _sysinstall=sysinstall
@@ -13,7 +13,6 @@
 	amd \
 	ancontrol \
 	arp \
-	atm \
 	bootparamd \
 	burncd \
 	cdcontrol \
@@ -57,7 +56,6 @@
 	memcontrol \
 	mergemaster \
 	mixer \
-	mld6query \
 	mlxcontrol \
 	mount_portalfs \
 	mountd \
@@ -86,9 +84,7 @@
 	rarpd \
 	raycontrol \
 	repquota \
-	rip6query \
 	rmt \
-	route6d \
 	rpcbind \
 	rpc.lockd \
 	rpc.statd \
@@ -116,12 +112,9 @@
 	tcpdump \
 	timed \
 	traceroute \
-	traceroute6 \
 	trpt \
 	tzsetup \
 	ugidfw \
-	usbd \
-	usbdevs \
 	vidcontrol \
 	vipw \
 	vnconfig \
@@ -136,6 +129,17 @@
 	ypset \
 	zic
 
+.if !defined(NOATM)
+SUBDIR+=atm
+.endif
+
+.if !defined(NOINET6)
+SUBDIR+=mld6query \
+	rip6query \
+	route6d \
+	traceroute6 
+.endif
+
 .if !defined(NO_IPFILTER)
 SUBDIR+=ipftest \
 	ipresend \
@@ -143,7 +147,11 @@
 	iptest
 .endif
 
-.if !defined(NOLIBC_R)
+.if !defined(NO_USB)
+SUBDIR+=usbd \
+	usbdevs
+.endif
+.if !defined(NOLIBC_R) && ${MACHINE_ARCH} != "powerpc"
 SUBDIR+=pppctl
 .endif
 
@@ -174,9 +182,9 @@
 .endif
 
 .if ${MACHINE_ARCH} == "i386"
-SUBDIR+=acpi \
-	apm \
+SUBDIR+=apm \
 	apmd \
+	asf \
 	btxld \
 	kgmon \
 	kgzip \
@@ -193,9 +201,19 @@
 	stallion \
 	wlconfig \
 	zzz
+
+.if !defined(NO_ACPI)
+SUBDIR+=acpi
+.endif
+
 .if !defined(NO_I4B)
 SUBDIR+=i4b
 .endif
+
+.endif
+
+.if ${MACHINE_ARCH} == "ia64"
+SUBDIR+=acpi
 .endif
 
 # kgmon: builds, but no kernel profiling
@@ -204,11 +222,13 @@
 # pnpinfo: crashes (not really useful anyway)
 .if ${MACHINE_ARCH} == "amd64"
 SUBDIR+=acpi \
+	asf \
 	boot0cfg \
 	btxld \
 	lptcontrol \
 	mount_nwfs \
 	mount_smbfs \
+	mptable \
 	sicontrol \
 	spkrtest \
 	zzz

==== //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/Makefile#2 (text+ko) ====

@@ -1,7 +1,7 @@
 # Makefile for acpi tools
 # $Id: Makefile,v 1.1 2000/07/14 18:16:22 iwasaki Exp $
-# $FreeBSD: src/usr.sbin/acpi/Makefile,v 1.2 2001/07/20 06:20:31 obrien Exp $
+# $FreeBSD: src/usr.sbin/acpi/Makefile,v 1.3 2003/08/08 03:20:59 njl Exp $
 
-SUBDIR= acpiconf acpidump amldb
+SUBDIR= acpiconf acpidb acpidump iasl
 
 .include <bsd.subdir.mk>

==== //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/Makefile.inc#2 (text+ko) ====

@@ -1,8 +1,11 @@
 # $Id: Makefile.inc,v 1.1 2000/07/14 18:16:22 iwasaki Exp $
-# $FreeBSD: src/usr.sbin/acpi/Makefile.inc,v 1.7 2002/09/17 14:56:23 jhb Exp $
+# $FreeBSD: src/usr.sbin/acpi/Makefile.inc,v 1.8 2003/08/07 16:51:50 njl Exp $
 
-CFLAGS+= -I${.CURDIR}/../../../sys
+ACPICA_DIR= ${.CURDIR}/../../../sys/contrib/dev/acpica
+CFLAGS+= -I${.CURDIR}/../../../sys -I${ACPICA_DIR} -I${ACPICA_DIR}/compiler
 
 .if exists(${.CURDIR}/../../Makefile.inc)
 .include "${.CURDIR}/../../Makefile.inc"
 .endif
+
+.PATH:	${ACPICA_DIR} ${ACPICA_DIR}/compiler ${ACPICA_DIR}/common

==== //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpiconf/acpiconf.8#4 (text+ko) ====

@@ -25,7 +25,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\"      $FreeBSD: src/usr.sbin/acpi/acpiconf/acpiconf.8,v 1.9 2003/07/28 16:22:45 njl Exp $
+.\"      $FreeBSD: src/usr.sbin/acpi/acpiconf/acpiconf.8,v 1.10 2003/09/13 20:13:01 njl Exp $
 .\"
 .Dd January 12, 2001
 .Dt ACPICONF 8
@@ -36,6 +36,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl deh
+.Op Fl i Ar batt
 .Op Fl s Ar type
 .Sh DESCRIPTION
 The
@@ -50,6 +51,8 @@
 Enables ACPI power management.
 .It Fl h
 Displays a summary of available options.
+.It Fl i Ar batt
+Get design information about the specified battery.
 .It Fl s Ar type
 Enters the specified sleep mode.
 Recognized types are

==== //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpiconf/acpiconf.c#4 (text+ko) ====

@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  *	$Id: acpiconf.c,v 1.5 2000/08/08 14:12:19 iwasaki Exp $
- *	$FreeBSD: src/usr.sbin/acpi/acpiconf/acpiconf.c,v 1.10 2003/07/28 16:22:45 njl Exp $
+ *	$FreeBSD: src/usr.sbin/acpi/acpiconf/acpiconf.c,v 1.11 2003/09/13 20:13:01 njl Exp $
  */
 
 #include <sys/param.h>
@@ -42,22 +42,25 @@
 
 #define ACPIDEV	"/dev/acpi"
 
+static int	acpifd;
+
 static int
+acpi_init()
+{
+	acpifd = open(ACPIDEV, O_RDWR);
+	if (acpifd == -1)
+		err(EX_OSFILE, ACPIDEV);
+}
+
+static int
 acpi_enable_disable(int enable)
 {
-	int	fd;
-
-	fd  = open(ACPIDEV, O_RDWR);
-	if (fd == -1) {
-		err(EX_OSFILE, ACPIDEV);
-	}
-	if (ioctl(fd, enable, NULL) == -1) {
+	if (ioctl(acpifd, enable, NULL) == -1) {
 		if (enable == ACPIIO_ENABLE)
 			err(EX_IOERR, "enable failed");
 		else
 			err(EX_IOERR, "disable failed");
 	}
-	close(fd);
 
 	return (0);
 }
@@ -65,16 +68,43 @@
 static int
 acpi_sleep(int sleep_type)
 {
-	int	fd;
+	if (ioctl(acpifd, ACPIIO_SETSLPSTATE, &sleep_type) == -1)
+		err(EX_IOERR, "sleep type (%d) failed", sleep_type);
+
+	return (0);
+}
+
+static int
+acpi_battinfo(int num)
+{
+	union acpi_battery_ioctl_arg battio;
+	const char *pwr_units;
+
+	if (num < 0 || num > 64)
+		err(EX_USAGE, "invalid battery %d", num);
+
+	battio.unit = num;
+	if (ioctl(acpifd, ACPIIO_CMBAT_GET_BIF, &battio) == -1)
+		err(EX_IOERR, "get battery info (%d) failed", num);
+	printf("Battery %d information\n", num);
+	if (battio.bif.units == 0)
+		pwr_units = "mWh";
+	else
+		pwr_units = "mAh";
 
-	fd  = open(ACPIDEV, O_RDWR);
-	if (fd == -1) {
-		err(EX_OSFILE, ACPIDEV);
-	}
-	if (ioctl(fd, ACPIIO_SETSLPSTATE, &sleep_type) == -1) {
-		err(EX_IOERR, "sleep type (%d) failed", sleep_type);
-	}
-	close(fd);
+	printf("Design capacity:\t%d %s\n", battio.bif.dcap, pwr_units);
+	printf("Last full capacity:\t%d %s\n", battio.bif.lfcap, pwr_units);
+	printf("Technology:\t\t%s\n", battio.bif.btech == 0 ?
+	    "primary (non-rechargeable)" : "secondary (rechargeable)");
+	printf("Design voltage:\t\t%d mV\n", battio.bif.dvol);
+	printf("Capacity (warn):\t%d %s\n", battio.bif.wcap, pwr_units);
+	printf("Capacity (low):\t\t%d %s\n", battio.bif.lcap, pwr_units);
+	printf("Low/warn granularity:\t%d %s\n", battio.bif.gra1, pwr_units);
+	printf("Warn/full granularity:\t%d %s\n", battio.bif.gra2, pwr_units);
+	printf("Model number:\t\t%s\n", battio.bif.model);
+	printf("Serial number:\t\t%s\n", battio.bif.serial);
+	printf("Type:\t\t\t%s\n", battio.bif.type);
+	printf("OEM info:\t\t%s\n", battio.bif.oeminfo);
 
 	return (0);
 }
@@ -82,7 +112,7 @@
 static void
 usage(const char* prog)
 {
-	printf("usage: %s [-deh] [-s [1|2|3|4|4b|5]]\n", prog);
+	printf("usage: %s [-deh] [-i batt] [-s 1-5]\n", prog);
 	exit(0);
 }
 
@@ -93,21 +123,23 @@
 	int	sleep_type;
 
 	prog = argv[0];
+	if (argc < 2)
+		usage(prog);
+		/* NOTREACHED */
+
 	sleep_type = -1;
-	while ((c = getopt(argc, argv, "dehs:")) != -1) {
+	acpi_init();
+	while ((c = getopt(argc, argv, "dehi:s:")) != -1) {
 		switch (c) {
+		case 'i':
+			acpi_battinfo(atoi(optarg));
+			break;
 		case 'd':
 			acpi_enable_disable(ACPIIO_DISABLE);
 			break;
-
 		case 'e':
 			acpi_enable_disable(ACPIIO_ENABLE);
 			break;
-
-		case 'h':
-			usage(prog);
-			break;
-
 		case 's':
 			if (optarg[0] == 'S')
 				sleep_type = optarg[1] - '0';
@@ -115,17 +147,22 @@
 				sleep_type = optarg[0] - '0';
 			if (sleep_type < 0 || sleep_type > 5)
 				errx(EX_USAGE, "invalid sleep type (%d)",
-				    sleep_type);
+				     sleep_type);
 			break;
+		case 'h':
 		default:
-			argc -= optind;
-			argv += optind;
+			usage(prog);
+			/* NOTREACHED */
 		}
 	}
+	argc -= optind;
+	argv += optind;
 
 	if (sleep_type != -1) {
 		sleep(1);	/* wait 1 sec. for key-release event */
 		acpi_sleep(sleep_type);
 	}
-	return (0);
+
+	close(acpifd);
+	exit (0);
 }

==== //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidump/Makefile#2 (text+ko) ====

@@ -1,13 +1,8 @@
-# $Id: Makefile,v 1.2 2000/07/14 18:16:29 iwasaki Exp $
-# $FreeBSD: src/usr.sbin/acpi/acpidump/Makefile,v 1.6 2001/10/22 17:25:25 iwasaki Exp $
+# $FreeBSD: src/usr.sbin/acpi/acpidump/Makefile,v 1.7 2003/08/28 03:33:07 njl Exp $
 
 PROG=	acpidump
 MAN=	acpidump.8
-SRCS=	acpi.c acpi_user.c asl_dump.c aml_dump.c acpidump.c
-SRCS+=	aml_parse.c aml_name.c aml_amlmem.c aml_memman.c aml_store.c \
-	aml_obj.c aml_evalobj.c aml_common.c
+SRCS=	acpi.c acpi_user.c acpidump.c
+WARNS?=	6
 
-CFLAGS+= -I${.CURDIR}/../amldb
-
 .include <bsd.prog.mk>
-.PATH:	${.CURDIR}/../amldb/aml

==== //depot/projects/trustedbsd/sebsd/usr.sbin/acpi/acpidump/acpi.c#4 (text+ko) ====

@@ -24,62 +24,48 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$Id: acpi.c,v 1.4 2000/08/09 14:47:52 iwasaki Exp $
- *	$FreeBSD: src/usr.sbin/acpi/acpidump/acpi.c,v 1.9 2003/08/02 01:58:33 peter Exp $
+ *	$FreeBSD: src/usr.sbin/acpi/acpidump/acpi.c,v 1.20 2003/09/21 03:51:48 njl Exp $
  */
 
 #include <sys/param.h>
+#include <sys/endian.h>
 #include <sys/stat.h>
-
+#include <sys/wait.h>
 #include <assert.h>
 #include <err.h>
 #include <fcntl.h>
 #include <stdio.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "acpidump.h"
 
-#include "aml/aml_env.h"
-#include "aml/aml_common.h"
-
 #define BEGIN_COMMENT	"/*\n"
 #define END_COMMENT	" */\n"
 
-struct ACPIsdt	dsdt_header = {
-	"DSDT", 0, 1, 0, "OEMID", "OEMTBLID", 0x12345678, "CRTR", 0x12345678
-};
+static void	acpi_print_string(char *s, size_t length);
+static void	acpi_print_gas(struct ACPIgas *gas);
+static void	acpi_handle_fadt(struct FADTbody *fadt);
+static void	acpi_print_cpu(u_char cpu_id);
+static void	acpi_print_local_apic(u_char cpu_id, u_char apic_id,
+				      u_int32_t flags);
+static void	acpi_print_io_apic(u_char apic_id, u_int32_t int_base,
+				   u_int64_t apic_addr);
+static void	acpi_print_mps_flags(u_int16_t flags);
+static void	acpi_print_intr(u_int32_t intr, u_int16_t mps_flags);
+static void	acpi_print_apic(struct MADT_APIC *mp);
+static void	acpi_handle_apic(struct ACPIsdt *sdp);
+static void	acpi_handle_hpet(struct ACPIsdt *sdp);
+static void	acpi_print_sdt(struct ACPIsdt *sdp);
+static void	acpi_print_fadt(struct FADTbody *fadt);
+static void	acpi_print_facs(struct FACSbody *facs);
+static void	acpi_print_dsdt(struct ACPIsdt *dsdp);
+static struct ACPIsdt *acpi_map_sdt(vm_offset_t pa);
+static void	acpi_print_rsd_ptr(struct ACPIrsdp *rp);
+static void	acpi_handle_rsdt(struct ACPIsdt *rsdp);
 
-static void
-acpi_trim_string(char *s, size_t length)
-{
-
-	/* Trim trailing spaces and NULLs */
-	while (length > 0 && (s[length - 1] == ' ' || s[length - 1] == '\0'))
-		s[length-- - 1] = '\0';
-}
-
-static void
-acpi_print_dsdt_definition(void)
-{
-	char	oemid[6 + 1];
-	char	oemtblid[8 + 1];
-
-	acpi_trim_string(dsdt_header.oemid, 6);
-	acpi_trim_string(dsdt_header.oemtblid, 8);
-	strncpy(oemid, dsdt_header.oemid, 6);
-	oemid[6] = '\0';
-	strncpy(oemtblid, dsdt_header.oemtblid, 8);
-	oemtblid[8] = '\0';
-
-	printf("DefinitionBlock (\n"
-	       "    \"acpi_dsdt.aml\",	//Output filename\n"
-	       "    \"DSDT\",		//Signature\n"
-	       "    0x%x,		//DSDT Revision\n"
-	       "    \"%s\",		//OEMID\n"
-	       "    \"%s\",		//TABLE ID\n"
-	       "    0x%x		//OEM Revision\n)\n",
-		dsdt_header.rev, oemid, oemtblid, dsdt_header.oemrev);
-}
+/* Size of an address. 32-bit for ACPI 1.0, 64-bit for ACPI 2.0 and up. */
+static int addr_size;
 
 static void
 acpi_print_string(char *s, size_t length)
@@ -97,29 +83,70 @@
 }
 
 static void
-acpi_handle_dsdt(struct ACPIsdt *dsdp)
+acpi_print_gas(struct ACPIgas *gas)
 {
-	u_int8_t       *dp;
-	u_int8_t       *end;
-
-	acpi_print_dsdt(dsdp);
-	dp = (u_int8_t *)dsdp->body;
-	end = (u_int8_t *)dsdp + dsdp->len;
-
-	acpi_dump_dsdt(dp, end);
+	switch(gas->address_space_id) {
+	case ACPI_GAS_MEMORY:
+		printf("0x%08lx:%u[%u] (Memory)", (u_long)gas->address,
+		       gas->bit_offset, gas->bit_width);
+		break;
+	case ACPI_GAS_IO:
+		printf("0x%02lx:%u[%u] (IO)", (u_long)gas->address,
+		       gas->bit_offset, gas->bit_width);
+		break;
+	case ACPI_GAS_PCI:
+		printf("%x:%x+0x%x (PCI)", (uint16_t)(gas->address >> 32),
+		       (uint16_t)((gas->address >> 16) & 0xffff),
+		       (uint16_t)gas->address);
+		break;
+	/* XXX How to handle these below? */
+	case ACPI_GAS_EMBEDDED:
+		printf("0x%x:%u[%u] (EC)", (uint16_t)gas->address,
+		       gas->bit_offset, gas->bit_width);
+		break;
+	case ACPI_GAS_SMBUS:
+		printf("0x%x:%u[%u] (SMBus)", (uint16_t)gas->address,
+		       gas->bit_offset, gas->bit_width);
+		break;
+	case ACPI_GAS_FIXED:
+	default:
+		printf("0x%08lx (?)", (u_long)gas->address);
+		break;
+	}
 }
 
 static void
-acpi_handle_facp(struct FACPbody *facp)
+acpi_handle_fadt(struct FADTbody *fadt)
 {
-	struct	ACPIsdt *dsdp;
+	struct ACPIsdt	*dsdp;
+	struct FACSbody	*facs;
+
+	acpi_print_fadt(fadt);
+
+	/*
+	 * My T23 is revision 2 but the 64 bit addresses are invalid.
+	 * If revision 2 and the 32 bit address is non-zero but the 32
+	 * and 64 bit versions don't match, prefer the 32 bit version.
+	 */
+	if (addr_size == 4 ||
+	    (addr_size == 8 && fadt->facs_ptr != 0 &&
+	    (fadt->x_facs_ptr & 0xffffffff) != fadt->facs_ptr))
+		facs = (struct FACSbody *)acpi_map_sdt(fadt->facs_ptr);
+	else
+		facs = (struct FACSbody *)acpi_map_sdt(fadt->x_facs_ptr);
+	if (memcmp(facs->signature, "FACS", 4) != 0 || facs->len < 64)
+		errx(1, "FACS is corrupt");
+	acpi_print_facs(facs);
 
-	acpi_print_facp(facp);
-	dsdp = (struct ACPIsdt *) acpi_map_sdt(facp->dsdt_ptr);
+	if (addr_size == 4 ||
+	    (addr_size == 8 && fadt->dsdt_ptr != 0 &&
+	    (fadt->x_dsdt_ptr & 0xffffffff) != fadt->dsdt_ptr))
+		dsdp = (struct ACPIsdt *)acpi_map_sdt(fadt->dsdt_ptr);
+	else
+		dsdp = (struct ACPIsdt *)acpi_map_sdt(fadt->x_dsdt_ptr);
 	if (acpi_checksum(dsdp, dsdp->len))
-		errx(1, "DSDT is corrupt\n");
-	acpi_handle_dsdt(dsdp);
-	aml_dump(dsdp);
+		errx(1, "DSDT is corrupt");
+	acpi_print_dsdt(dsdp);
 }
 
 static void
@@ -149,17 +176,9 @@
 static void
 acpi_print_io_apic(u_char apic_id, u_int32_t int_base, u_int64_t apic_addr)
 {
-	u_int addr_hi;
-	
 	printf("\tAPIC ID=%d\n", (u_int)apic_id);
 	printf("\tINT BASE=%d\n", int_base);
-	printf("\tADDR=0x");
-	addr_hi = apic_addr >> 32;
-	if (addr_hi != 0) {
-		printf("%08x", addr_hi);
-		apic_addr &= 0xffffffff;
-	}
-	printf("%08x\n", (u_int)apic_addr);
+	printf("\tADDR=0x%016jx\n", apic_addr);
 }
 
 static void
@@ -242,9 +261,8 @@
 		acpi_print_mps_flags(mp->body.local_nmi.mps_flags);
 		break;
 	case ACPI_MADT_APIC_TYPE_LOCAL_OVERRIDE:
-		printf("\tLocal APIC ADDR=0x%08x%08x\n",
-		    (u_int)(mp->body.local_apic_override.apic_addr >> 32),
-		    (u_int)(mp->body.local_apic_override.apic_addr & 0xffffffff));
+		printf("\tLocal APIC ADDR=0x%016jx\n",
+		    mp->body.local_apic_override.apic_addr);
 		break;
 	case ACPI_MADT_APIC_TYPE_IO_SAPIC:
 		acpi_print_io_apic(mp->body.io_sapic.apic_id,
@@ -268,6 +286,7 @@
 		break;
 	default:
 		printf("\tUnknown type %d\n", (u_int)mp->type);
+		break;
 	}
 }
 
@@ -277,15 +296,15 @@
 	struct MADTbody *madtp;
 	struct MADT_APIC *madt_apicp;
 
+	printf(BEGIN_COMMENT);
 	acpi_print_sdt(sdp);
 	madtp = (struct MADTbody *) sdp->body;
-	printf(BEGIN_COMMENT);
 	printf("\tLocal APIC ADDR=0x%08x\n", madtp->lapic_addr);
 	printf("\tFlags={");
 	if (madtp->flags & ACPI_APIC_FLAG_PCAT_COMPAT)
 		printf("PC-AT");
 	printf("}\n");
-	madt_apicp = (struct MADT_APIC *) madtp->body;
+	madt_apicp = (struct MADT_APIC *)madtp->body;
 	while (((uintptr_t)madt_apicp) - ((uintptr_t)sdp) < sdp->len) {
 		printf("\n");
 		acpi_print_apic(madt_apicp);
@@ -300,9 +319,9 @@
 {
 	struct HPETbody *hpetp;
 
+	printf(BEGIN_COMMENT);
 	acpi_print_sdt(sdp);
 	hpetp = (struct HPETbody *) sdp->body;
-	printf(BEGIN_COMMENT);
 	printf("\tHPET Number=%d\n", hpetp->hpet_number);
 	printf("\tADDR=0x%08x\n", hpetp->base_addr);
 	printf("\tHW Rev=0x%x\n", hpetp->block_hwrev);
@@ -319,58 +338,27 @@
 }
 
 static void
-init_namespace()
+acpi_handle_ecdt(struct ACPIsdt *sdp)
 {
-	struct	aml_environ env;
-	struct	aml_name *newname;
+	struct ECDTbody *ecdt;
 
-	aml_new_name_group(AML_NAME_GROUP_OS_DEFINED);
-	env.curname = aml_get_rootname();
-	newname = aml_create_name(&env, "\\_OS_");
-	newname->property = aml_alloc_object(aml_t_string, NULL);
-	newname->property->str.needfree = 0;
-	newname->property->str.string = "Microsoft Windows NT";
+	printf(BEGIN_COMMENT);
+	acpi_print_sdt(sdp);
+	ecdt = (struct ECDTbody *) sdp->body;
+	printf("\tEC_CONTROL=");
+	acpi_print_gas(&ecdt->ec_control);
+	printf("\n\tEC_DATA=");
+	acpi_print_gas(&ecdt->ec_data);
+	printf("\n\tUID=%#x, ", ecdt->uid);
+	printf("GPE_BIT=%#x\n", ecdt->gpe_bit);
+	printf("\tEC_ID=%s\n", ecdt->ec_id);
+	printf(END_COMMENT);
 }
 
-/*
- * Public interfaces
- */
-
-void
-acpi_dump_dsdt(u_int8_t *dp, u_int8_t *end)
-{
-	extern struct aml_environ	asl_env;
-
-	acpi_print_dsdt_definition();
-
-	/* 1st stage: parse only w/o printing */
-	init_namespace();
-	aml_new_name_group((int)dp);
-	bzero(&asl_env, sizeof(asl_env));
-
-	asl_env.dp = dp;
-	asl_env.end = end;
-	asl_env.curname = aml_get_rootname();
-
-	aml_local_stack_push(aml_local_stack_create());
-	aml_parse_objectlist(&asl_env, 0);
-	aml_local_stack_delete(aml_local_stack_pop());
-
-	assert(asl_env.dp == asl_env.end);
-	asl_env.dp = dp;
-
-	/* 2nd stage: dump whole object list */
-	printf("\n{\n");
-	asl_dump_objectlist(&dp, end, 0);
-	printf("\n}\n");
-	assert(dp == end);
-}
-
-void
+static void
 acpi_print_sdt(struct ACPIsdt *sdp)
 {
-
-	printf(BEGIN_COMMENT);
+	printf("  ");
 	acpi_print_string(sdp->signature, 4);
 	printf(": Length=%d, Revision=%d, Checksum=%d,\n",
 	       sdp->len, sdp->rev, sdp->check);
@@ -382,115 +370,216 @@
 	printf("\tCreator ID=");
 	acpi_print_string(sdp->creator, 4);
 	printf(", Creator Revision=0x%x\n", sdp->crerev);
-	printf(END_COMMENT);
-	if (!memcmp(sdp->signature, "DSDT", 4)) {
-		memcpy(&dsdt_header, sdp, sizeof(dsdt_header));
-	}
 }
 
-void
+static void
 acpi_print_rsdt(struct ACPIsdt *rsdp)
 {
 	int	i, entries;
+	u_long	addr;
 
+	printf(BEGIN_COMMENT);
 	acpi_print_sdt(rsdp);
-	entries = (rsdp->len - SIZEOF_SDT_HDR) / sizeof(u_int32_t);
-	printf(BEGIN_COMMENT);
+	entries = (rsdp->len - SIZEOF_SDT_HDR) / addr_size;
 	printf("\tEntries={ ");
 	for (i = 0; i < entries; i++) {
 		if (i > 0)
 			printf(", ");
-		printf("0x%08x", rsdp->body[i]);
+		switch (addr_size) {
+		case 4:
+			addr = le32dec((char*)rsdp->body + i * addr_size);
+			break;
+		case 8:
+			addr = le64dec((char*)rsdp->body + i * addr_size);
+			break;
+		default:
+			addr = 0;
+		}
+		assert(addr != 0);
+		printf("0x%08lx", addr);
 	}
 	printf(" }\n");
 	printf(END_COMMENT);
 }
 
-void
-acpi_print_facp(struct FACPbody *facp)
+static const char *acpi_pm_profiles[] = {
+	"Unspecified", "Desktop", "Mobile", "Workstation",
+	"Enterprise Server", "SOHO Server", "Appliance PC"
+};
+
+static void
+acpi_print_fadt(struct FADTbody *fadt)
 {
-	char	sep;
+	const char *pm;
+	char	    sep;
 
 	printf(BEGIN_COMMENT);
-	printf("\tDSDT=0x%x\n", facp->dsdt_ptr);
-	printf("\tINT_MODEL=%s\n", facp->int_model ? "APIC" : "PIC");
-	printf("\tSCI_INT=%d\n", facp->sci_int);
-	printf("\tSMI_CMD=0x%x, ", facp->smi_cmd);
-	printf("ACPI_ENABLE=0x%x, ", facp->acpi_enable);
-	printf("ACPI_DISABLE=0x%x, ", facp->acpi_disable);
-	printf("S4BIOS_REQ=0x%x\n", facp->s4biosreq);
-	if (facp->pm1a_evt_blk)
-		printf("\tPM1a_EVT_BLK=0x%x-0x%x\n",
-		       facp->pm1a_evt_blk,
-		       facp->pm1a_evt_blk + facp->pm1_evt_len - 1);
-	if (facp->pm1b_evt_blk)
+	printf("  FADT:\tFACS=0x%x, DSDT=0x%x\n", fadt->facs_ptr,
+	       fadt->dsdt_ptr);
+	printf("\tINT_MODEL=%s\n", fadt->int_model ? "APIC" : "PIC");
+	if (fadt->pm_profile >= sizeof(acpi_pm_profiles) / sizeof(char *))
+		pm = "Reserved";
+	else
+		pm = acpi_pm_profiles[fadt->pm_profile];
+	printf("\tPreferred_PM_Profile=%s (%d)\n", pm, fadt->pm_profile);
+	printf("\tSCI_INT=%d\n", fadt->sci_int);
+	printf("\tSMI_CMD=0x%x, ", fadt->smi_cmd);
+	printf("ACPI_ENABLE=0x%x, ", fadt->acpi_enable);
+	printf("ACPI_DISABLE=0x%x, ", fadt->acpi_disable);
+	printf("S4BIOS_REQ=0x%x\n", fadt->s4biosreq);
+	printf("\tPSTATE_CNT=0x%x\n", fadt->pstate_cnt);
+	printf("\tPM1a_EVT_BLK=0x%x-0x%x\n",
+	       fadt->pm1a_evt_blk,
+	       fadt->pm1a_evt_blk + fadt->pm1_evt_len - 1);
+	if (fadt->pm1b_evt_blk != 0)
 		printf("\tPM1b_EVT_BLK=0x%x-0x%x\n",
-		       facp->pm1b_evt_blk,
-		       facp->pm1b_evt_blk + facp->pm1_evt_len - 1);
-	if (facp->pm1a_cnt_blk)
-		printf("\tPM1a_CNT_BLK=0x%x-0x%x\n",
-		       facp->pm1a_cnt_blk,
-		       facp->pm1a_cnt_blk + facp->pm1_cnt_len - 1);
-	if (facp->pm1b_cnt_blk)
+		       fadt->pm1b_evt_blk,
+		       fadt->pm1b_evt_blk + fadt->pm1_evt_len - 1);
+	printf("\tPM1a_CNT_BLK=0x%x-0x%x\n",
+	       fadt->pm1a_cnt_blk,
+	       fadt->pm1a_cnt_blk + fadt->pm1_cnt_len - 1);
+	if (fadt->pm1b_cnt_blk != 0)
 		printf("\tPM1b_CNT_BLK=0x%x-0x%x\n",
-		       facp->pm1b_cnt_blk,
-		       facp->pm1b_cnt_blk + facp->pm1_cnt_len - 1);
-	if (facp->pm2_cnt_blk)
+		       fadt->pm1b_cnt_blk,
+		       fadt->pm1b_cnt_blk + fadt->pm1_cnt_len - 1);
+	if (fadt->pm2_cnt_blk != 0)
 		printf("\tPM2_CNT_BLK=0x%x-0x%x\n",
-		       facp->pm2_cnt_blk,
-		       facp->pm2_cnt_blk + facp->pm2_cnt_len - 1);
-	if (facp->pm_tmr_blk)
-		printf("\tPM2_TMR_BLK=0x%x-0x%x\n",
-		       facp->pm_tmr_blk,
-		       facp->pm_tmr_blk + facp->pm_tmr_len - 1);
-	if (facp->gpe0_blk)
-		printf("\tPM2_GPE0_BLK=0x%x-0x%x\n",
-		       facp->gpe0_blk,
-		       facp->gpe0_blk + facp->gpe0_len - 1);
-	if (facp->gpe1_blk)
-		printf("\tPM2_GPE1_BLK=0x%x-0x%x, GPE1_BASE=%d\n",
-		       facp->gpe1_blk,
-		       facp->gpe1_blk + facp->gpe1_len - 1,
-		       facp->gpe1_base);
-	printf("\tP_LVL2_LAT=%dms, P_LVL3_LAT=%dms\n",
-	       facp->p_lvl2_lat, facp->p_lvl3_lat);
+		       fadt->pm2_cnt_blk,
+		       fadt->pm2_cnt_blk + fadt->pm2_cnt_len - 1);
+	printf("\tPM_TMR_BLK=0x%x-0x%x\n",
+	       fadt->pm_tmr_blk,
+	       fadt->pm_tmr_blk + fadt->pm_tmr_len - 1);
+	if (fadt->gpe0_blk != 0)
+		printf("\tGPE0_BLK=0x%x-0x%x\n",
+		       fadt->gpe0_blk,
+		       fadt->gpe0_blk + fadt->gpe0_len - 1);
+	if (fadt->gpe1_blk != 0)
+		printf("\tGPE1_BLK=0x%x-0x%x, GPE1_BASE=%d\n",
+		       fadt->gpe1_blk,
+		       fadt->gpe1_blk + fadt->gpe1_len - 1,
+		       fadt->gpe1_base);
+	if (fadt->cst_cnt != 0)
+		printf("\tCST_CNT=0x%x\n", fadt->cst_cnt);
+	printf("\tP_LVL2_LAT=%d us, P_LVL3_LAT=%d us\n",
+	       fadt->p_lvl2_lat, fadt->p_lvl3_lat);
 	printf("\tFLUSH_SIZE=%d, FLUSH_STRIDE=%d\n",
-	       facp->flush_size, facp->flush_stride);
+	       fadt->flush_size, fadt->flush_stride);
 	printf("\tDUTY_OFFSET=%d, DUTY_WIDTH=%d\n",
-	       facp->duty_off, facp->duty_width);
+	       fadt->duty_off, fadt->duty_width);
 	printf("\tDAY_ALRM=%d, MON_ALRM=%d, CENTURY=%d\n",
-	       facp->day_alrm, facp->mon_alrm, facp->century);
+	       fadt->day_alrm, fadt->mon_alrm, fadt->century);
+
+#define PRINTFLAG(var, flag) do {			\
+	if ((var) & FADT_FLAG_## flag) {		\
+		printf("%c%s", sep, #flag); sep = ',';	\
+	}						\
+} while (0)
+

>>> TRUNCATED FOR MAIL (1000 lines) <<<
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list