| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: acpi.c,v 1.119 2008/09/10 03:56:12 jmcneill Exp $ */ | | 1 | /* $NetBSD: acpi.c,v 1.120 2008/09/19 11:19:33 jmcneill Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Charles M. Hannum of By Noon Software, Inc. | | 8 | * by Charles M. Hannum of By Noon Software, Inc. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -60,27 +60,27 @@ | | | @@ -60,27 +60,27 @@ |
60 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 60 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
61 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 61 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
62 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 62 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
63 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 63 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
64 | * POSSIBILITY OF SUCH DAMAGE. | | 64 | * POSSIBILITY OF SUCH DAMAGE. |
65 | */ | | 65 | */ |
66 | | | 66 | |
67 | /* | | 67 | /* |
68 | * Autoconfiguration support for the Intel ACPI Component Architecture | | 68 | * Autoconfiguration support for the Intel ACPI Component Architecture |
69 | * ACPI reference implementation. | | 69 | * ACPI reference implementation. |
70 | */ | | 70 | */ |
71 | | | 71 | |
72 | #include <sys/cdefs.h> | | 72 | #include <sys/cdefs.h> |
73 | __KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.119 2008/09/10 03:56:12 jmcneill Exp $"); | | 73 | __KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.120 2008/09/19 11:19:33 jmcneill Exp $"); |
74 | | | 74 | |
75 | #include "opt_acpi.h" | | 75 | #include "opt_acpi.h" |
76 | #include "opt_pcifixup.h" | | 76 | #include "opt_pcifixup.h" |
77 | | | 77 | |
78 | #include <sys/param.h> | | 78 | #include <sys/param.h> |
79 | #include <sys/systm.h> | | 79 | #include <sys/systm.h> |
80 | #include <sys/device.h> | | 80 | #include <sys/device.h> |
81 | #include <sys/malloc.h> | | 81 | #include <sys/malloc.h> |
82 | #include <sys/mutex.h> | | 82 | #include <sys/mutex.h> |
83 | #include <sys/kernel.h> | | 83 | #include <sys/kernel.h> |
84 | #include <sys/proc.h> | | 84 | #include <sys/proc.h> |
85 | #include <sys/sysctl.h> | | 85 | #include <sys/sysctl.h> |
86 | | | 86 | |
| @@ -1261,33 +1261,31 @@ acpi_enter_sleep_state(struct acpi_softc | | | @@ -1261,33 +1261,31 @@ acpi_enter_sleep_state(struct acpi_softc |
1261 | } | | 1261 | } |
1262 | | | 1262 | |
1263 | acpi_sleepstate = state; | | 1263 | acpi_sleepstate = state; |
1264 | if (state == ACPI_STATE_S1) { | | 1264 | if (state == ACPI_STATE_S1) { |
1265 | /* just enter the state */ | | 1265 | /* just enter the state */ |
1266 | acpi_md_OsDisableInterrupt(); | | 1266 | acpi_md_OsDisableInterrupt(); |
1267 | ret = AcpiEnterSleepState((UINT8)state); | | 1267 | ret = AcpiEnterSleepState((UINT8)state); |
1268 | if (ACPI_FAILURE(ret)) | | 1268 | if (ACPI_FAILURE(ret)) |
1269 | aprint_error_dev(sc->sc_dev, | | 1269 | aprint_error_dev(sc->sc_dev, |
1270 | "failed to enter sleep state S1: %s\n", | | 1270 | "failed to enter sleep state S1: %s\n", |
1271 | AcpiFormatException(ret)); | | 1271 | AcpiFormatException(ret)); |
1272 | AcpiLeaveSleepState((UINT8)state); | | 1272 | AcpiLeaveSleepState((UINT8)state); |
1273 | } else { | | 1273 | } else { |
1274 | int s = splhigh(); | | | |
1275 | err = acpi_md_sleep(state); | | 1274 | err = acpi_md_sleep(state); |
1276 | if (state == ACPI_STATE_S4) | | 1275 | if (state == ACPI_STATE_S4) |
1277 | AcpiEnable(); | | 1276 | AcpiEnable(); |
1278 | pmf_system_bus_resume(PMF_F_NONE); | | 1277 | pmf_system_bus_resume(PMF_F_NONE); |
1279 | AcpiLeaveSleepState((UINT8)state); | | 1278 | AcpiLeaveSleepState((UINT8)state); |
1280 | splx(s); | | | |
1281 | pmf_system_resume(PMF_F_NONE); | | 1279 | pmf_system_resume(PMF_F_NONE); |
1282 | } | | 1280 | } |
1283 | | | 1281 | |
1284 | break; | | 1282 | break; |
1285 | case ACPI_STATE_S5: | | 1283 | case ACPI_STATE_S5: |
1286 | ret = AcpiEnterSleepStatePrep(ACPI_STATE_S5); | | 1284 | ret = AcpiEnterSleepStatePrep(ACPI_STATE_S5); |
1287 | if (ACPI_FAILURE(ret)) { | | 1285 | if (ACPI_FAILURE(ret)) { |
1288 | aprint_error_dev(sc->sc_dev, | | 1286 | aprint_error_dev(sc->sc_dev, |
1289 | "failed preparing to sleep (%s)\n", | | 1287 | "failed preparing to sleep (%s)\n", |
1290 | AcpiFormatException(ret)); | | 1288 | AcpiFormatException(ret)); |
1291 | break; | | 1289 | break; |
1292 | } | | 1290 | } |
1293 | DELAY(1000000); | | 1291 | DELAY(1000000); |