Module Name:    src
Committed By:   jruoho
Date:           Wed Jun 30 07:42:36 UTC 2010

Modified Files:
        src/share/man/man4: acpi.4
        src/sys/dev/acpi: acpi_debug.c

Log Message:
Provide a sysctl-knob for the Debug() opcode, hw.acpi.debug.object. This
prints debug-messages possibly used in the AML. Only enabled for ACPI_DEBUG
kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/share/man/man4/acpi.4
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/acpi_debug.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/acpi.4
diff -u src/share/man/man4/acpi.4:1.51 src/share/man/man4/acpi.4:1.52
--- src/share/man/man4/acpi.4:1.51	Mon Jun  7 08:39:04 2010
+++ src/share/man/man4/acpi.4	Wed Jun 30 07:42:36 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpi.4,v 1.51 2010/06/07 08:39:04 jruoho Exp $
+.\" $NetBSD: acpi.4,v 1.52 2010/06/30 07:42:36 jruoho Exp $
 .\"
 .\" Copyright (c) 2002, 2004, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 7, 2010
+.Dd June 30, 2010
 .Dt ACPI 4
 .Os
 .Sh NAME
@@ -357,21 +357,26 @@
 .Ic acpi_osd_debugger .
 .Ss Debug Output
 .Nx
-provides two
+provides three
 .Xr sysctl 8
 variables that control the debug output at runtime.
 The
 .Ic hw.acpi.debug.layer
-limits the output to a specific
+variable limits the output to a specific
 .Tn ACPI
 layer and the
 .Ic hw.acpi.debug.level
-controls the debug level.
+variable controls the debug level.
 Both
 .Xr sysctl 8
 variables are string literals.
+The third variable is
+.Ic hw.acpi.debug.object .
+This is a boolean that controls whether debug messages internal to the
+.Tn AML
+are enabled.
 .Pp
-The possible values are:
+For the first two variables, the possible values are:
 .Bl -column -offset indent \
 "ACPI_RESOURCE_COMPONENT     " "ACPI_RESOURCE_COMPONENT     "
 .It Sy LAYER Ta Sy LEVEL
@@ -484,6 +489,24 @@
 .Xr sysctl 8
 variable is always specified with the prefix
 .Dv ACPI_LV .
+.Pp
+Another example can be mentioned for the use of
+.Ic hw.acpi.debug.object .
+The following could appear in an
+.Tn ASL
+code:
+.Bd -literal -offset indent
+Method(_Q19, 0, NotSerialized)
+{
+	Store("_Q19 invoked", Debug)
+	Notify(ACAD, 0x80)
+}
+.Ed
+.Pp
+When
+.Ic hw.acpi.debug.object
+is set to 1, the message stored to the debug object
+is printed every time the method is called by the interpreter.
 .Sh SEE ALSO
 .Xr acpiacad 4 ,
 .Xr acpibat 4 ,

Index: src/sys/dev/acpi/acpi_debug.c
diff -u src/sys/dev/acpi/acpi_debug.c:1.2 src/sys/dev/acpi/acpi_debug.c:1.3
--- src/sys/dev/acpi/acpi_debug.c:1.2	Mon Apr 12 12:14:26 2010
+++ src/sys/dev/acpi/acpi_debug.c	Wed Jun 30 07:42:36 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_debug.c,v 1.2 2010/04/12 12:14:26 jruoho Exp $ */
+/* $NetBSD: acpi_debug.c,v 1.3 2010/06/30 07:42:36 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen <jruoho...@iki.fi>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_debug.c,v 1.2 2010/04/12 12:14:26 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_debug.c,v 1.3 2010/06/30 07:42:36 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/sysctl.h>
@@ -120,6 +120,15 @@
 	if (rv != 0)
 		goto fail;
 
+	rv = sysctl_createv(NULL, 0, &rnode, NULL,
+	    CTLFLAG_READWRITE, CTLTYPE_BOOL, "object",
+	    SYSCTL_DESCR("ACPI debug object"),
+	    NULL, 0, &AcpiGbl_EnableAmlDebugObject, 0,
+	    CTL_CREATE, CTL_EOL);
+
+	if (rv != 0)
+		goto fail;
+
 	layer = acpi_debug_getkey(acpi_debug_layer_d, AcpiDbgLayer);
 	level = acpi_debug_getkey(acpi_debug_level_d, AcpiDbgLevel);
 

Reply via email to