Module Name: src Committed By: jakllsch Date: Wed Sep 22 16:16:52 UTC 2010
Modified Files: src/sys/arch/amd64/amd64: machdep.c Log Message: Avoid fault if acpi_softc is NULL at attempted power-off. XXX at least some of this should be factored off into arch/x86. To generate a diff of this commit: cvs rdiff -u -r1.148 -r1.149 src/sys/arch/amd64/amd64/machdep.c 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.148 src/sys/arch/amd64/amd64/machdep.c:1.149 --- src/sys/arch/amd64/amd64/machdep.c:1.148 Sat Aug 7 20:07:25 2010 +++ src/sys/arch/amd64/amd64/machdep.c Wed Sep 22 16:16:51 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.148 2010/08/07 20:07:25 jruoho Exp $ */ +/* $NetBSD: machdep.c,v 1.149 2010/09/22 16:16:51 jakllsch 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.148 2010/08/07 20:07:25 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.149 2010/09/22 16:16:51 jakllsch Exp $"); /* #define XENDEBUG_LOW */ @@ -697,8 +697,10 @@ if ((howto & RB_POWERDOWN) == RB_POWERDOWN) { #ifndef XEN #if NACPICA > 0 - acpi_enter_sleep_state(acpi_softc, ACPI_STATE_S5); - printf("WARNING: powerdown failed!\n"); + if (acpi_softc != NULL) { + acpi_enter_sleep_state(acpi_softc, ACPI_STATE_S5); + printf("WARNING: ACPI powerdown failed!\n"); + } #endif #else /* XEN */ HYPERVISOR_shutdown();