Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Provide a sysctl-knob for the Debug() opcode, hw.acpi.debug....



details:   https://anonhg.NetBSD.org/src/rev/b69d5f4bca4b
branches:  trunk
changeset: 755948:b69d5f4bca4b
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Wed Jun 30 07:42:36 2010 +0000

description:
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.

diffstat:

 share/man/man4/acpi.4     |  35 +++++++++++++++++++++++++++++------
 sys/dev/acpi/acpi_debug.c |  13 +++++++++++--
 2 files changed, 40 insertions(+), 8 deletions(-)

diffs (108 lines):

diff -r c5cb6bb165cd -r b69d5f4bca4b share/man/man4/acpi.4
--- a/share/man/man4/acpi.4     Wed Jun 30 07:30:16 2010 +0000
+++ b/share/man/man4/acpi.4     Wed Jun 30 07:42:36 2010 +0000
@@ -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 ,
diff -r c5cb6bb165cd -r b69d5f4bca4b sys/dev/acpi/acpi_debug.c
--- a/sys/dev/acpi/acpi_debug.c Wed Jun 30 07:30:16 2010 +0000
+++ b/sys/dev/acpi/acpi_debug.c Wed Jun 30 07:42:36 2010 +0000
@@ -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 <jruohonen%iki.fi@localhost>
@@ -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);
 



Home | Main Index | Thread Index | Old Index