Deleted Added
full compact
acpi.c (125135) acpi.c (125679)
1/*-
2 * Copyright (c) 2000 Takanori Watanabe <takawata@jp.freebsd.org>
3 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
4 * Copyright (c) 2000, 2001 Michael Smith
5 * Copyright (c) 2000 BSDi
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2000 Takanori Watanabe <takawata@jp.freebsd.org>
3 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
4 * Copyright (c) 2000, 2001 Michael Smith
5 * Copyright (c) 2000 BSDi
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/dev/acpica/acpi.c 125135 2004-01-28 07:48:03Z roam $
29 * $FreeBSD: head/sys/dev/acpica/acpi.c 125679 2004-02-11 02:57:33Z njl $
30 */
31
32#include "opt_acpi.h"
33#include <sys/param.h>
34#include <sys/kernel.h>
35#include <sys/proc.h>
36#include <sys/fcntl.h>
37#include <sys/malloc.h>

--- 1082 unchanged lines hidden (view full) ---

1120
1121 ACPI_ASSERTLOCK;
1122
1123 /* Enable and clear fixed events and install handlers. */
1124 if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->PwrButton == 0) {
1125 AcpiEnableEvent(ACPI_EVENT_POWER_BUTTON, 0);
1126 AcpiClearEvent(ACPI_EVENT_POWER_BUTTON);
1127 AcpiInstallFixedEventHandler(ACPI_EVENT_POWER_BUTTON,
30 */
31
32#include "opt_acpi.h"
33#include <sys/param.h>
34#include <sys/kernel.h>
35#include <sys/proc.h>
36#include <sys/fcntl.h>
37#include <sys/malloc.h>

--- 1082 unchanged lines hidden (view full) ---

1120
1121 ACPI_ASSERTLOCK;
1122
1123 /* Enable and clear fixed events and install handlers. */
1124 if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->PwrButton == 0) {
1125 AcpiEnableEvent(ACPI_EVENT_POWER_BUTTON, 0);
1126 AcpiClearEvent(ACPI_EVENT_POWER_BUTTON);
1127 AcpiInstallFixedEventHandler(ACPI_EVENT_POWER_BUTTON,
1128 acpi_eventhandler_power_button_for_sleep,
1129 sc);
1128 acpi_event_power_button_sleep, sc);
1130 if (first_time)
1131 device_printf(sc->acpi_dev, "Power Button (fixed)\n");
1132 }
1133 if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->SleepButton == 0) {
1134 AcpiEnableEvent(ACPI_EVENT_SLEEP_BUTTON, 0);
1135 AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON);
1136 AcpiInstallFixedEventHandler(ACPI_EVENT_SLEEP_BUTTON,
1129 if (first_time)
1130 device_printf(sc->acpi_dev, "Power Button (fixed)\n");
1131 }
1132 if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->SleepButton == 0) {
1133 AcpiEnableEvent(ACPI_EVENT_SLEEP_BUTTON, 0);
1134 AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON);
1135 AcpiInstallFixedEventHandler(ACPI_EVENT_SLEEP_BUTTON,
1137 acpi_eventhandler_sleep_button_for_sleep,
1138 sc);
1136 acpi_event_sleep_button_sleep, sc);
1139 if (first_time)
1140 device_printf(sc->acpi_dev, "Sleep Button (fixed)\n");
1141 }
1142
1143 first_time = 0;
1144}
1145
1146/*

--- 567 unchanged lines hidden (view full) ---

1714
1715 return_VOID;
1716}
1717
1718/*
1719 * ACPICA Event Handlers (FixedEvent, also called from button notify handler)
1720 */
1721UINT32
1137 if (first_time)
1138 device_printf(sc->acpi_dev, "Sleep Button (fixed)\n");
1139 }
1140
1141 first_time = 0;
1142}
1143
1144/*

--- 567 unchanged lines hidden (view full) ---

1712
1713 return_VOID;
1714}
1715
1716/*
1717 * ACPICA Event Handlers (FixedEvent, also called from button notify handler)
1718 */
1719UINT32
1722acpi_eventhandler_power_button_for_sleep(void *context)
1720acpi_event_power_button_sleep(void *context)
1723{
1724 struct acpi_softc *sc = (struct acpi_softc *)context;
1725
1726 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
1727
1728 EVENTHANDLER_INVOKE(acpi_sleep_event, sc->acpi_power_button_sx);
1729
1730 return_VALUE (ACPI_INTERRUPT_HANDLED);
1731}
1732
1733UINT32
1721{
1722 struct acpi_softc *sc = (struct acpi_softc *)context;
1723
1724 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
1725
1726 EVENTHANDLER_INVOKE(acpi_sleep_event, sc->acpi_power_button_sx);
1727
1728 return_VALUE (ACPI_INTERRUPT_HANDLED);
1729}
1730
1731UINT32
1734acpi_eventhandler_power_button_for_wakeup(void *context)
1732acpi_event_power_button_wake(void *context)
1735{
1736 struct acpi_softc *sc = (struct acpi_softc *)context;
1737
1738 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
1739
1740 EVENTHANDLER_INVOKE(acpi_wakeup_event, sc->acpi_power_button_sx);
1741
1742 return_VALUE (ACPI_INTERRUPT_HANDLED);
1743}
1744
1745UINT32
1733{
1734 struct acpi_softc *sc = (struct acpi_softc *)context;
1735
1736 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
1737
1738 EVENTHANDLER_INVOKE(acpi_wakeup_event, sc->acpi_power_button_sx);
1739
1740 return_VALUE (ACPI_INTERRUPT_HANDLED);
1741}
1742
1743UINT32
1746acpi_eventhandler_sleep_button_for_sleep(void *context)
1744acpi_event_sleep_button_sleep(void *context)
1747{
1748 struct acpi_softc *sc = (struct acpi_softc *)context;
1749
1750 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
1751
1752 EVENTHANDLER_INVOKE(acpi_sleep_event, sc->acpi_sleep_button_sx);
1753
1754 return_VALUE (ACPI_INTERRUPT_HANDLED);
1755}
1756
1757UINT32
1745{
1746 struct acpi_softc *sc = (struct acpi_softc *)context;
1747
1748 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
1749
1750 EVENTHANDLER_INVOKE(acpi_sleep_event, sc->acpi_sleep_button_sx);
1751
1752 return_VALUE (ACPI_INTERRUPT_HANDLED);
1753}
1754
1755UINT32
1758acpi_eventhandler_sleep_button_for_wakeup(void *context)
1756acpi_event_sleep_button_wake(void *context)
1759{
1760 struct acpi_softc *sc = (struct acpi_softc *)context;
1761
1762 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
1763
1764 EVENTHANDLER_INVOKE(acpi_wakeup_event, sc->acpi_sleep_button_sx);
1765
1766 return_VALUE (ACPI_INTERRUPT_HANDLED);

--- 681 unchanged lines hidden ---
1757{
1758 struct acpi_softc *sc = (struct acpi_softc *)context;
1759
1760 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
1761
1762 EVENTHANDLER_INVOKE(acpi_wakeup_event, sc->acpi_sleep_button_sx);
1763
1764 return_VALUE (ACPI_INTERRUPT_HANDLED);

--- 681 unchanged lines hidden ---