diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2012-07-13 10:37:41 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2012-07-13 10:37:41 +0000 |
commit | b9cb29b33276a5d5938fa0305b728842f91ee998 (patch) | |
tree | 9e9194571d29c628fc18794b3d185dc2bb852e7a /sys | |
parent | 789eaa79995ac044c1ec8dcb8a2106b1059bd561 (diff) |
Make the ACPI EC aware of the AML global lock.
Comments from kettenis@ and matthew@.
Okay deraadt@, kettenis@.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/acpi/acpidev.h | 3 | ||||
-rw-r--r-- | sys/dev/acpi/acpiec.c | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpidev.h b/sys/dev/acpi/acpidev.h index c04d292d133..4db5e1d1c1f 100644 --- a/sys/dev/acpi/acpidev.h +++ b/sys/dev/acpi/acpidev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidev.h,v 1.32 2010/08/06 21:12:27 marco Exp $ */ +/* $OpenBSD: acpidev.h,v 1.33 2012/07/13 10:37:40 pirofti Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> @@ -332,6 +332,7 @@ struct acpiec_softc { u_int32_t sc_gpe; struct acpiec_event sc_events[ACPIEC_MAX_EVENTS]; int sc_gotsci; + int sc_glk; }; void acpibtn_disable_psw(void); diff --git a/sys/dev/acpi/acpiec.c b/sys/dev/acpi/acpiec.c index cabb3000441..e6a5e01854a 100644 --- a/sys/dev/acpi/acpiec.c +++ b/sys/dev/acpi/acpiec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiec.c,v 1.45 2012/03/10 21:27:07 kettenis Exp $ */ +/* $OpenBSD: acpiec.c,v 1.46 2012/07/13 10:37:40 pirofti Exp $ */ /* * Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org> * @@ -253,7 +253,8 @@ acpiec_match(struct device *parent, void *match, void *aux) struct acpi_softc *acpisc = (struct acpi_softc *)parent; /* Check for early ECDT table attach */ - if (ecdt && !memcmp(ecdt->hdr.signature, ECDT_SIG, sizeof(ECDT_SIG) - 1)) + if (ecdt && + !memcmp(ecdt->hdr.signature, ECDT_SIG, sizeof(ECDT_SIG) - 1)) return (1); if (acpisc->sc_ec) return (0); @@ -267,6 +268,7 @@ acpiec_attach(struct device *parent, struct device *self, void *aux) { struct acpiec_softc *sc = (struct acpiec_softc *)self; struct acpi_attach_args *aa = aux; + struct aml_value res; sc->sc_acpi = (struct acpi_softc *)parent; sc->sc_devnode = aa->aaa_node; @@ -291,6 +293,13 @@ acpiec_attach(struct device *parent, struct device *self, void *aux) acpi_set_gpehandler(sc->sc_acpi, sc->sc_gpe, acpiec_gpehandler, sc, 1); #endif + + if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "_GLK", 0, NULL, &res)) + sc->sc_glk = 0; + else if (res.type != AML_OBJTYPE_INTEGER) + sc->sc_glk = 0; + else + sc->sc_glk = res.v_integer ? 1 : 0; printf("\n"); } |