From owner-svn-src-head@FreeBSD.ORG Tue Mar 9 19:02:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B48761065677; Tue, 9 Mar 2010 19:02:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A34858FC14; Tue, 9 Mar 2010 19:02:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o29J23oM001750; Tue, 9 Mar 2010 19:02:03 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o29J22lv001749; Tue, 9 Mar 2010 19:02:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003091902.o29J22lv001749@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 9 Mar 2010 19:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204916 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2010 19:02:03 -0000 Author: jkim Date: Tue Mar 9 19:02:02 2010 New Revision: 204916 URL: http://svn.freebsd.org/changeset/base/204916 Log: - Allow users to enable dumping Debug objects without ACPI debugger. Setting the new sysctl MIB "debug.acpi.enable_debug_objects" to a non-zero value enables us to print Debug object when something is written to it. - Allow users to disable interpreter slack mode. Setting the new tunable "debug.acpi.interpreter_slack" to zero disables some workarounds for common BIOS mistakes and enables strict ACPI implementations by the specification. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Mar 9 17:26:50 2010 (r204915) +++ head/sys/dev/acpica/acpi.c Tue Mar 9 19:02:02 2010 (r204916) @@ -162,6 +162,7 @@ static int acpi_sname2sstate(const char static const char *acpi_sstate2sname(int sstate); static int acpi_supported_sleep_state_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS); +static int acpi_debug_objects_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_pm_func(u_long cmd, void *arg, ...); static int acpi_child_location_str_method(device_t acdev, device_t child, char *buf, size_t buflen); @@ -253,6 +254,19 @@ SYSCTL_STRING(_debug_acpi, OID_AUTO, acp static int acpi_serialize_methods; TUNABLE_INT("hw.acpi.serialize_methods", &acpi_serialize_methods); +/* Allow users to dump Debug objects without ACPI debugger. */ +static int acpi_debug_objects; +TUNABLE_INT("debug.acpi.enable_debug_objects", &acpi_debug_objects); +SYSCTL_PROC(_debug_acpi, OID_AUTO, enable_debug_objects, + CTLFLAG_RW | CTLTYPE_INT, NULL, 0, acpi_debug_objects_sysctl, "I", + "Enable Debug objects"); + +/* Allow the interpreter to ignore common mistakes in BIOS. */ +static int acpi_interpreter_slack = 1; +TUNABLE_INT("debug.acpi.interpreter_slack", &acpi_interpreter_slack); +SYSCTL_INT(_debug_acpi, OID_AUTO, interpreter_slack, CTLFLAG_RDTUN, + &acpi_interpreter_slack, 1, "Turn on interpreter slack mode."); + /* Power devices off and on in suspend and resume. XXX Remove once tested. */ static int acpi_do_powerstate = 1; TUNABLE_INT("debug.acpi.do_powerstate", &acpi_do_powerstate); @@ -452,8 +466,17 @@ acpi_attach(device_t dev) * Set the globals from our tunables. This is needed because ACPI-CA * uses UINT8 for some values and we have no tunable_byte. */ - AcpiGbl_AllMethodsSerialized = acpi_serialize_methods; - AcpiGbl_EnableInterpreterSlack = TRUE; + AcpiGbl_AllMethodsSerialized = acpi_serialize_methods ? TRUE : FALSE; + AcpiGbl_EnableInterpreterSlack = acpi_interpreter_slack ? TRUE : FALSE; + AcpiGbl_EnableAmlDebugObject = acpi_debug_objects ? TRUE : FALSE; + +#ifndef ACPI_DEBUG + /* + * Disable all debugging layers and levels. + */ + AcpiDbgLayer = 0; + AcpiDbgLevel = 0; +#endif /* Start up the ACPI CA subsystem. */ status = AcpiInitializeSubsystem(); @@ -3447,8 +3470,6 @@ acpi_set_debugging(void *junk) AcpiDbgLevel = 0; } - AcpiGbl_EnableAmlDebugObject = TRUE; - layer = getenv("debug.acpi.layer"); level = getenv("debug.acpi.level"); if (layer == NULL && level == NULL) @@ -3525,6 +3546,26 @@ SYSCTL_PROC(_debug_acpi, OID_AUTO, level #endif /* ACPI_DEBUG */ static int +acpi_debug_objects_sysctl(SYSCTL_HANDLER_ARGS) +{ + int error; + int old; + + old = acpi_debug_objects; + error = sysctl_handle_int(oidp, &acpi_debug_objects, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (old == acpi_debug_objects || (old && acpi_debug_objects)) + return (0); + + ACPI_SERIAL_BEGIN(acpi); + AcpiGbl_EnableAmlDebugObject = acpi_debug_objects ? TRUE : FALSE; + ACPI_SERIAL_END(acpi); + + return (0); +} + +static int acpi_pm_func(u_long cmd, void *arg, ...) { int state, acpi_state;