Module Name: src Committed By: jruoho Date: Thu Jan 13 03:45:38 UTC 2011
Modified Files: src/sys/arch/x86/acpi: acpi_wakeup.c Log Message: Add a comment. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/x86/acpi/acpi_wakeup.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/x86/acpi/acpi_wakeup.c diff -u src/sys/arch/x86/acpi/acpi_wakeup.c:1.26 src/sys/arch/x86/acpi/acpi_wakeup.c:1.27 --- src/sys/arch/x86/acpi/acpi_wakeup.c:1.26 Fri Dec 31 09:19:43 2010 +++ src/sys/arch/x86/acpi/acpi_wakeup.c Thu Jan 13 03:45:38 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_wakeup.c,v 1.26 2010/12/31 09:19:43 jruoho Exp $ */ +/* $NetBSD: acpi_wakeup.c,v 1.27 2011/01/13 03:45:38 jruoho Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.26 2010/12/31 09:19:43 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.27 2011/01/13 03:45:38 jruoho Exp $"); /*- * Copyright (c) 2001 Takanori Watanabe <takaw...@jp.freebsd.org> @@ -341,12 +341,19 @@ initrtclock(TIMER_FREQ); inittodr(time_second); - AcpiClearEvent(ACPI_EVENT_PMTIMER); - AcpiClearEvent(ACPI_EVENT_GLOBAL); - AcpiClearEvent(ACPI_EVENT_POWER_BUTTON); - AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON); - AcpiClearEvent(ACPI_EVENT_RTC); - AcpiHwDisableAllGpes (); + /* + * Clear fixed events (see e.g. ACPI 3.0, p. 62). + * Also prevent GPEs from misfiring by disabling + * all GPEs before interrupts are enabled. The + * AcpiLeaveSleepState() function will enable + * and handle the general purpose events later. + */ + (void)AcpiClearEvent(ACPI_EVENT_PMTIMER); + (void)AcpiClearEvent(ACPI_EVENT_GLOBAL); + (void)AcpiClearEvent(ACPI_EVENT_POWER_BUTTON); + (void)AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON); + (void)AcpiClearEvent(ACPI_EVENT_RTC); + (void)AcpiHwDisableAllGpes(); acpi_pci_link_resume();