Module Name:    src
Committed By:   jruoho
Date:           Sat Aug  7 20:07:26 UTC 2010

Modified Files:
        src/sys/arch/amd64/amd64: machdep.c
        src/sys/arch/i386/i386: machdep.c
        src/sys/dev/acpi: acpi.c acpivar.h

Log Message:
Do not try to disable ACPI if we can not enter to legacy mode. While it is
safe to call AcpiDisable() even if a system operates only in ACPI mode, this
leads to unpleasantly verbose error messages in ACPICA.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.691 -r1.692 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.213 -r1.214 src/sys/dev/acpi/acpi.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/acpi/acpivar.h

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

Modified files:

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.147 src/sys/arch/amd64/amd64/machdep.c:1.148
--- src/sys/arch/amd64/amd64/machdep.c:1.147	Sat Jul 31 18:38:32 2010
+++ src/sys/arch/amd64/amd64/machdep.c	Sat Aug  7 20:07:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.147 2010/07/31 18:38:32 joerg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.148 2010/08/07 20:07:25 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -107,7 +107,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.147 2010/07/31 18:38:32 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.148 2010/08/07 20:07:25 jruoho Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -709,7 +709,7 @@
 
 	if (howto & RB_HALT) {
 #if NACPICA > 0
-		AcpiDisable();
+		acpi_disable();
 #endif
 
 		printf("\n");

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.691 src/sys/arch/i386/i386/machdep.c:1.692
--- src/sys/arch/i386/i386/machdep.c:1.691	Sat Jul 24 00:45:54 2010
+++ src/sys/arch/i386/i386/machdep.c	Sat Aug  7 20:07:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.691 2010/07/24 00:45:54 jym Exp $	*/
+/*	$NetBSD: machdep.c,v 1.692 2010/08/07 20:07:26 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.691 2010/07/24 00:45:54 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.692 2010/08/07 20:07:26 jruoho Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -942,7 +942,7 @@
 
 	if (howto & RB_HALT) {
 #if NACPICA > 0
-		AcpiDisable();
+		acpi_disable();
 #endif
 
 		printf("\n");

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.213 src/sys/dev/acpi/acpi.c:1.214
--- src/sys/dev/acpi/acpi.c:1.213	Sat Aug  7 17:12:55 2010
+++ src/sys/dev/acpi/acpi.c	Sat Aug  7 20:07:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.213 2010/08/07 17:12:55 jruoho Exp $	*/
+/*	$NetBSD: acpi.c,v 1.214 2010/08/07 20:07:25 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.213 2010/08/07 17:12:55 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.214 2010/08/07 20:07:25 jruoho Exp $");
 
 #include "opt_acpi.h"
 #include "opt_pcifixup.h"
@@ -363,6 +363,14 @@
 	return 0;
 }
 
+void
+acpi_disable(void)
+{
+
+	if (AcpiGbl_FADT.SmiCommand != 0)
+		AcpiDisable();
+}
+
 int
 acpi_check(device_t parent, const char *ifattr)
 {

Index: src/sys/dev/acpi/acpivar.h
diff -u src/sys/dev/acpi/acpivar.h:1.60 src/sys/dev/acpi/acpivar.h:1.61
--- src/sys/dev/acpi/acpivar.h:1.60	Sat Aug  7 09:41:19 2010
+++ src/sys/dev/acpi/acpivar.h	Sat Aug  7 20:07:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpivar.h,v 1.60 2010/08/07 09:41:19 jruoho Exp $	*/
+/*	$NetBSD: acpivar.h,v 1.61 2010/08/07 20:07:25 jruoho Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -266,6 +266,7 @@
 extern const struct acpi_resource_parse_ops acpi_resource_parse_ops_default;
 
 int		acpi_probe(void);
+void		acpi_disable(void);
 int		acpi_check(device_t, const char *);
 
 ACPI_PHYSICAL_ADDRESS	acpi_OsGetRootPointer(void);

Reply via email to